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.

Determining SourceRevisionId fails on Linux while building coreclr

See original GitHub issue

While building coreclr on Arch Linux, I get the following backtrace:

/home/leandro/git/coreclr/.packages/microsoft.build.tasks.git/1.0.0-beta2-19270-01/build/Microsoft.Build.Tasks.Git.targets(16,5): error : The type initializer for 'LibGit2Sharp.Core.NativeMethods' threw an exception. [/home/leandro/git/coreclr/eng/empty.csproj]
/home/leandro/git/coreclr/.packages/microsoft.build.tasks.git/1.0.0-beta2-19270-01/build/Microsoft.Build.Tasks.Git.targets(16,5): error :    at LibGit2Sharp.Core.NativeMethods.git_buf_free(GitBuf buf) [/home/leandro/git/coreclr/eng/empty.csproj]
/home/leandro/git/coreclr/.packages/microsoft.build.tasks.git/1.0.0-beta2-19270-01/build/Microsoft.Build.Tasks.Git.targets(16,5): error :    at LibGit2Sharp.Core.Proxy.ConvertPath(Func`2 pathRetriever) [/home/leandro/git/coreclr/eng/empty.csproj]
/home/leandro/git/coreclr/.packages/microsoft.build.tasks.git/1.0.0-beta2-19270-01/build/Microsoft.Build.Tasks.Git.targets(16,5): error :    at LibGit2Sharp.Repository.Discover(String startingPath) [/home/leandro/git/coreclr/eng/empty.csproj]
/home/leandro/git/coreclr/.packages/microsoft.build.tasks.git/1.0.0-beta2-19270-01/build/Microsoft.Build.Tasks.Git.targets(16,5): error :    at Microsoft.Build.Tasks.Git.GitOperations.LocateRepository(String directory) in /_/src/Microsoft.Build.Tasks.Git.Operations/GitOperations.cs:line 26 [/home/leandro/git/coreclr/eng/empty.csproj]
/home/leandro/git/coreclr/.packages/microsoft.build.tasks.git/1.0.0-beta2-19270-01/build/Microsoft.Build.Tasks.Git.targets(16,5): error :    at Microsoft.Build.Tasks.Git.RepositoryTasks.LocateRepository(LocateRepository task) in /_/src/Microsoft.Build.Tasks.Git.Operations/RepositoryTasks.cs:line 58 [/home/leandro/git/coreclr/eng/empty.csproj]
/home/leandro/git/coreclr/.packages/microsoft.dotnet.arcade.sdk/1.0.0-beta.19304.1/tools/Version.targets(53,5): error : SourceRevisionId is not set, which means the SourceLink targets are not included in the build. Those are needed to produce a correct sha for our build outputs. [/home/leandro/git/coreclr/eng/empty.csproj]

This seems related to other issues such as #1261. I’m using coreclr at d7e49efa, ~/.dotnet has been removed, repository directory has been cleaned, init-tools.sh did its thing successfully.

This is the current global.json from coreclr:

{
  "tools": {
    "dotnet": "3.0.100-preview6-011681"
  },
  "native-tools": {
    "cmake": "3.11.1",
    "python": "2.7.15"
  },
  "msbuild-sdks": {
    "Microsoft.DotNet.Arcade.Sdk": "1.0.0-beta.19304.1",
    "Microsoft.DotNet.Helix.Sdk": "2.0.0-beta.19304.1",
    "Microsoft.Build.NoTargets": "1.0.53",
    "Microsoft.Build.Traversal": "2.0.2"
  }
}

Running .dotnet/dotnet from the coreclr repo confirms that that version has been successfully restored.

As a workaround (so I’m not blocked on this), I can pass -skipgenerateversion -skipnuget to build.sh. (The nuget target is also impacted by a similar issue.)

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:8 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
tmatcommented, Jun 6, 2019

You can disable SourceLink by passing the following arguments to the build: /p:EnableSourceControlManagerQueries=false /p:EnableSourceLink=false

0reactions
tmatcommented, Jun 26, 2019

https://github.com/dotnet/arcade/pull/3149 addressed the root cause, it shouldn’t be necessary to disable Source Link anymore.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Failed to build "CoreCLR component". · Issue #53805
Hi, after cloning a source code i wanna build it on my Ubuntu 18.04 machine. So i go to "/runtime-main$" Directory and start...
Read more >
How to compile CoreCLR (compilation problems)?
I have a problem compiling CoreCLR on Linux (Linux Mint 64-bit). There is one error and two messages (Sorry for the translation from...
Read more >
How to fix "The target process exited without raising as ...
How to fix "The target process exited without raising as CoreCLR started event. Ensure that the target process is configured to use .NET...
Read more >
How to build with Cake on Linux using Cake.CoreCLR or ...
In this post I show two ways to use the Cake build system to build .NET Core projects on Linux: using the Cake.CoreCLR...
Read more >
How to fix exception "Failed to initialize CoreCLR, HRESULT
I have OS Linux 4.18.0-348.12.2.el8_5.x86_64 x86_64, ... How to fix exception "Failed to initialize CoreCLR, HRESULT: 0x80004005".
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