Skip to content

Conversation

@cameel
Copy link
Collaborator

@cameel cameel commented Oct 15, 2025

Prerequisite for #16246.

Having to research PowerShell syntax each time the the Windows version has to be touched and test it separately via SSH has always been a major pain. This finally unifies our CI builds scripts on all platforms.

@cameel cameel self-assigned this Oct 15, 2025
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This script is unrelated, but I noticed it's not used or referenced anywhere. This is a refactor PR anyway, so I thought I'd include it.

@cameel cameel force-pushed the rewrite-powershell-ci-build-script-in-bash branch from f1e9abb to 1965c8a Compare October 15, 2025 11:39
# Use last commit date rather than build date to avoid ending up with builds for
# different platforms having different version strings (and therefore producing different bytecode)
# if the CI is triggered just before midnight.
TZ=UTC git show --quiet --date="format-local:%Y.%-m.%-d" --format="${prerelease_source}.%cd"
Copy link
Collaborator Author

@cameel cameel Oct 15, 2025

Choose a reason for hiding this comment

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

Argh... For some reason %-m and %-d do not seem to be supported on Windows. Only %m and %d work. They result in git silently exiting with code 127.

We need those to get a version string like v0.2.5-ci.2021.1.2 rather than v0.2.5-ci.2021.01.02 (i.e. no leading zeros, so the date can pass for a version number). While I don't necessarily like this format, we are using it already, so we need to be able to match it.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Looks like date does support this format. So what I ended up doing is to parse it into a date and then format back, without leading zeros. More annoying but at least portable.

@cameel cameel force-pushed the rewrite-powershell-ci-build-script-in-bash branch 3 times, most recently from 542615f to bcb67b0 Compare October 15, 2025 16:43
@cameel cameel requested review from clonker and r0qs October 15, 2025 16:44
@cameel cameel marked this pull request as ready for review October 15, 2025 16:44
@cameel cameel force-pushed the rewrite-powershell-ci-build-script-in-bash branch from bcb67b0 to 9327b28 Compare October 15, 2025 18:33
clonker
clonker previously approved these changes Oct 16, 2025
Copy link
Member

@clonker clonker left a comment

Choose a reason for hiding this comment

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

approve with minor optional comment

@nikola-matic
Copy link
Collaborator

nikola-matic commented Oct 16, 2025

Bash is now supported on Windows? How does this work in the first place? Does it use the Ubuntu subsystem?

@cameel cameel force-pushed the rewrite-powershell-ci-build-script-in-bash branch from 9327b28 to e4421c0 Compare October 16, 2025 09:01
@cameel
Copy link
Collaborator Author

cameel commented Oct 16, 2025

Bash is now supported on Windows? How does this work in the first place? Does it use the Ubuntu subsystem?

No, I think it's simply what comes with Git for Windows. MSYS2 I guess? Or some other implementation - there have been several implementations of GNU tools and shells floating around since forever.

In any case, CircleCI has always had bash.exe in their Windows images and I think we should be switching to it whenever possible to avoid having to handle Windows specially.

@nikola-matic
Copy link
Collaborator

Bash is now supported on Windows? How does this work in the first place? Does it use the Ubuntu subsystem?

No, I think it's simply what comes with Git for Windows. MSYS2 I guess? Or some other implementation - there have been several implementations of GNU tools and shells floating around since forever.

In any case, CircleCI has always had bash.exe in their Windows images and I think we should be switching to it whenever possible to avoid having to handle Windows specially.

Cygwin I as well I guess - it seems very nicely integrated, weird that we haven't done it before.

@cameel cameel enabled auto-merge October 16, 2025 09:25
@cameel
Copy link
Collaborator Author

cameel commented Oct 16, 2025

Well, I think it's not Cygwin. AFAIK Cygwin has always been a bigger, slower and more integrated thing. MSYS has fewer pieces. But I guess it still has some relation to Cygwin in the end. Maybe it's sharing pieces with it.

@cameel cameel merged commit 56686ce into develop Oct 16, 2025
75 checks passed
@cameel cameel deleted the rewrite-powershell-ci-build-script-in-bash branch October 16, 2025 09:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants