Skip to content
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

macOS build with VS for Mac #179

Closed
bruno-garcia opened this issue Sep 28, 2018 · 4 comments
Closed

macOS build with VS for Mac #179

bruno-garcia opened this issue Sep 28, 2018 · 4 comments

Comments

@bruno-garcia
Copy link
Member

Builds with dotnet CLI but fails with Visual Studio for Mac

I'm hitting this issue on macOS 10.13.6 with Visual Studio for Mac 7.7 preview (build 1282)

Mono version:

17:04 $ mono --version
Mono JIT compiler version 5.16.0.151 (2018-06/5e81afa90df Fri Sep  7 12:05:47 EDT 2018)
Target InitializeSourceControlInformationFromSourceControlManager:
    /Users/bruno/.nuget/packages/microsoft.build.tasks.git/1.0.0-beta-63127-02/build/Microsoft.Build.Tasks.Git.targets(20,5): error MSB4018: The "Microsoft.Build.Tasks.Git.LocateRepository" task failed unexpectedly.
    /Users/bruno/.nuget/packages/microsoft.build.tasks.git/1.0.0-beta-63127-02/build/Microsoft.Build.Tasks.Git.targets(20,5): error MSB4018: System.BadImageFormatException: Method has no body
    /Users/bruno/.nuget/packages/microsoft.build.tasks.git/1.0.0-beta-63127-02/build/Microsoft.Build.Tasks.Git.targets(20,5): error MSB4018: File name: 'LibGit2Sharp'
    /Users/bruno/.nuget/packages/microsoft.build.tasks.git/1.0.0-beta-63127-02/build/Microsoft.Build.Tasks.Git.targets(20,5): error MSB4018:   at LibGit2Sharp.Core.Proxy.git_buf_free (LibGit2Sharp.Core.Handles.GitBuf buf) [0x00000] in <06ab184b4ccd4259a7a7af2756f77645>:0 
    /Users/bruno/.nuget/packages/microsoft.build.tasks.git/1.0.0-beta-63127-02/build/Microsoft.Build.Tasks.Git.targets(20,5): error MSB4018:   at LibGit2Sharp.Core.Handles.GitBuf.Dispose () [0x00000] in <06ab184b4ccd4259a7a7af2756f77645>:0 
    /Users/bruno/.nuget/packages/microsoft.build.tasks.git/1.0.0-beta-63127-02/build/Microsoft.Build.Tasks.Git.targets(20,5): error MSB4018:   at LibGit2Sharp.Core.Proxy.ConvertPath (System.Func`2[T,TResult] pathRetriever) [0x0002e] in <06ab184b4ccd4259a7a7af2756f77645>:0 
    /Users/bruno/.nuget/packages/microsoft.build.tasks.git/1.0.0-beta-63127-02/build/Microsoft.Build.Tasks.Git.targets(20,5): error MSB4018:   at LibGit2Sharp.Core.Proxy.git_repository_discover (LibGit2Sharp.Core.FilePath start_path) [0x00005] in <06ab184b4ccd4259a7a7af2756f77645>:0 
    /Users/bruno/.nuget/packages/microsoft.build.tasks.git/1.0.0-beta-63127-02/build/Microsoft.Build.Tasks.Git.targets(20,5): error MSB4018:   at LibGit2Sharp.Repository.Discover (System.String startingPath) [0x00006] in <06ab184b4ccd4259a7a7af2756f77645>:0 
    /Users/bruno/.nuget/packages/microsoft.build.tasks.git/1.0.0-beta-63127-02/build/Microsoft.Build.Tasks.Git.targets(20,5): error MSB4018:   at Microsoft.Build.Tasks.Git.GitOperations.LocateRepository (System.String directory) [0x00000] in /_/src/Microsoft.Build.Tasks.Git.Operations/GitOperations.cs:24 
    /Users/bruno/.nuget/packages/microsoft.build.tasks.git/1.0.0-beta-63127-02/build/Microsoft.Build.Tasks.Git.targets(20,5): error MSB4018:   at Microsoft.Build.Tasks.Git.RepositoryTasks.LocateRepository (Microsoft.Build.Tasks.Git.LocateRepository task) [0x00000] in /_/src/Microsoft.Build.Tasks.Git.Operations/RepositoryTasks.cs:50 
    /Users/bruno/.nuget/packages/microsoft.build.tasks.git/1.0.0-beta-63127-02/build/Microsoft.Build.Tasks.Git.targets(20,5): error MSB4018:   at Microsoft.Build.Tasks.Git.LocateRepository.Execute () [0x00038] in /_/src/Microsoft.Build.Tasks.Git/LocateRepository.cs:32 
    /Users/bruno/.nuget/packages/microsoft.build.tasks.git/1.0.0-beta-63127-02/build/Microsoft.Build.Tasks.Git.targets(20,5): error MSB4018:   at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute () [0x00023] in /_/src/Build/BackEnd/TaskExecutionHost/TaskExecutionHost.cs:631 
    /Users/bruno/.nuget/packages/microsoft.build.tasks.git/1.0.0-beta-63127-02/build/Microsoft.Build.Tasks.Git.targets(20,5): error MSB4018:   at Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask (Microsoft.Build.BackEnd.ITaskExecutionHost taskExecutionHost, Microsoft.Build.BackEnd.Logging.TaskLoggingContext taskLoggingContext, Microsoft.Build.BackEnd.TaskHost taskHost, Microsoft.Build.BackEnd.ItemBucket bucket, Microsoft.Build.BackEnd.TaskExecutionMode howToExecuteTask) [0x001f6] in /_/src/Build/BackEnd/Components/RequestBuilder/TaskBuilder.cs:787 
Done building target "InitializeSourceControlInformationFromSourceControlManager" in project "Sentry.Protocol.csproj" -- FAILED.

Seems related to dotnet/Nerdbank.GitVersioning#224

@tmat
Copy link
Member

tmat commented Sep 28, 2018

Do you use both SourceLink and Nerdbank.GitVersioning in your project?

@bruno-garcia
Copy link
Member Author

bruno-garcia commented Sep 28, 2018

@tmat I use only:

<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0-beta-63127-02" PrivateAssets="All" />

I think both at the end use libgit2sharp

@bording
Copy link

bording commented Sep 28, 2018

In both issues, the problem is coming from when things are being run from Mono, but the stack traces are showing that it's coming from different parts of LibGit2Sharp.

I wish there was a way to tell which method was causing the problem here.

@tmat
Copy link
Member

tmat commented Sep 30, 2018

This seems like the native library is failing to load. The stack trace is the same as if I delete the library.

Let's track all Mono issues here: #155

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants