Skip to content

Remove trailing line continuation in source-build step - #17800

Merged
akoeplinger merged 1 commit into
mainfrom
users/richlander/source-build-trailing-backslash
Nov 12, 2026
Merged

akoeplinger merged 1 commit into
mainfrom
users/richlander/source-build-trailing-backslash

Conversation

@richlander

Copy link
Copy Markdown
Member

The source-build Build step in eng/common/core-templates/steps/source-build.yml ends with a line continuation ($portableBuildArgs \). Azure Pipelines trims the script, so the generated .sh file ends with a backslash and no trailing newline.

  • bash 5.2 (Azure Linux 3) silently drops it.
  • bash 5.3 (Azure Linux 4) passes a literal \ argument to build.sh, and MSBuild then fails with MSB1008: Only one project can be specified.

This was hit in dotnet/aspnetcore#70522 after moving the source-build container to azurelinux-4.0-net11.0-cross-amd64:

+ ./eng/build.sh --ci --configuration Release --restore --build --pack -bl --source-build --source-build -p:CrossBuild=true '\'
MSBUILD : error MSB1008: Only one project can be specified.

Fix: remove the trailing \.

To double check:

Validation: reproduced in the azurelinux-3.0-net11.0-cross-amd64 (bash 5.2.15) and azurelinux-4.0-net11.0-cross-amd64 (bash 5.3.9) images. Running a script that ends in \ with no newline yields a literal \ argument only on 5.3; without the trailing \ both behave correctly. Template YAML parses.

Note

This PR description was generated with the help of GitHub Copilot.

The source-build Build step ended with `$portableBuildArgs \`. Azure
Pipelines trims the script, so the generated file ends with a backslash
and no newline. Bash 5.2 drops it, but bash 5.3 (Azure Linux 4) passes a
literal `\` argument to build.sh, which fails with MSB1008: Only one
project can be specified.

Co-authored-by: Copilot <[email protected]>
@richlander
richlander requested a review from a team as a code owner November 12, 2026 00:43
Copilot AI balanced review requested due to automatic review settings November 12, 2026 00:43
richlander added a commit to dotnet/aspnetcore that referenced this pull request Nov 12, 2026
Bash 5.3 in the Azure Linux 4 cross image turns the trailing line
continuation in Arcade's source-build step into a literal `\` argument
(MSB1008). Stay on Azure Linux 3 until dotnet/arcade#17800 flows in.
Tracked by #70524.

Co-authored-by: Copilot <[email protected]>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

No active review issues were reported for the change removing the unnecessary trailing backslash from the source-build script.

No open issues 🎉

What changed in this PR

Fixes the shared source-build pipeline step so a trimmed script does not pass a literal \ argument to build.sh under Bash 5.3, causing MSBuild error MSB1008.

Changes:

  • Removes the trailing line-continuation character after $portableBuildArgs, leaving the build arguments unchanged.
File Description
eng/​common/​core-templates/​steps/​source-build.yml Removes the unnecessary final backslash from the Build script.

Review effort: Balanced

@akoeplinger
akoeplinger merged commit ffc98fd into main Nov 12, 2026
13 checks passed
@akoeplinger
akoeplinger deleted the users/richlander/source-build-trailing-backslash branch November 12, 2026 16:48
@dotnet-milestone-bot dotnet-milestone-bot Bot added this to the 12.0-preview1 milestone Nov 13, 2026
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.

4 participants