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.

Arcade builds source-build-reference-packages with PublicSign = false

See original GitHub issue
  • This issue is blocking
  • This issue is causing unreasonable pain

Building .NET 6 on RHEL 9 through source-build fails out of the box. There is a detailed investigation of the underlying issue at https://github.com/dotnet/runtime/issues/65874. The TLDR is that source-build uses RSA+SHA1 to sign assemblies, and that operation fails when SHA1 is not available - as is the case in RHEL 9 and being planned for a future version of Fedora.

The errors building source-build look like this:

/home/dotnet/dotnet-sdk-source-6.0.106/.dotnet/sdk/6.0.105/Roslyn/Microsoft.CSharp.Core.targets(75,5): error : Unhandled exception. Interop+Crypto+OpenSslCryptographicException: error:03000098:digital envelope routines::invalid digest [/home/dotnet/dotnet-sdk-source-6.0.106/src/source-build-reference-packages/artifacts/source-build/self/src/src/referencePackages/src/microsoft.bcl.asyncinterfaces/5.0.0/Microsoft.Bcl.AsyncInterfaces.5.0.0.csproj]

src/referencePackages/src/microsoft.bcl.asyncinterfaces/5.0.0/Microsoft.Bcl.AsyncInterfaces.5.0.0.csproj has this bit of code:

  <PropertyGroup>
    <TargetFrameworks>netstandard2.0;netstandard2.1;net461</TargetFrameworks>
    <NuspecFile>$(ArtifactsBinDir)microsoft.bcl.asyncinterfaces/5.0.0/microsoft.bcl.asyncinterfaces.nuspec</NuspecFile>
    <StrongNameKeyId>Open</StrongNameKeyId>
    <DisableImplicitFrameworkReferences>false</DisableImplicitFrameworkReferences>
  </PropertyGroup>

Setting the StrongNameKeyId to Open makes arcade set PublicSign to false:

https://github.com/dotnet/arcade/blob/8b98a7cce03fa4f047082f3e9711e185620d70d3/src/Microsoft.DotNet.Arcade.Sdk/tools/StrongName.targets#L60-L68

And that uses full signing. Based on https://github.com/dotnet/runtime/issues/65874#issuecomment-1058345768, it sounds like we want to switch to <PublicSign>true</PublicSign>?

cc @jaredpar @jkotas @MichaelSimons @tmds

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
richlandercommented, Jun 18, 2022

I interpreted the answer as this (close to what you said):

  • If you are building a library with .NET Framework consumers, use full signing.
  • If you are building .NET 7 w/o any concern for legacy scenarios, switch to PublicSign and offer no other option.

I’d suggest that only the Microsoft official build of .NET enable full signing, and possibly only for Windows. Anyone else (like Red Hat) should go with PublicSign. I’m unaware of any downside for that.

0reactions
omajidcommented, Feb 9, 2023

I just filed https://github.com/dotnet/arcade/issues/12515 to track how to make this flexible on arcade’s side (and then we can look at scenario-specific fixes as part of the VMR)

Read more comments on GitHub >

github_iconTop Results From Across the Web

OpenSslCryptographicException: error:03000098:digital ...
Description While building .NET 6 using .NET 6 in in CentOS Stream 9 (aka RHEL 9 in-development), I am running into error :...
Read more >
Secret 4-Player Arcade (with build plans!) - YouTube
For those of you who may not want an arcade cabinet in your living room, we've got you. We made a nice piece...
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