-
Notifications
You must be signed in to change notification settings - Fork 41
Build with PublicSign=true by default #99
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
Build with PublicSign=true by default #99
Conversation
a2b0bc5 to
f719b0c
Compare
| <BuildCommandArgs>$(BuildCommandArgs) /v:$(LogVerbosity)</BuildCommandArgs> | ||
| <BuildCommandArgs>$(BuildCommandArgs) $(RedirectRepoOutputToLog)</BuildCommandArgs> | ||
| <BuildCommandArgs>$(BuildCommandArgs) /p:MicrosoftSourceLinkVersion=$(MicrosoftSourceLinkVersion)</BuildCommandArgs> | ||
| <BuildCommandArgs>$(BuildCommandArgs) /p:PublicSign=$(PublicSign)</BuildCommandArgs> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should I also consider passing along other related arcade properties like SignAssemblies?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@crummel - Can you share your thoughts on this one? I tend to think no.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ping @crummel
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, I think this should be fine without the extra properties.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually taking a second look at this they are pretty tied together so they probably should all be passed, sorry.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking at the properties that are defined at https://github.com/dotnet/arcade/blob/main/src/Microsoft.DotNet.Arcade.Sdk/tools/StrongName.targets:
Writes variables:
DelaySign
PublicSign
PublicKey
PublicKeyToken
AssemblyOriginatorKeyFile
I can see passing DelaySign, PublicSign properties. The other three seem like they would override whatever the public key, token and the snk file that the repo is using. That doesn't seem like a good idea to me. Thoughts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, looked at other projects and it seems like they are only passing those 2 properties too (if not just one).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I think that makes sense.
f719b0c to
82c112c
Compare
9036407 to
6210397
Compare
repos/newtonsoft-json.proj
Outdated
| <NewtonsoftJsonDirectory>$(ProjectDirectory)/Src/Newtonsoft.Json/</NewtonsoftJsonDirectory> | ||
| <NewtonsoftJsonProjectPath>$(NewtonsoftJsonDirectory)Newtonsoft.Json.csproj</NewtonsoftJsonProjectPath> | ||
| <DotnetToolCommandArguments>"/p:DotnetOnly=true" "/p:Configuration=$(Configuration)" "/p:AssemblyOriginatorKeyFile=$(NewtonsoftJsonKeyFilePath)" "/p:SignAssembly=true" "/p:PublicSign=true" "/p:TreatWarningsAsErrors=false" "/p:AdditionalConstants=SIGNED"</DotnetToolCommandArguments> | ||
| <DotnetToolCommandArguments>"/p:DotnetOnly=true" "/p:Configuration=$(Configuration)" "/p:AssemblyOriginatorKeyFile=$(NewtonsoftJsonKeyFilePath)" "/p:SignAssembly=true" "/p:DelaySign=$(DelaySign)" "/p:PublicSign=true" "/p:TreatWarningsAsErrors=false" "/p:AdditionalConstants=SIGNED"</DotnetToolCommandArguments> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I also tried "/p:PublicSign=$(PublicSign)" but that results in a runtime value of /p:PublicSign= being passed, which doesn't work. Any idea why PublicSign is undefined at this point?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
DelaySign is also set by MSBuild's common targets in MS.Common.CurrentVersion.targets: https://github.com/dotnet/msbuild/blob/1a6d753a7648baf0cc991af0c0d254a41d36eba6/src/Tasks/Microsoft.Common.CurrentVersion.targets#L567. PublicSign is not, so I think this is expected. We're passing in the SDK's default value for for DelaySign here instead of Arcade's due to this, but I think that's okay in this case since the rules for what we want to set it to are the same in both cases.
Pass the value of the PublicSign property to individual builds. Arcade sets this property correctly and things just work automagically. Fixes: dotnet/source-build#2907
6210397 to
ec936b7
Compare
Fixes: dotnet/source-build#2907