Skip to content

LibGit fails to load on Mono #155

Closed

Description

@tmat
 /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]

Activity

  1. bording commented on Aug 21, 2018

    @bording

    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).

  2. ctaggart commented on Oct 9, 2018

    @ctaggart
    Contributor

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

  3. added a commit that references this issue on Oct 11, 2018
  4. added a commit that references this issue on Dec 5, 2018
  5. tmat commented on Jun 22, 2019

    @tmat
    MemberAuthor

    Resolved by #288.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions