Skip to content

ci: [refactor] Drop last use of pwsh#34583

Merged
fanquake merged 2 commits intobitcoin:masterfrom
maflcko:2602-ci-win-cross
Feb 27, 2026
Merged

ci: [refactor] Drop last use of pwsh#34583
fanquake merged 2 commits intobitcoin:masterfrom
maflcko:2602-ci-win-cross

Conversation

@maflcko
Copy link
Member

@maflcko maflcko commented Feb 13, 2026

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.

@DrahtBot DrahtBot changed the title ci: [refactor] Drop last use of pwsh ci: [refactor] Drop last use of pwsh Feb 13, 2026
@DrahtBot DrahtBot added the Tests label Feb 13, 2026
@DrahtBot
Copy link
Contributor

DrahtBot commented Feb 13, 2026

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

Reviews

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.

@fanquake
Copy link
Member

cc @m3dwards @hodlinator

Copy link
Contributor

@hodlinator hodlinator left a comment

Choose a reason for hiding this comment

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

ACK faba7f6

vsdevcmd = Path(installation_path) / "Common7" / "Tools" / "vsdevcmd.bat"
comspec = os.environ["COMSPEC"]
output = run(
f'"{comspec}" /s /c ""{vsdevcmd}" -arch=x64 -no_logo && set"',
Copy link
Contributor

Choose a reason for hiding this comment

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

The double citation marks "" 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.

Copy link
Member Author

Choose a reason for hiding this comment

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

This is just a literal copy of what the pwsh script did (it also had the exact same full string with the exact same double quotes), which are required for 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)

Copy link
Contributor

Choose a reason for hiding this comment

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

This is just a literal copy of what the pwsh script did (it also had the exact same full string with the exact same double quotes)

It had some back-ticks in there, but I don't see what difference they would make.

& "${env:COMSPEC}" /s /c "`"$installationPath\Common7\Tools\vsdevcmd.bat`" -arch=x64 -no_logo && set" | foreach-object {

Copy link
Member Author

@maflcko maflcko Feb 18, 2026

Choose a reason for hiding this comment

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

It had some back-ticks in there, but I don't see what difference they would make.

I think the back-ticks are just some pwsh thing to escape the " char, but I am not 100% sure. (This confusion is one of the reasons to drop pwsh)

In python that isn't needed, because '-strings can contain " chars as-is.

I am still curious if a Windows person or a Windows LLM can refactor subprocess.run(f'"{comspec}" /s /c ""{vsdevcmd}" -arch=x64 -no_logo && set")' into the run([...]) form.

@m3dwards
Copy link
Contributor

utACK faba7f6

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.

MarcoFalke added 2 commits February 17, 2026 22:06
Also, change the yaml anchor name and the step name.
Also, small refactors while touching the files.
Seems easier to just use Bash and Python consistently.
Copy link
Contributor

@hodlinator hodlinator left a comment

Choose a reason for hiding this comment

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

re-ACK fa36ade

vsdevcmd = Path(installation_path) / "Common7" / "Tools" / "vsdevcmd.bat"
comspec = os.environ["COMSPEC"]
output = run(
f'"{comspec}" /s /c ""{vsdevcmd}" -arch=x64 -no_logo && set"',
Copy link
Contributor

Choose a reason for hiding this comment

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

This is just a literal copy of what the pwsh script did (it also had the exact same full string with the exact same double quotes)

It had some back-ticks in there, but I don't see what difference they would make.

& "${env:COMSPEC}" /s /c "`"$installationPath\Common7\Tools\vsdevcmd.bat`" -arch=x64 -no_logo && set" | foreach-object {

@DrahtBot DrahtBot requested a review from m3dwards February 18, 2026 08:36
@maflcko maflcko requested review from m3dwards and removed request for m3dwards February 26, 2026 08:36
@m3dwards
Copy link
Contributor

Looks good! re-ACK fa36ade

@maflcko maflcko requested a review from hebasto February 26, 2026 18:05
@fanquake fanquake merged commit ceff677 into bitcoin:master Feb 27, 2026
51 of 52 checks passed
@maflcko maflcko deleted the 2602-ci-win-cross branch February 27, 2026 16:07
Copy link
Member

@hebasto hebasto left a comment

Choose a reason for hiding this comment

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

Post-merge ACK fa36ade.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants