Skip to content

Running build.sh on linux fail #226

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
leruaa opened this issue Apr 4, 2020 · 8 comments
Open

Running build.sh on linux fail #226

leruaa opened this issue Apr 4, 2020 · 8 comments
Labels
bug Something isn't working

Comments

@leruaa
Copy link

leruaa commented Apr 4, 2020

I'm on Arch linux, right after cloning the repo, running .\build.sh give:

███╗   ██╗██╗   ██╗██╗  ██╗███████╗
████╗  ██║██║   ██║██║ ██╔╝██╔════╝
██╔██╗ ██║██║   ██║█████╔╝ █████╗  
██║╚██╗██║██║   ██║██╔═██╗ ██╔══╝  
██║ ╚████║╚██████╔╝██║  ██╗███████╗
╚═╝  ╚═══╝ ╚═════╝ ╚═╝  ╚═╝╚══════╝

NUKE Execution Engine version 0.24.4 (Linux,.NETCoreApp,Version=v2.1)

> /usr/bin/git rev-parse --abbrev-ref HEAD
Assertion failed: Could not find 'GitVersion.dll', or 'GitVersion.exe' inside '/home/aurel/.nuget/packages/gitversion.tool/5.2.4'.
   at Nuke.Common.ControlFlow.Fail(String text)
   at Nuke.Common.ControlFlow.Assert(Boolean condition, String text)
   at Nuke.Common.Tooling.ToolPathResolver.GetPackageExecutable(String packageId, String packageExecutable, String version, String framework)
   at Nuke.Common.Tools.GitVersion.GitVersionTasks.GetToolPath(String framework)
   at Nuke.Common.Tools.GitVersion.GitVersionSettings.GetToolPath()
   at Nuke.Common.Tools.GitVersion.GitVersionSettings.get_ToolPath()
   at Nuke.Common.Tooling.ProcessTasks.StartProcess(ToolSettings toolSettings)
   at Nuke.Common.Tools.GitVersion.GitVersionTasks.GitVersion(GitVersionSettings toolSettings)
   at Nuke.Common.Tools.GitVersion.GitVersionTasks.GitVersion(Configure`1 configurator)
   at Rocket.Surgery.Nuke.ComputedGitVersionAttribute.GetValue(MemberInfo member, Object instance) in /_/src/Nuke/ComputedGitVersionAttribute.cs:line 45
   at Nuke.Common.Execution.InjectionUtility.InjectValuesInternal[T](T instance, IEnumerable`1 tuples)
   at Nuke.Common.Execution.InjectionUtility.InjectValues[T](T instance, Func`2 filter)
   at Nuke.Common.Execution.BuildManager.Execute[T](Expression`1[] defaultTargetExpressions)

Repeating warnings and errors:
Assertion failed: Could not find 'GitVersion.dll', or 'GitVersion.exe' inside '/home/aurel/.nuget/packages/gitversion.tool/5.2.4'.

The dotnet version:
dotnet --version
3.1.103

@jarmo
Copy link

jarmo commented Apr 16, 2020

Same problem under Ubuntu WSL on Windows 10.

@PlaidPhantom
Copy link

FWIW I also just now received the same error on Ubuntu 18.04.

dotnet --version
3.1.201

@ivanbakel
Copy link

ivanbakel commented Apr 30, 2020

This looks to be a problem with case-sensitive filepaths. The file being searched for (specifically, gitversion.dll) is included in the NuGet package, just in a lowercase form.

Renaming the .dll and its associated package files to GitVersion will allow the build to progress, but that just delays the error until later, when something else goes looking for it instead.

I got it to work permanently by symlinking GitVersion.dll to gitversion.dll - it seems that once the build system finds the file, it uses the lowercase form, but it just needs a bit of help first.

Note: this even works on NTFS, so it should affect WSL. NTFS is case-sensitive, even though Windows treats it as case-insensitive.

@leruaa
Copy link
Author

leruaa commented May 2, 2020

Thanks, I created a symlink from ~/.nuget/packages/gitversion.tool/5.2.4/tools/netcoreapp3.1/any/gitversion.dll to GitVersion.dll and it works !

@leruaa leruaa closed this as completed May 2, 2020
@leruaa
Copy link
Author

leruaa commented May 2, 2020

I spoke too fast, now I have an error when /usr/bin/dotnet ~/.nuget/packages/gitversion.tool/5.2.4/tools/netcoreapp3.1/any/GitVersion.dll is run:

INFO [05/02/20 22:49:37:77] Working directory: /home/aurel/Dev/csharp-language-server-protocol
ERROR [05/02/20 22:49:37:79] An unexpected error occurred:
System.TypeInitializationException: The type initializer for 'LibGit2Sharp.Core.NativeMethods' threw an exception.
 ---> System.DllNotFoundException: Unable to load shared library 'git2-106a5f2' or one of its dependencies. In order to help diagnose loading problems, consider setting the LD_DEBUG environment variable: libgit2-106a5f2: cannot open shared object file: No such file or directory
   at LibGit2Sharp.Core.NativeMethods.git_libgit2_init()
   at LibGit2Sharp.Core.NativeMethods.InitializeNativeLibrary()
   at LibGit2Sharp.Core.NativeMethods..cctor()
   --- End of inner exception stack trace ---
   at LibGit2Sharp.Core.NativeMethods.git_buf_dispose(GitBuf buf)
   at LibGit2Sharp.Core.Proxy.git_buf_dispose(GitBuf buf)
   at LibGit2Sharp.Core.Handles.GitBuf.Dispose()
   at LibGit2Sharp.Core.Proxy.ConvertPath(Func`2 pathRetriever)
   at LibGit2Sharp.Core.Proxy.git_repository_discover(FilePath start_path)
   at LibGit2Sharp.Repository.Discover(String startingPath)
   at GitVersion.Extensions.ArgumentExtensions.GetProjectRootDirectory(Arguments arguments) in D:\a\GitVersion\GitVersion\src\GitVersionCore\Extensions\ArgumentExtensions.cs:line 34
   at GitVersion.Configuration.ConfigFileLocator.Verify(Arguments arguments) in D:\a\GitVersion\GitVersion\src\GitVersionCore\Configuration\ConfigFileLocator.cs:line 53
   at GitVersion.GitVersionExecutor.HandleNonMainCommand(Arguments arguments, Int32& exitCode) in D:\a\GitVersion\GitVersion\src\GitVersionExe\GitVersionExecutor.cs:line 155
   at GitVersion.GitVersionExecutor.VerifyArgumentsAndRun(Arguments arguments) in D:\a\GitVersion\GitVersion\src\GitVersionExe\GitVersionExecutor.cs:line 58

@leruaa leruaa reopened this May 2, 2020
@david-driscoll
Copy link
Member

I'll see if I can make gitversion optional

@david-driscoll david-driscoll added the bug Something isn't working label May 11, 2020
@matkoch
Copy link

matkoch commented May 24, 2020

@david-driscoll the first error is because GitVersion has changed there casing in the package. The second really looks like an issue on their side.

@gukz
Copy link

gukz commented Jul 11, 2020

After I remove gitversion inDirectory.Build.targets and /src/Directory.Build.props, I build successful. hope this help you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

7 participants