Skip to content

Fix MAUI Android inner loop MSBuild arg splitting on Helix - #5285

Open
LoopedBard3 wants to merge 1 commit into
dotnet:mainfrom
LoopedBard3:loopedbard3-fix-maui-innerloop-arg-splitting
Open

Fix MAUI Android inner loop MSBuild arg splitting on Helix#5285
LoopedBard3 wants to merge 1 commit into
dotnet:mainfrom
LoopedBard3:loopedbard3-fix-maui-innerloop-arg-splitting

Conversation

@LoopedBard3

Copy link
Copy Markdown
Member

Problem

An inner loop MAUI Android device run showed MSBuild /p: arguments being executed as standalone shell commands:

(.venv) D:\...>/p:PublishReadyToRun=false
The filename, directory name, or volume label syntax is incorrect.

(.venv) D:\...>/p:PublishReadyToRunComposite=false /p:RuntimeIdentifier=android-arm64 /p:SupportedOSPlatformVersion=24 /p:TargetFrameworks=net11.0-android"
The filename, directory name, or volume label syntax is incorrect.

setup_helix.py's restore also silently received only the first arg (/p:UseMonoRuntime=false), dropping the R2R args.

Root cause

In eng/performance/maui_scenarios_android_innerloop.proj, the coreclr branch built _MSBuildArgs joining args with ;:

$(_MSBuildArgs);/p:PublishReadyToRun=false;/p:PublishReadyToRunComposite=false

_MSBuildArgs is passed to Helix as a single quoted argument (--msbuild-args "$(_MSBuildArgs)" and setup_helix.py ... "$(_MSBuildArgs)"). Helix treats ; as a command separator when generating the run script — the same behavior the set X=Y;set A=B env-var blocks rely on. So the semicolons split the quoted argument across separate command lines: the first piece kept the opening quote, and the remaining /p: pieces ran as their own commands.

Mono builds were unaffected because that path never introduced a ;.

Fix

Use spaces instead of ;, consistent with every other append in that PropertyGroup. The Python side (re.split(r'[;\s]+', ...) in both runner.py and setup_helix.py) already splits on whitespace, so args still parse correctly into the subprocess.run argument list — and now every arg actually reaches Python and MSBuild.

The coreclr _MSBuildArgs value joined /p:PublishReadyToRun and /p:PublishReadyToRunComposite with ';'. Since _MSBuildArgs is passed to Helix as a single quoted argument and Helix treats ';' as a command separator when generating the run script, the semicolons split the quoted argument across separate command lines. This caused setup_helix.py to receive only the first arg and the remaining /p: args to run as standalone commands (failing with 'The filename, directory name, or volume label syntax is incorrect').

Use spaces instead, matching every other append in the PropertyGroup. The Python side already splits on [;\s]+, so args still parse correctly.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 0cabccd5-6263-4ed9-abe7-a8da6c6979a3
Copilot AI lite review requested due to automatic review settings August 20, 2026 21:11
@LoopedBard3 LoopedBard3 self-assigned this Aug 20, 2026

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.

Pull request overview

This pull request fixes MAUI Android inner-loop Helix runs where MSBuild /p: arguments were being split into separate shell commands, causing later arguments to be dropped or executed incorrectly.

Changes:

  • Update the CoreCLR _MSBuildArgs append logic to use spaces instead of semicolons when adding ReadyToRun-related /p: arguments.
  • Expand the inline comment to document why ; is unsafe for _MSBuildArgs when passed through Helix as a single quoted argument.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

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