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

LibGit fails to load on Mono #155

Closed
tmat opened this issue Aug 21, 2018 · 3 comments · Fixed by #288
Closed

LibGit fails to load on Mono #155

tmat opened this issue Aug 21, 2018 · 3 comments · Fixed by #288
Labels

Comments

@tmat
Copy link
Member

tmat commented Aug 21, 2018

 /Users/builder/.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/builder/jenkins/workspace/Components-Essentials-DeviceTests-PR-Mac/Xamarin.Essentials/Xamarin.Essentials.csproj]
/Users/builder/.nuget/packages/microsoft.build.tasks.git/1.0.0-beta-63127-02/build/Microsoft.Build.Tasks.Git.targets(20,5): error MSB4018: System.TypeInitializationException: The type initializer for 'Microsoft.Build.Tasks.Git.TaskImplementation' threw an exception. ---> System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.Build.Tasks.Git.Operations' or one of its dependencies [/Users/builder/jenkins/workspace/Components-Essentials-DeviceTests-PR-Mac/Xamarin.Essentials/Xamarin.Essentials.csproj]
/Users/builder/.nuget/packages/microsoft.build.tasks.git/1.0.0-beta-63127-02/build/Microsoft.Build.Tasks.Git.targets(20,5): error MSB4018:   at System.AppDomain.Load (System.Reflection.AssemblyName assemblyRef, System.Security.Policy.Evidence assemblySecurity) [0x000e0] in <bb7b695b8c6246b3ac1646577aea7650>:0  [/Users/builder/jenkins/workspace/Components-Essentials-DeviceTests-PR-Mac/Xamarin.Essentials/Xamarin.Essentials.csproj]
/Users/builder/.nuget/packages/microsoft.build.tasks.git/1.0.0-beta-63127-02/build/Microsoft.Build.Tasks.Git.targets(20,5): error MSB4018:   at (wrapper remoting-invoke-with-check) System.AppDomain.Load(System.Reflection.AssemblyName,System.Security.Policy.Evidence) [/Users/builder/jenkins/workspace/Components-Essentials-DeviceTests-PR-Mac/Xamarin.Essentials/Xamarin.Essentials.csproj]
/Users/builder/.nuget/packages/microsoft.build.tasks.git/1.0.0-beta-63127-02/build/Microsoft.Build.Tasks.Git.targets(20,5): error MSB4018:   at System.AppDomain.Load (System.Reflection.AssemblyName assemblyRef) [0x00000] in <bb7b695b8c6246b3ac1646577aea7650>:0  [/Users/builder/jenkins/workspace/Components-Essentials-DeviceTests-PR-Mac/Xamarin.Essentials/Xamarin.Essentials.csproj]
/Users/builder/.nuget/packages/microsoft.build.tasks.git/1.0.0-beta-63127-02/build/Microsoft.Build.Tasks.Git.targets(20,5): error MSB4018:   at (wrapper remoting-invoke-with-check) System.AppDomain.Load(System.Reflection.AssemblyName) [/Users/builder/jenkins/workspace/Components-Essentials-DeviceTests-PR-Mac/Xamarin.Essentials/Xamarin.Essentials.csproj]
/Users/builder/.nuget/packages/microsoft.build.tasks.git/1.0.0-beta-63127-02/build/Microsoft.Build.Tasks.Git.targets(20,5): error MSB4018:   at System.Reflection.Assembly.Load (System.Reflection.AssemblyName assemblyRef) [0x00005] in <bb7b695b8c6246b3ac1646577aea7650>:0  [/Users/builder/jenkins/workspace/Components-Essentials-DeviceTests-PR-Mac/Xamarin.Essentials/Xamarin.Essentials.csproj]
/Users/builder/.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.TaskImplementation..cctor () [0x0006b] in <77223f90773a4c0e88a42a7f38595356>:0  [/Users/builder/jenkins/workspace/Components-Essentials-DeviceTests-PR-Mac/Xamarin.Essentials/Xamarin.Essentials.csproj]
/Users/builder/.nuget/packages/microsoft.build.tasks.git/1.0.0-beta-63127-02/build/Microsoft.Build.Tasks.Git.targets(20,5): error MSB4018:    --- End of inner exception stack trace --- [/Users/builder/jenkins/workspace/Components-Essentials-DeviceTests-PR-Mac/Xamarin.Essentials/Xamarin.Essentials.csproj]
/Users/builder/.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 () [0x0000f] in <77223f90773a4c0e88a42a7f38595356>:0  [/Users/builder/jenkins/workspace/Components-Essentials-DeviceTests-PR-Mac/Xamarin.Essentials/Xamarin.Essentials.csproj]
/Users/builder/.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 <61115f75067146fab35b10183e6ee379>:0  [/Users/builder/jenkins/workspace/Components-Essentials-DeviceTests-PR-Mac/Xamarin.Essentials/Xamarin.Essentials.csproj]
/Users/builder/.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>d__26.MoveNext () [0x00212] in <61115f75067146fab35b10183e6ee379>:0  [/Users/builder/jenkins/workspace/Components-Essentials-DeviceTests-PR-Mac/Xamarin.Essentials/Xamarin.Essentials.csproj]
@bording
Copy link

bording commented Aug 21, 2018

This one's going to be even trickier to solve. Looking the content of the Microsoft.Build.Tasks.Git, I see you're including the the LibGit2Sharp.dll.config mono configuration file in the net461 tools folder, but you're not including any of the the non-windows libraries in the lib folder.

Adding lib/osx/libgit2-b0d9952.dylib will get things working for macOS, but linux is tricker. Unlike .NET Core, there's no way in mono to choose among the different distro-specific linux libraries.

The dllmap stuff in the LibGit2Sharp.dll.config can only reference a single "linux" entry.

At this point, the idea 2 mentioned in dotnet/roslyn#29289 (comment) is looking like the best way forward. Being able to remove as many external native dependencies as possible would get us close to being able to ship a single linux binary, a single macOS binary, and the 32/64 bit windows binaries.

Even in that case, I believe we'll still need a separate binary for musl-based distros (alpine).

@ctaggart
Copy link
Contributor

ctaggart commented Oct 9, 2018

Apparently this affects Rider as well ctaggart/froto#95. The stack trace looks more similar to #179.

@tmat
Copy link
Member Author

tmat commented Jun 22, 2019

Resolved by #288.

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

Successfully merging a pull request may close this issue.

3 participants