-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Remove ForceDryRunSigning=true on Mac & Linux signed builds
#47461
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
Merged
mmitche
merged 5 commits into
dotnet:main
from
ellahathaway:remove-forced-dryrun-signing
Mar 25, 2025
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
e6b9efb
Remove ForceDryRunSigning on Mac & Linux real-signed builds
ellahathaway a798d6c
Make build command line available on non-Windows too
ellahathaway 1a99cf0
Don't sign by default
ellahathaway 6d56d1f
Don't set target props unless they're nonempty
ellahathaway 772baa0
Merge branch 'main' into remove-forced-dryrun-signing
ellahathaway File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -46,7 +46,7 @@ parameters: | |
| - name: sign | ||
| displayName: True when build output should be signed (includes dry runs) | ||
| type: boolean | ||
| default: true | ||
| default: false | ||
|
|
||
| # Overrides the rid that is produced by the build. | ||
| - name: targetRid | ||
|
|
@@ -133,13 +133,6 @@ jobs: | |
| image: ${{ parameters.container.image }} | ||
| options: $(defaultContainerOptions) | ||
|
|
||
| # Currently, CodeQL slows the build down too much | ||
| # https://github.com/dotnet/source-build/issues/4276 | ||
| ${{ if and(parameters.isBuiltFromVmr, startswith(parameters.buildName, 'Windows'), eq(variables['System.TeamProject'], 'internal'), ne(variables['Build.Reason'], 'PullRequest')) }}: | ||
| timeoutInMinutes: 720 | ||
| ${{ else }}: | ||
| timeoutInMinutes: 240 | ||
|
|
||
| ${{ if ne(parameters.reuseBuildArtifactsFrom, '') }}: | ||
| ${{ if eq(parameters.buildPass, '') }}: | ||
| # For PR builds, skip the stage 2 build if the stage 1 build fails. | ||
|
|
@@ -201,56 +194,92 @@ jobs: | |
| # Build up the command line variables. We avoid doing this in the script sections below | ||
| # because AzDO will not echo command lines if they are more than a single line. | ||
|
|
||
| ## Build command line - Windows | ||
| - ${{ if eq(parameters.targetOS, 'windows') }}: | ||
| ## Basic arguments | ||
| - name: baseArguments | ||
| value: -ci -cleanWhileBuilding -prepareMachine -c ${{ parameters.configuration }} $(officialBuildParameter) /p:VerticalName=$(Agent.JobName) /p:ArtifactsStagingDir=$(artifactsStagingDir) | ||
| ## Build command line | ||
|
|
||
| ### Command line prefix | ||
| - name: commandPrefix | ||
| ${{ if eq(parameters.targetOS, 'windows') }}: | ||
| value: '-' | ||
| ${{ else }}: | ||
| value: '--' | ||
|
|
||
| ### Basic arguments | ||
| - name: cleanArgument | ||
| ${{ if eq(parameters.targetOS, 'windows') }}: | ||
| value: cleanWhileBuilding | ||
| ${{ else }}: | ||
| value: clean-while-building | ||
|
|
||
| - name: baseArguments | ||
| value: $(commandPrefix)ci $(commandPrefix)$(cleanArgument) $(commandPrefix)prepareMachine -c ${{ parameters.configuration }} | ||
|
|
||
| - name: baseProperties | ||
| value: $(officialBuildParameter) /p:VerticalName=$(Agent.JobName) /p:ArtifactsStagingDir=$(artifactsStagingDir) | ||
|
|
||
| - name: targetArguments | ||
| - name: targetProperties | ||
| ${{ if and(ne(parameters.targetOS, ''), ne(parameters.targetArchitecture, '')) }}: | ||
| value: /p:TargetOS=${{ parameters.targetOS }} /p:TargetArchitecture=${{ parameters.targetArchitecture }} | ||
| ${{ elseif ne(parameters.targetOS, '') }}: | ||
| value: /p:TargetOS=${{ parameters.targetOS }} | ||
| ${{ else }}: | ||
| value: /p:TargetArchitecture=${{ parameters.targetArchitecture }} | ||
|
|
||
| ### Signing variables | ||
| - ${{ if eq(parameters.sign, 'True') }}: | ||
| - name: _SignDiagnosticFilesArgs | ||
| ### Signing | ||
| - name: _SignDiagnosticFilesArgs | ||
| value: '' | ||
| - ${{ if eq(parameters.sign, 'True') }}: | ||
| - name: signArguments | ||
| value: $(commandPrefix)sign | ||
| - ${{ if or(eq(variables['System.TeamProject'], 'public'), in(variables['Build.Reason'], 'PullRequest')) }}: | ||
| # The _SignType variable is used by microbuild installation | ||
| - name: _SignType | ||
| value: '' | ||
| - ${{ if or(eq(variables['System.TeamProject'], 'public'), in(variables['Build.Reason'], 'PullRequest')) }}: | ||
| # The _SignType variable is used by microbuild installation | ||
| - name: _SignType | ||
| value: '' | ||
| - name: signArguments | ||
| value: -sign /p:ForceDryRunSigning=true | ||
| - ${{ else }}: | ||
| - name: _SignType | ||
| value: real | ||
| - name: signArguments | ||
| value: -sign /p:DotNetSignType=real /p:TeamName=$(_TeamName) | ||
| - name: _EnableDacSigning | ||
| ${{ if and(eq(parameters.isBuiltFromVmr, true), ne(parameters.buildSourceOnly, 'True')) }}: | ||
| value: true | ||
| ${{ else }}: | ||
| value: false | ||
| - name: signProperties | ||
| value: /p:ForceDryRunSigning=true | ||
| - ${{ else }}: | ||
| - name: signArguments | ||
| value: '' | ||
| - name: _SignDiagnosticFilesArgs | ||
| value: '' | ||
| - name: _SignType | ||
| value: real | ||
| - name: signProperties | ||
| value: /p:DotNetSignType=real /p:TeamName=$(_TeamName) | ||
| - name: _EnableDacSigning | ||
| ${{ if and(eq(parameters.isBuiltFromVmr, true), ne(parameters.buildSourceOnly, 'True')) }}: | ||
| value: true | ||
| ${{ else }}: | ||
| value: false | ||
| - ${{ else }}: | ||
| - name: signArguments | ||
| value: '' | ||
| - name: signProperties | ||
| value: '' | ||
| - name: _SignType | ||
| value: '' | ||
|
|
||
| ### Build Pass | ||
| - ${{ if ne(parameters.buildPass, '') }}: | ||
| - name: buildPassProperties | ||
| value: /p:DotNetBuildPass=${{ parameters.buildPass }} | ||
| - ${{ else }}: | ||
| - name: buildPassProperties | ||
| value: '' | ||
|
|
||
| ### Build Pass | ||
| - ${{ if ne(parameters.buildPass, '') }}: | ||
| - name: buildPassArguments | ||
| value: /p:DotNetBuildPass=${{ parameters.buildPass }} | ||
| - ${{ else }}: | ||
| - name: buildPassArguments | ||
| value: '' | ||
| ### Additional properties | ||
| - ${{ if eq(parameters.enableIBCOptimization, 'true') }}: | ||
| - name: ibcProperties | ||
| value: '/p:EnableIBCOptimization=true /p:IBCDropAccessToken=$(dn-bot-devdiv-drop-r-code-r)' | ||
| - ${{ else }}: | ||
| - name: ibcProperties | ||
| value: '' | ||
|
|
||
| ### Additional arguments | ||
| - ${{ if eq(parameters.enableIBCOptimization, 'true') }}: | ||
| - name: ibcArguments | ||
| value: '/p:EnableIBCOptimization=true /p:IBCDropAccessToken=$(dn-bot-devdiv-drop-r-code-r)' | ||
| - ${{ else }}: | ||
| - name: ibcArguments | ||
| value: '' | ||
| # Timeout | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I moved the timeout logic here so that the timeout could be conditionally set based on the value of |
||
| ## Real signing takes a while - increase the timeout to allow for that | ||
| ${{ if eq(variables['_SignType'], 'real') }}: | ||
| timeoutInMinutes: 720 | ||
| ## Currently, CodeQL slows the build down too much | ||
| ## https://github.com/dotnet/source-build/issues/4276 | ||
| ${{ elseif and(parameters.isBuiltFromVmr, startswith(parameters.buildName, 'Windows'), eq(variables['System.TeamProject'], 'internal'), ne(variables['Build.Reason'], 'PullRequest')) }}: | ||
| timeoutInMinutes: 720 | ||
| ${{ else }}: | ||
| timeoutInMinutes: 240 | ||
|
|
||
| templateContext: | ||
| outputParentDirectory: $(Build.ArtifactStagingDirectory) | ||
|
|
@@ -402,10 +431,12 @@ jobs: | |
|
|
||
| - script: build.cmd | ||
| $(baseArguments) | ||
| $(targetArguments) | ||
| $(signArguments) | ||
| $(buildPassArguments) | ||
| $(ibcArguments) | ||
| $(baseProperties) | ||
| $(targetProperties) | ||
| $(signProperties) | ||
| $(buildPassProperties) | ||
| $(ibcProperties) | ||
| $(_SignDiagnosticFilesArgs) | ||
| ${{ parameters.extraProperties }} | ||
| displayName: Build | ||
|
|
@@ -421,8 +452,8 @@ jobs: | |
| - ${{ if eq(parameters.runTests, 'True') }}: | ||
| - script: build.cmd | ||
| $(baseArguments) | ||
| $(targetArguments) | ||
| $(buildPassArguments) | ||
| $(targetProperties) | ||
| $(buildPassProperties) | ||
| ${{ parameters.extraProperties }} | ||
| -test | ||
| -excludeCIBinarylog | ||
|
|
@@ -476,7 +507,8 @@ jobs: | |
|
|
||
| customEnvVars="" | ||
| customPreBuildArgs="" | ||
| customBuildArgs="--ci --clean-while-building --prepareMachine -c ${{ parameters.configuration }} $(officialBuildParameter)" | ||
| customBuildArgs="$(baseArguments) $(signArguments) $(_SignDiagnosticFilesArgs)" | ||
ellahathaway marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| extraBuildProperties="$(baseProperties) $(targetProperties) $(signProperties) $(buildPassProperties) ${{ parameters.extraProperties }}" | ||
|
|
||
| if [[ '${{ parameters.runOnline }}' == 'True' ]]; then | ||
| customBuildArgs="$customBuildArgs --online" | ||
|
|
@@ -502,16 +534,6 @@ jobs: | |
| customBuildArgs="$customBuildArgs --use-mono-runtime" | ||
| fi | ||
|
|
||
| if [[ '${{ parameters.sign }}' == 'True' ]] && [[ '${{ parameters.buildSourceOnly }}' != 'True' ]]; then | ||
| customBuildArgs="$customBuildArgs --sign" | ||
| if [[ '$(_SignType)' == 'real' ]] || [[ '$(_SignType)' == 'test' ]]; then | ||
| # Force dry run signing until https://github.com/dotnet/source-build/issues/4793 is resolved - https://github.com/dotnet/source-build/issues/4678 | ||
| extraBuildProperties="$extraBuildProperties /p:DotNetSignType=$(_SignType) /p:TeamName=$(_TeamName) /p:ForceDryRunSigning=true" | ||
| else | ||
| extraBuildProperties="$extraBuildProperties /p:ForceDryRunSigning=true" | ||
| fi | ||
| fi | ||
|
|
||
| if [[ -n "${{ parameters.targetRid }}" ]]; then | ||
| customBuildArgs="$customBuildArgs --target-rid ${{ parameters.targetRid }}" | ||
| fi | ||
|
|
@@ -523,26 +545,8 @@ jobs: | |
| fi | ||
| fi | ||
|
|
||
| if [[ ! -z '${{ parameters.targetOS }}' ]]; then | ||
| extraBuildProperties="$extraBuildProperties /p:TargetOS=${{ parameters.targetOS }}" | ||
| fi | ||
|
|
||
| if [[ ! -z '${{ parameters.targetArchitecture }}' ]]; then | ||
| extraBuildProperties="$extraBuildProperties /p:TargetArchitecture=${{ parameters.targetArchitecture }}" | ||
| fi | ||
|
|
||
| if [[ -n "${{ parameters.buildPass }}" ]]; then | ||
| extraBuildProperties="$extraBuildProperties /p:DotNetBuildPass=${{ parameters.buildPass }}" | ||
| fi | ||
|
|
||
| if [[ -n "${{ parameters.extraProperties }}" ]]; then | ||
| extraBuildProperties="$extraBuildProperties ${{ parameters.extraProperties }}" | ||
| fi | ||
|
|
||
| extraBuildProperties="$extraBuildProperties /p:VerticalName=$(Agent.JobName)" | ||
| extraBuildProperties="$extraBuildProperties /p:ArtifactsStagingDir=$(artifactsStagingDir)" | ||
|
|
||
| buildArgs="$(additionalBuildArgs) $customBuildArgs $extraBuildProperties" | ||
| buildArgs=$(echo $buildArgs | xargs) # Remove extra spaces | ||
|
|
||
| for envVar in $customEnvVars; do | ||
| customEnvVarsWithBashSyntax="$customEnvVarsWithBashSyntax export $envVar;" | ||
|
|
@@ -580,22 +584,13 @@ jobs: | |
| set -ex | ||
|
|
||
| customPreBuildArgs='' | ||
| customBuildArgs='' | ||
| extraBuildProperties='' | ||
| customBuildArgs="--ci --prepareMachine -c ${{ parameters.configuration }} $(officialBuildParameter)" | ||
| customBuildArgs="--test --excludeCIBinarylog /bl:artifacts/log/Release/Test.binlog $(baseArguments)" | ||
| extraBuildProperties="$(baseProperties) $(targetProperties) ${{ parameters.extraProperties }}" | ||
|
|
||
| if [[ '${{ parameters.runOnline }}' == 'False' ]]; then | ||
| customPreBuildArgs="$customPreBuildArgs sudo" | ||
| fi | ||
|
|
||
| if [[ ! -z '${{ parameters.targetOS }}' ]]; then | ||
| extraBuildProperties="$extraBuildProperties /p:TargetOS=${{ parameters.targetOS }}" | ||
| fi | ||
|
|
||
| if [[ ! -z '${{ parameters.targetArchitecture }}' ]]; then | ||
| extraBuildProperties="$extraBuildProperties /p:TargetArchitecture=${{ parameters.targetArchitecture }}" | ||
| fi | ||
|
|
||
| if [[ '${{ parameters.buildSourceOnly }}' == 'True' ]]; then | ||
| if [[ '${{ parameters.enablePoison }}' == 'True' ]]; then | ||
| customBuildArgs="$customBuildArgs --poison" | ||
|
|
@@ -607,15 +602,11 @@ jobs: | |
| customBuildArgs="$customBuildArgs --target-rid ${{ parameters.targetRid }}" | ||
| fi | ||
|
|
||
| extraBuildProperties="$extraBuildProperties /p:VerticalName=$(Agent.JobName)" | ||
| extraBuildProperties="$extraBuildProperties /p:ArtifactsStagingDir=$(artifactsStagingDir)" | ||
|
|
||
| if [[ -n "${{ parameters.extraProperties }}" ]]; then | ||
| extraBuildProperties="$extraBuildProperties ${{ parameters.extraProperties }}" | ||
| fi | ||
| buildArgs="$(additionalBuildArgs) $customBuildArgs $extraBuildProperties" | ||
| buildArgs=$(echo $buildArgs | xargs) # Remove extra spaces | ||
|
|
||
| cd $(sourcesPath) | ||
| $customPreBuildArgs ./build.sh --test --excludeCIBinarylog /bl:artifacts/log/Release/Test.binlog $customBuildArgs $extraBuildProperties $(additionalBuildArgs) | ||
| $customPreBuildArgs ./build.sh $buildArgs | ||
|
|
||
| displayName: Run Tests | ||
| timeoutInMinutes: ${{ variables.runTestsTimeout }} | ||
|
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 made the build command args/props available to all OS platforms so that the mac & linux legs could use the signing args + props.