question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

2.2.10 fails on Ubuntu 16 and 18

See original GitHub issue

Gah! if it’s not one failure it’s another. Now 2.2.10, which fixed the dotnet build failure (but apparently only on Windows) fails on Ubuntu 16 and 18 with this:

Repro steps

On a Linux machine (or Linux on Windows) such as Ubuntu 16, 18, or Linux Mint 19:

git clone https://github.com/aarnott/nerdbank.streams
cd nerdbank.streams/src/Nerdbank.Streams
git checkout fixLinuxBuild2
LD_DEBUG=versions dotnet build

The output is long, but includes this error:

      2512:	/usr/share/dotnet/shared/Microsoft.NETCore.App/2.1.3/System.Globalization.Native.so: error: symbol lookup error: undefined symbol: GlobalizationNative_ToAsciiW (fatal)
      2512:	/usr/share/dotnet/shared/Microsoft.NETCore.App/2.1.3/System.Globalization.Native.so: error: symbol lookup error: undefined symbol: GlobalizationNative_GetSortKeyW (fatal)

/home/andrew/.nuget/packages/nerdbank.gitversioning/2.2.10/build/Nerdbank.GitVersioning.targets(63,5): error MSB4018: The "Nerdbank.GitVersioning.Tasks.GetBuildVersion" task failed unexpectedly. [/home/andrew/git/nerdbank.streams/src/Nerdbank.Streams/Nerdbank.Streams.csproj]
/home/andrew/.nuget/packages/nerdbank.gitversioning/2.2.10/build/Nerdbank.GitVersioning.targets(63,5): error MSB4018: System.TypeInitializationException: The type initializer for 'LibGit2Sharp.Core.NativeMethods' threw an exception. ---> System.DllNotFoundException: Unable to load shared library 'git2-6311e88' or one of its dependencies. In order to help diagnose loading problems, consider setting the LD_DEBUG environment variable: libgit2-6311e88: cannot open shared object file: No such file or directory [/home/andrew/git/nerdbank.streams/src/Nerdbank.Streams/Nerdbank.Streams.csproj]
/home/andrew/.nuget/packages/nerdbank.gitversioning/2.2.10/build/Nerdbank.GitVersioning.targets(63,5): error MSB4018:    at LibGit2Sharp.Core.NativeMethods.git_libgit2_init() [/home/andrew/git/nerdbank.streams/src/Nerdbank.Streams/Nerdbank.Streams.csproj]
/home/andrew/.nuget/packages/nerdbank.gitversioning/2.2.10/build/Nerdbank.GitVersioning.targets(63,5): error MSB4018:    at LibGit2Sharp.Core.NativeMethods.LoadNativeLibrary() [/home/andrew/git/nerdbank.streams/src/Nerdbank.Streams/Nerdbank.Streams.csproj]
/home/andrew/.nuget/packages/nerdbank.gitversioning/2.2.10/build/Nerdbank.GitVersioning.targets(63,5): error MSB4018:    at LibGit2Sharp.Core.NativeMethods..cctor() [/home/andrew/git/nerdbank.streams/src/Nerdbank.Streams/Nerdbank.Streams.csproj]
/home/andrew/.nuget/packages/nerdbank.gitversioning/2.2.10/build/Nerdbank.GitVersioning.targets(63,5): error MSB4018:    --- End of inner exception stack trace --- [/home/andrew/git/nerdbank.streams/src/Nerdbank.Streams/Nerdbank.Streams.csproj]
/home/andrew/.nuget/packages/nerdbank.gitversioning/2.2.10/build/Nerdbank.GitVersioning.targets(63,5): error MSB4018:    at LibGit2Sharp.Core.NativeMethods.git_libgit2_opts(Int32 option, UInt32 level, String path) [/home/andrew/git/nerdbank.streams/src/Nerdbank.Streams/Nerdbank.Streams.csproj]
/home/andrew/.nuget/packages/nerdbank.gitversioning/2.2.10/build/Nerdbank.GitVersioning.targets(63,5): error MSB4018:    at LibGit2Sharp.GlobalSettings.SetConfigSearchPaths(ConfigurationLevel level, String[] paths) [/home/andrew/git/nerdbank.streams/src/Nerdbank.Streams/Nerdbank.Streams.csproj]
/home/andrew/.nuget/packages/nerdbank.gitversioning/2.2.10/build/Nerdbank.GitVersioning.targets(63,5): error MSB4018:    at Nerdbank.GitVersioning.GitExtensions.OpenGitRepo(String pathUnderGitRepo) [/home/andrew/git/nerdbank.streams/src/Nerdbank.Streams/Nerdbank.Streams.csproj]
/home/andrew/.nuget/packages/nerdbank.gitversioning/2.2.10/build/Nerdbank.GitVersioning.targets(63,5): error MSB4018:    at Nerdbank.GitVersioning.VersionOracle.Create(String projectDirectory, String gitRepoDirectory, ICloudBuild cloudBuild, Nullable`1 overrideBuildNumberOffset, String projectPathRelativeToGitRepoRoot) [/home/andrew/git/nerdbank.streams/src/Nerdbank.Streams/Nerdbank.Streams.csproj]
/home/andrew/.nuget/packages/nerdbank.gitversioning/2.2.10/build/Nerdbank.GitVersioning.targets(63,5): error MSB4018:    at Nerdbank.GitVersioning.Tasks.GetBuildVersion.ExecuteInner() [/home/andrew/git/nerdbank.streams/src/Nerdbank.Streams/Nerdbank.Streams.csproj]

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:35

github_iconTop GitHub Comments

1reaction
bordingcommented, Aug 25, 2018

Interesting. I wonder if this is a similar issue to what using UniqueId.UniqueIdentifier as the MarshalCookie is intending to solve: https://github.com/libgit2/libgit2sharp/blob/master/LibGit2Sharp/Core/NativeMethods.cs#L100

I’d have to track down the original issues, but IIRC that was added to work around a custom marshaling bug when two different versions of LibGit2Sharp were loaded.

In this case, you’ve still got two different copies of the assembly loaded, but they share the same MarshalCookie, so things are getting messed up.

1reaction
bordingcommented, Aug 25, 2018

I just forcibly renamed it to remove the prefix. It still loaded on demand, but p/invoke did not find it, as you predicted.

Yeah, I really wish it worked properly on linux as well, because then I’d be able to finish https://github.com/libgit2/libgit2sharp/pull/1571 and handle all of this internally for you.

Read more comments on GitHub >

github_iconTop Results From Across the Web

No internet after upgrade from 16.04 to 18.04
I solved a connection failure after an upgrade by using a wireless connection using a USB-attached network adapter, then changing to the ...
Read more >
Installing Ruby 2.3.x on Ubuntu 18.04 is causing an error ...
Installing Ruby 2.3. x on Ubuntu 18.04 is causing an error by the end of the installation process - Stack Overflow.
Read more >
Ubuntu 18.04 to 20.04 - Unresolved issue occured while ...
I'm trying to upgrade my Ubuntu distro from 18.04 LTS to 20.04 LTS and I get this error message while it's calculating data,....
Read more >
14.04 to 16.04 failed upgrade stuck with massive ...
To cut a very very long arduous journey of a story short I have a failed 14.04 upgrade to 16.04 due to hardware...
Read more >
How can I install Apache with a specific version?
The only version that shows for me is 2.4 on Ubuntu 16. This is a big problem because 2.4 has known issues that...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found