Skip to content

make-release: accept comma-joined -Rid from -File callers (fixes the release job's MSB1006) - #3

Merged
StArraySharp merged 2 commits into
StArraySharp:mainfrom
HitMargin:fix/release-rid-split
Nov 4, 2026
Merged

StArraySharp merged 2 commits into
StArraySharp:mainfrom
HitMargin:fix/release-rid-split

Conversation

@2228293026

Copy link
Copy Markdown
Contributor

The failure

release artifacts / Package failed on main (run 41218035128) with:

== cli / win-x64,linux-x64 / 1.2.2 ==
MSBUILD : error MSB1006: Property is not valid.
Switch: linux-x64
→ tools/make-release.ps1:76 (throw "publish failed for $oneRid")

Why

The CI invokes the script with pwsh -File tools/make-release.ps1 -Rid win-x64,linux-x64. In -File mode PowerShell binds that comma-joined string to the [string[]] parameter as a single element (no array splitting), so the per-RID foreach ran once with win-x64,linux-x64 and handed dotnet publish -r win-x64,linux-x64 to MSBuild in one piece -- MSBuild then read the second RID as a bare switch (MSB1006).

The fix

Normalize the parameter at the top of the script: split every element on commas and trim, so both caller forms reach the loop as one RID per element:

  • -Rid win-x64,linux-x64 (the CI's -File form) → win-x64, linux-x64
  • -Rid @('win-x64','linux-x64') (the documented default/array form) → unchanged

Both forms verified locally (count and content of the resulting list).

Verification note

The release artifacts job only runs on pushes to main and tags, so this branch's CI exercises build + test only -- the packaging path gets its proof when this lands on main and the next release job runs green.

The CI passes the RID list as 'pwsh -File ... -Rid win-x64,linux-x64'.
With -File, PowerShell binds that comma-joined string to the [string[]]
parameter as a single element, so the per-RID loop ran once with the
joined value and dotnet publish handed MSBuild '-r
win-x64,linux-x64' in one piece -- MSBuild read the second RID as a
bare switch and failed with MSB1006 ('Switch: linux-x64').

Normalize the parameter at the top of the script: split every element
on commas and trim.  Array callers (the documented default) are
unaffected; -File callers now get one publish per RID as the loop
intends.
…nner (the previous run's failure is a file-lock, not a code change)
@StArraySharp
StArraySharp merged commit 17a6d69 into StArraySharp:main Nov 4, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants