Repository navigation
Closed
Description
Darc needs to know about the runtime-id in advance since it it needs to find a libgit2sharp for the current pltaform.
On Fedora 30, this fails:
git clone https://github.com/dotnet/source-build
cd source-build
git checkout release/3.0
git submodule update --init --recursive
./build.sh
The end of the output shows why:
System.Exception: Something went wrong when cloning repo https://github.com/dotnet/arcade at <default branch> into /
home/omajid/devel/dotnet/source-build/bin/src/arcade ---> System.TypeInitializationException: The type initializer for
'LibGit2Sharp.Core.NativeMethods' threw an exception. ---> System.DllNotFoundException: Unable to load shared library
'git2-8e0b172' or one of its dependencies. In order to help diagnose loading problems, consider setting the LD_DEBUG
environment variable: libgit2-8e0b172: cannot open shared object file: No such file or directory
at LibGit2Sharp.Core.NativeMethods.git_libgit2_init()
at LibGit2Sharp.Core.NativeMethods.LoadNativeLibrary() in C:\projects\libgit2sharp\LibGit2Sharp\Core\NativeMethos.cs:line 47
at LibGit2Sharp.Core.NativeMethods..cctor() in C:\projects\libgit2sharp\LibGit2Sharp\Core\NativeMethods.cs:line 37
--- End of inner exception stack trace ---
at LibGit2Sharp.Core.NativeMethods.git_clone(git_repository*& repo, String origin_url, FilePath workdir_path, GitCloneOptions& opts)
at LibGit2Sharp.Core.Proxy.git_clone(String url, String workdir, GitCloneOptions& opts) in C:\projects\libgit2sharp\LibGit2Sharp\Core\Proxy.cs:line 354
at LibGit2Sharp.Repository.Clone(String sourceUrl, String workdirPath, CloneOptions options) in C:\projects\libgit2sharp\LibGit2Sharp\Repository.cs:line 715
at Microsoft.DotNet.DarcLib.RemoteRepoBase.Clone(String repoUri, String commit, String targetDirectory, ILogger _logger, String pat, String gitDirectory) in /home/omajid/devel/dotnet/source-build/tools-local/arcade-services/src/Microsoft.DotNet.Darc/src/DarcLib/RemoteRepoBase.cs:line 176
--- End of inner exception stack trace ---
at Microsoft.DotNet.DarcLib.RemoteRepoBase.Clone(String repoUri, String commit, String targetDirectory, ILogger _logger, String pat, String gitDirectory) in /home/omajid/devel/dotnet/source-build/tools-local/arcade-services/src/Microsoft.DotNet.Darc/src/DarcLib/RemoteRepoBase.cs:line 210
at Microsoft.DotNet.DarcLib.GitHubClient.Clone(String repoUri, String commit, String targetDirectory, String gitDirectory) in /home/omajid/devel/dotnet/source-build/tools-local/arcade-services/src/Microsoft.DotNet.Darc/src/DarcLib/GitHubClient.cs:line 875
at Microsoft.DotNet.Darc.Operations.CloneOperation.HandleMasterCopyAndCreateGitDir(RemoteFactory remoteFactory, String repoUrl, String masterGitRepoPath, String masterRepoGitDirPath, String gitDirRedirect, ILogger log) in /home/omajid/devel/dotnet/source-build/tools-local/arcade-services/src/Microsoft.DotNet.Darc/src/Darc/Operations/CloneOperation.cs:line 282
at Microsoft.DotNet.Darc.Operations.CloneOperation.HandleMasterCopyWithGitDirPath(RemoteFactory remoteFactory, String repoUrl, String masterGitRepoPath, String masterRepoGitDirPath, ILogger log) in /home/omajid/devel/dotnet/source-build/tools-local/arcade-services/src/Microsoft.DotNet.Darc/src/Darc/Operations/CloneOperation.cs:line 270
at Microsoft.DotNet.Darc.Operations.CloneOperation.HandleMasterCopy(RemoteFactory remoteFactory, String repoUrl, String masterGitRepoPath, String masterRepoGitDirPath, ILogger log) in /home/omajid/devel/dotnet/source-build/tools-local/arcade-services/src/Microsoft.DotNet.Darc/src/Darc/Operations/CloneOperation.cs:line 225
at Microsoft.DotNet.Darc.Operations.CloneOperation.ExecuteAsync() in /home/omajid/devel/dotnet/source-build/tools-local/arcade-services/src/Microsoft.DotNet.Darc/src/Darc/Operations/CloneOperation.cs:line 102
Metadata
Metadata
Assignees
Labels
No labels
Activity
tmds commentedon Jun 20, 2019
libgit2sharp has an so file for fedora under the fedora-x64 rid:
that one would work, but instead it is using the linux-x64 rid:
which has missing libraries for openssl.
If you set
DOTNET_RUNTIME_IDtofedora-x64, things may work.fmauNeko commentedon Jun 24, 2019
Hello,
I am having the same issue under Arch Linux, copying the fedora-x64 .so file over the linux-x64 one works.
This is because libgit2sharp.nativebinaries builds its linux-x64 binary using Ubuntu 14.04 (https://github.com/libgit2/libgit2sharp.nativebinaries/blob/master/Dockerfile.linux-x64).
As Ubuntu 14.04 reached EOL on April 30, 2019, an issue should be opened upstream.
tmds commentedon Jul 1, 2019
@omajid did you give this a try?
This issue also relates to providing a complete source tarball per release (cfr #298). The issue happens here because
dotnetis used to fetch sources, dependencies, etc. Such things would already be packed in the source tarball.CC @dagood @dseefeld
dagood commentedon Jul 1, 2019
SourceLink removed its dependency on this native binary with dotnet/sourcelink#288, maybe similar could be done for Darc? My understanding is that
./build.shfrom a clone is no longer expected to work on unprepared distros, but would be nice to expand support by removing dependencies like this IMO./cc @crummel
omajid commentedon Jul 1, 2019
No, I didn't.
fedora.30-x64is now in the runtime id graph so things Just Worked.omajid commentedon Jul 5, 2019
Oops. Turns out I was wrong. I built source build to create the release tarball on Fedora 28. I then built from the tarball (which doesn't need git?) on Fedora 30. The issue still persists.
This
Dockerfilereproduces the problem on any machine:tmds commentedon Jul 5, 2019
Yes, this matches my earlier comment: #1083 (comment).
Try setting
DOTNET_RUNTIME_ID.omajid commentedon Jul 5, 2019
Yes, that works. But it doesn't address the real issue that results from having very specific runtime ids, no real runtime id fallback mechanism, and bundling native libraries.
tmds commentedon Jul 5, 2019
This is indeed an issue.
Even with a fallback mechanism, source-build wouldn't work on some platforms.
I'm considering source-build's output the source for building .NET Core rather than source-build itself (because source-build relies on
dotnetto build).dseefeld commentedon Jul 18, 2019
If we acquire DARC rather than build it, this should be solved. @crummel to confirm.
omajid commentedon Aug 20, 2019
Recent versions of sourcelink don't depend on libgit2sharp: dotnet/sourcelink#288. We just need to use a recent enough version and then we can use it everywhere without issues.Edit: I just realized that arcade-services doesn't use SourceLink, it uses libgit2sharp directly for git operations.
dseefeld commentedon Aug 22, 2019
@crummel Will #1041 take care of this issue?
@ericstj Can you comment on the above?
crummel commentedon Sep 5, 2019
I think acquiring Darc will fix this. Another thing I'm seeing is that after I switched Darc to be compiled with the 3.0 SDK in the BuildTools removal PR, this worked with a little manual intervention that I think could be added to the build. If neither of those take care of the problem, we can look into shelling out to Git or other workarounds.
omajid commentedon Sep 6, 2019
I was trying to build source-build on an arm64 machine. This issue affects that too.
libgit2sharpdoesn't havelinux-arm64binaries and we can't use it.I really think we need to make Darc more flexible. It probably shouldn't be (indirectly) using native binaries without a simple way to plug a custom binary.
tmds commentedon Sep 7, 2019
You can try one of these:
gitcommand instead of libgit2sharp: crummel@57e01ba#diff-98f322625c74ff72f9326bd4dca549baR153I can look into making libgit2sharp fall back to the native library provided by the platform in case the one it has in the package don't work.
Or maybe we want to change source-build so it uses the
gitcommand instead of libgit2sharp for these checkouts?tmds commentedon Sep 9, 2019
I'm making a different change: libgit2/libgit2sharp#1714 tries out the other native libraries that come with LibGit2Sharp. That should solve the issue for x64 (new Fedora versions) and arm64 (any Fedora version).
We still may want to pursue this.
crummel commentedon Sep 11, 2019
Could you give this a try now that the BuildTools removal PR with the switch to the 3.0 SDK is in? That seemed to fix the problem for me for now - we'll still want to acquire Darc instead of building it but it would be lower priority.
omajid commentedon Sep 11, 2019
I can confirm that this fixes the problems for me on Fedora 30 x86_64.
Edit: But not on
rhel.8-arm64omajid commentedon Oct 14, 2022
3.0 is EOL.
Support for new/unknown Linux distributions is being tracked by #297