Skip to content

v0.10.2 — A single cmake argument stays an argument

Choose a tag to compare

@rhalbersma rhalbersma released this 19 Sep 16:13
· 35 commits to main since this release
29fdd66

A caller passing exactly one -D argument through cmake_args to a
PowerShell leg had it delivered to cmake one character at a time. cmake
answered Unknown argument -, then Ignoring extra path for the last
character, and configured nothing.

$extra = $env:EXTRA_CMAKE -split '\s+' | Where-Object { $_ }

A PowerShell pipeline yielding one object assigns that object rather than a
one-element array, so $extra was a [string] — and splatting a string
enumerates it. At two or more arguments the split already yields an Object[]
and @extra is what it looks like, which is why this went unseen for so long:
no caller had passed exactly one.

The fix is @( ) around the pipeline, at all three sites — mingw.yml, and
both configure steps in visual-studio.yml (the regular one and the preview
toolset's).

What is affected

Workflow Affected
visual-studio.yml yes — both configure steps
mingw.yml yes
msvc-analyze.yml no — reads its arguments with bash's read -ra
every Unix leg no — bash throughout

Checked against pwsh 7.4.6 at every arity, before and after:

none  before Object[] ->                 after Object[] ->
one   before String   -> '-' 'D' 'X' ... after Object[] -> '-DXSTD_BITS_CXX_STANDARD=26'
two   before Object[] -> '-DA=1' '-DB=2' after Object[] -> '-DA=1' '-DB=2'

Empty and two-or-more are byte for byte what they were. Only the one-argument
case changes, and it changes from broken to correct.

No inputs or check names change

.github/actions/ and toolchains.json are untouched since v0.10.1, so every
ladder resolves exactly as it did and no required check needs renaming.

Upgrading

Repin, nothing else:

uses: rhalbersma/cpp-ci/.github/workflows/visual-studio.yml@29fdd6605bf237863ad39c3919c2cf389cfb6d38 # v0.10.2
uses: rhalbersma/cpp-ci/.github/workflows/mingw.yml@29fdd6605bf237863ad39c3919c2cf389cfb6d38 # v0.10.2