Skip to content

Conversation

sbomer
Copy link
Member

@sbomer sbomer commented Nov 19, 2024

Cecil assemblies aren't being strong-name signed. Hoping this fixes it. Not sure if there's a good way to test this locally since we public-sign the assemblies during the build, then do final strong-name signing in MicroBuild, from what I understand.

@sbomer sbomer requested review from ViktorHofer and agocke November 19, 2024 19:06
@sbomer
Copy link
Member Author

sbomer commented Nov 19, 2024

That didn't work - seems the Include name is relevant for the signing infrastructure, but I don't know what's supposed to go there:
https://dev.azure.com/dnceng/internal/_build/results?buildId=2585079&view=logs&j=bb592630-4b9d-53ad-3960-d954a70a95cf&t=94418e61-6648-5751-f7d4-a14f4e5e2bb7

MicroBuild.Plugins.Signing.targets(43,5): error : Could not find the specified StrongName cert CecilStrongName

@jtschuster
Copy link
Member

Should the Include be the path to the .snk file?

<FileSignInfo Include="Mono.Cecil.Pdb.dll" CertificateName="3PartySHA2" />
</ItemGroup>
<ItemGroup>
<StrongNameSignInfo Include="CecilStrongName" PublicKeyToken="50cebf1cceb9d05e" CertificateName="3PartySHA2" />
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like this works when you point to the .snk: https://dev.azure.com/dnceng/internal/_build/results?buildId=2585148&view=results

The output from this build is valid when running sn /v Mono.Cecil.dll, and the previous builds failed validation.

Suggested change
<StrongNameSignInfo Include="CecilStrongName" PublicKeyToken="50cebf1cceb9d05e" CertificateName="3PartySHA2" />
<StrongNameSignInfo Include="$(MSBuildThisFileDirectory)..\cecil.snk" PublicKeyToken="50cebf1cceb9d05e" CertificateName="CecilStrongName" />

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for figuring this out!

@sbomer sbomer merged commit 7f4a146 into dotnet:main Nov 19, 2024
7 checks passed
akoeplinger pushed a commit that referenced this pull request Dec 18, 2024
* Attempt to fix strong-name signing

* Update eng/Signing.props to use the cecil.snk file

---------

Co-authored-by: Jackson Schuster <[email protected]>
(cherry picked from commit 7f4a146)
akoeplinger added a commit that referenced this pull request Dec 18, 2024
This reverts commit 59f2ded.

It got accidentally merged into 9.0 with dotnet/runtime#109297
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants