Skip to content

Commit 17e27dd

Browse files
committed
Merge bitcoin#22912: ci: Fix merge_script in MSVC task
f78cc90 ci: Fix merge_script in MSVC task (Hennadii Stepanov) Pull request description: The new `merge_script` in the MSVC build task does not really exit early when the task is triggered by a non-pr. In the current code https://github.com/bitcoin/bitcoin/blob/e4aa9b15b9f80a08076ad329b473fe9107d9e65e/.cirrus.yml#L104 the `exit 0` command exits from the PowerShell call, not the recent `merge_script`. This cause the next lines https://github.com/bitcoin/bitcoin/blob/e4aa9b15b9f80a08076ad329b473fe9107d9e65e/.cirrus.yml#L105-L107 are executed unconditionally. Here is an excerpt from [CI task log](https://api.cirrus-ci.com/v1/task/4578647416766464/logs/merge.log) for the ["Merge bitcoin#22915: Remove confusing CAddrDB " commit](bitcoin@8966499): ``` ... C:\Users\ContainerAdministrator\AppData\Local\Temp\cirrus-ci-build>call powershell.exe -NoLogo -EncodedCommand ZwBpAHQAIAByAGUAcwBlAHQAIAAtAC0AaABhAHIAZAA= HEAD is now at 8966499 Merge bitcoin#22915: Remove confusing CAddrDB C:\Users\ContainerAdministrator\AppData\Local\Temp\cirrus-ci-build>if 0 NEQ 0 exit /b 0 C:\Users\ContainerAdministrator\AppData\Local\Temp\cirrus-ci-build>call powershell.exe -NoLogo -EncodedCommand aQBmACAAKAAkAGUAbgB2ADoAQwBJAFIAUgBVAFMAXwBQAFIAIAAtAGUAcQAgACQAbgB1AGwAbAApACAAewAgAGUAeABpAHQAIAAwADsAIAB9AA== C:\Users\ContainerAdministrator\AppData\Local\Temp\cirrus-ci-build>if 0 NEQ 0 exit /b 0 C:\Users\ContainerAdministrator\AppData\Local\Temp\cirrus-ci-build>call powershell.exe -NoLogo -EncodedCommand ZwBpAHQAIABmAGUAdABjAGgAIAAkAGUAbgB2ADoAQwBJAFIAUgBVAFMAXwBSAEUAUABPAF8AQwBMAE8ATgBFAF8AVQBSAEwAIAAkAGUAbgB2ADoAQwBJAFIAUgBVAFMAXwBCAEEAUwBFAF8AQgBSAEEATgBDAEgA From https://github.com/bitcoin/bitcoin * branch HEAD -> FETCH_HEAD C:\Users\ContainerAdministrator\AppData\Local\Temp\cirrus-ci-build>if 0 NEQ 0 exit /b 0 C:\Users\ContainerAdministrator\AppData\Local\Temp\cirrus-ci-build>call powershell.exe -NoLogo -EncodedCommand ZwBpAHQAIABtAGUAcgBnAGUAIABGAEUAVABDAEgAXwBIAEUAQQBEAA== Already up to date. C:\Users\ContainerAdministrator\AppData\Local\Temp\cirrus-ci-build>if 0 NEQ 0 exit /b 0 ``` This PR fixes this issue, and makes `merge_script` log more readable. ACKs for top commit: MarcoFalke: Concept ACK f78cc90 Tree-SHA512: c88b115f99f9019a4100a10df051e32c05487612c13105d10873b9cf38965eeca731604d36610ae750cb1f93ba77ce97dca7599fe4984181210d0753be4eb9a0
2 parents e4aa9b1 + f78cc90 commit 17e27dd

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

.cirrus.yml

+5-8
Original file line numberDiff line numberDiff line change
@@ -94,17 +94,14 @@ task:
9494
x64_NATIVE_TOOLS: '"C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Auxiliary\Build\vcvars64.bat"'
9595
IgnoreWarnIntDirInTempDetected: 'true'
9696
merge_script:
97-
- ps: git config --global user.email "ci@ci.ci"
98-
- ps: git config --global user.name "ci"
97+
- git config --global user.email "ci@ci.ci"
98+
- git config --global user.name "ci"
9999
# Windows filesystem loses the executable bit, and all of the executable
100100
# files are considered "modified" now. It will break the following `git merge`
101101
# command. The next two commands make git ignore this issue.
102-
- ps: git config core.filemode false
103-
- ps: git reset --hard
104-
- ps: if ($env:CIRRUS_PR -eq $null) { exit 0; }
105-
- ps: git fetch $env:CIRRUS_REPO_CLONE_URL $env:CIRRUS_BASE_BRANCH
106-
# Merge base to detect silent merge conflicts.
107-
- ps: git merge FETCH_HEAD
102+
- git config core.filemode false
103+
- git reset --hard
104+
- PowerShell -NoLogo -Command if ($env:CIRRUS_PR -ne $null) { git fetch $env:CIRRUS_REPO_CLONE_URL $env:CIRRUS_BASE_BRANCH; git merge FETCH_HEAD; }
108105
msvc_qt_built_cache:
109106
folder: "%QTBASEDIR%"
110107
reupload_on_changes: false

0 commit comments

Comments
 (0)