The use of pwsh was a bit confusing and inconsistent around the exit code. See also #32672
I think it is fine to drop it and purely use Bash/Python.
This also moves a bit of code from the github yaml to the python script.
Seems easier to just use Bash and Python consistently.
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
See the guideline for information on the review process.
| Type | Reviewers |
|---|---|
| ACK | hodlinator, m3dwards |
If your review is incorrectly listed, please copy-paste <!–meta-tag:bot-skip–> into the comment that the bot should ignore.
235- $installationPath = & $vswherePath -latest -property installationPath
236- & "${env:COMSPEC}" /s /c "`"$installationPath\Common7\Tools\vsdevcmd.bat`" -arch=x64 -no_logo && set" | foreach-object {
237- $name, $value = $_ -split '=', 2
238- echo "$name=$value" >> $env:GITHUB_ENV
239- }
240+ run: py -3 .github/ci-windows-cross.py github_env_setup_vs_dev_prompt
.github/ci-windows.py requires an unused positional arg, which is equally confusing. Will leave as-is for now.
IMPORT_VS_ENV?
Yes, it is needed. Otherwise:
0+ mt.exe -nologo '-inputresource:D:\a\bitcoin\bitcoin\bin\bitcoind.exe' '-out:D:\a\bitcoin\bitcoin\bin\bitcoind.manifest'
1[WinError 2] The system cannot find the file specified
2Error: Process completed with exit code 1.
https://github.com/bitcoin/bitcoin/actions/runs/22061363427/job/63743877223?pr=34583#step:6:11
The yaml anchor made more sense when there was a larger template. As it’s just a call to python now could the anchor just be dropped entirely?
thx. May do, if I have to re-push
28+ text=True,
29+ ).stdout.strip()
30+ vsdevcmd = Path(installation_path) / "Common7" / "Tools" / "vsdevcmd.bat"
31+ comspec = os.environ["COMSPEC"]
32+ output = run(
33+ f'"{comspec}" /s /c ""{vsdevcmd}" -arch=x64 -no_logo && set"',
"" after /c make me uneasy, but I guess the string parsing might disallow empty strings and so can support keeping track of one level of quoted strings internally.
cmd.exe. I’d be curious to see if there is a way (at all) to do this with an array of strings, but maybe this can be done in a follow-up by a Windows person? (I don’t have Windows, so testing all of this with CI isn’t smooth)
utACK faba7f616db05ded6cc642821ce540aa40fb8fcb
Wasn’t sure which python file the setup vs prompt belonged but agree it’s perhaps a bit silly to add another file just for this. I wasn’t able to test it on my windows machine as it requires Github environment vars.