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

core-sdk: error The type initializer for 'LibGit2Sharp.Core.NativeMethods' threw an exception #1422

Closed
s0dyy opened this issue Dec 12, 2019 · 8 comments
Assignees
Labels
area-build Improvements in source-build's own build process

Comments

@s0dyy
Copy link

s0dyy commented Dec 12, 2019

Hello :)

I have an error with core-sdk with the latest release.

I applied several patches using the Archlinux issue #1310, thanks you for publishing the pkgbuild, it helped me a lot.

I can now compile coreclr, corefx and core-setup without problems but I did not find a solution for core-sdk.

/restored/microsoft.build.tasks.git/1.0.0-beta2-18618-05/build/Microsoft.Build.Tasks.Git.targets(20,5): error : The type initializer for 'LibGit2Sharp.Core.NativeMethods' threw an exception. [/home/s0dyy/source-build/bin/src/core-sdk.cd82f021f4c2c8901bd7975fcaefc34fdeec3ded/src/Microsoft.Dotnet.Sdk.Internal/Microsoft.Dotnet.Sdk.Internal.csproj]
/home/s0dyy/source-build/packages/restored/microsoft.build.tasks.git/1.0.0-beta2-18618-05/build/Microsoft.Build.Tasks.Git.targets(20,5): error :    at LibGit2Sharp.Core.NativeMethods.git_buf_free(GitBuf buf) [/home/s0dyy/source-build/bin/src/core-sdk.cd82f021f4c2c8901bd7975fcaefc34fdeec3ded/src/Microsoft.Dotnet.Sdk.Internal/Microsoft.Dotnet.Sdk.Internal.csproj]
/home/s0dyy/source-build/packages/restored/microsoft.build.tasks.git/1.0.0-beta2-18618-05/build/Microsoft.Build.Tasks.Git.targets(20,5): error :    at LibGit2Sharp.Core.Proxy.git_buf_free(GitBuf buf) [/home/s0dyy/source-build/bin/src/core-sdk.cd82f021f4c2c8901bd7975fcaefc34fdeec3ded/src/Microsoft.Dotnet.Sdk.Internal/Microsoft.Dotnet.Sdk.Internal.csproj]
/home/s0dyy/source-build/packages/restored/microsoft.build.tasks.git/1.0.0-beta2-18618-05/build/Microsoft.Build.Tasks.Git.targets(20,5): error :    at LibGit2Sharp.Core.Handles.GitBuf.Dispose() [/home/s0dyy/source-build/bin/src/core-sdk.cd82f021f4c2c8901bd7975fcaefc34fdeec3ded/src/Microsoft.Dotnet.Sdk.Internal/Microsoft.Dotnet.Sdk.Internal.csproj]
/home/s0dyy/source-build/packages/restored/microsoft.build.tasks.git/1.0.0-beta2-18618-05/build/Microsoft.Build.Tasks.Git.targets(20,5): error :    at LibGit2Sharp.Core.Proxy.ConvertPath(Func`2 pathRetriever) [/home/s0dyy/source-build/bin/src/core-sdk.cd82f021f4c2c8901bd7975fcaefc34fdeec3ded/src/Microsoft.Dotnet.Sdk.Internal/Microsoft.Dotnet.Sdk.Internal.csproj]
/home/s0dyy/source-build/packages/restored/microsoft.build.tasks.git/1.0.0-beta2-18618-05/build/Microsoft.Build.Tasks.Git.targets(20,5): error :    at LibGit2Sharp.Core.Proxy.git_repository_discover(FilePath start_path) [/home/s0dyy/source-build/bin/src/core-sdk.cd82f021f4c2c8901bd7975fcaefc34fdeec3ded/src/Microsoft.Dotnet.Sdk.Internal/Microsoft.Dotnet.Sdk.Internal.csproj]
/home/s0dyy/source-build/packages/restored/microsoft.build.tasks.git/1.0.0-beta2-18618-05/build/Microsoft.Build.Tasks.Git.targets(20,5): error :    at LibGit2Sharp.Repository.Discover(String startingPath) [/home/s0dyy/source-build/bin/src/core-sdk.cd82f021f4c2c8901bd7975fcaefc34fdeec3ded/src/Microsoft.Dotnet.Sdk.Internal/Microsoft.Dotnet.Sdk.Internal.csproj]
/home/s0dyy/source-build/packages/restored/microsoft.build.tasks.git/1.0.0-beta2-18618-05/build/Microsoft.Build.Tasks.Git.targets(20,5): error :    at Microsoft.Build.Tasks.Git.GitOperations.LocateRepository(String directory) in /_/src/Microsoft.Build.Tasks.Git.Operations/GitOperations.cs:line 26 [/home/s0dyy/source-build/bin/src/core-sdk.cd82f021f4c2c8901bd7975fcaefc34fdeec3ded/src/Microsoft.Dotnet.Sdk.Internal/Microsoft.Dotnet.Sdk.Internal.csproj]
/home/s0dyy/source-build/packages/restored/microsoft.build.tasks.git/1.0.0-beta2-18618-05/build/Microsoft.Build.Tasks.Git.targets(20,5): error :    at Microsoft.Build.Tasks.Git.RepositoryTasks.LocateRepository(LocateRepository task) in /_/src/Microsoft.Build.Tasks.Git.Operations/RepositoryTasks.cs:line 58 [/home/s0dyy/source-build/bin/src/core-sdk.cd82f021f4c2c8901bd7975fcaefc34fdeec3ded/src/Microsoft.Dotnet.Sdk.Internal/Microsoft.Dotnet.Sdk.Internal.csproj]

core-sdk.log

Release: v3.1.100-SDK
OS: Exherbo linux

@crummel
Copy link
Contributor

crummel commented Dec 12, 2019

Hi @s0dyy, this should be fixed after #1415 goes in - this upgrades SourceLink to a version that no longer uses LibGit2Sharp so we should bypass this issue entirely. I'm hoping to get that merged tomorrow or Monday but you could try pulling that change in for the time being if you like.

@crummel
Copy link
Contributor

crummel commented Dec 13, 2019

#1415 has been merged to release/3.1, could you give this another try?

@s0dyy
Copy link
Author

s0dyy commented Dec 16, 2019

Thanks, it works with #1415!

Private.SourceBuild.ReferencePackages.1.0.0-beta.19577.2.tar.gz
Private.SourceBuilt.Artifacts.0.1.0-3.1.100-preview3.dev.19571.1.tar.gz

Is it necessary to download these two archives just before the end of the build?

@crummel
Copy link
Contributor

crummel commented Dec 16, 2019

Those two archives are how we bootstrap - the ReferencePackages are produced from https://github.com/dotnet/source-build-reference-packages/ and SourceBuilt.Artifacts is from a recent source-build. The general idea is that there are packages that we need to build against but that are not included in the final source-built product - we still want these to be source-built, so we use this combination of source-built-reference-packages and previously-source-built-packages to make that happen. If you don't care about being completely source-build-clean, you don't need them, but you'll need to build online and possibly change where we look for packages.

@omajid
Copy link
Member

omajid commented Dec 27, 2019

Those two archives are how we bootstrap - the ReferencePackages are produced from https://github.com/dotnet/source-build-reference-packages/ and SourceBuilt.Artifacts is from a recent source-build.

Is there some way I can provide the bits I built locally earlier myself and not download the two tarballs? Is that something that's already possible?

@crummel
Copy link
Contributor

crummel commented Jan 8, 2020

I don't think that should be too tough; I've started working on it in #1434.

@dagood
Copy link
Member

dagood commented Feb 13, 2020

Triage notes:
@crummel to confirm if this is fixed, it should be!

@dagood dagood added area-build Improvements in source-build's own build process triaged labels Feb 13, 2020
@crummel
Copy link
Contributor

crummel commented Oct 18, 2022

[Scrub] Closing as fixed - both the original issue and the requested --with-packages feature are implemented.

@crummel crummel closed this as completed Oct 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-build Improvements in source-build's own build process
Projects
None yet
Development

No branches or pull requests

5 participants