Skip to content

Fix invalid escaping of environment variables in uno-config.js - #1061

Merged
jeromelaban merged 2 commits into
mainfrom
dev/jela/env-escape
May 22, 2026
Merged

jeromelaban merged 2 commits into
mainfrom
dev/jela/env-escape

Conversation

@jeromelaban

@jeromelaban jeromelaban commented May 21, 2026 •

Copy link
Copy Markdown
Member

Introduce WriteFileVerbatimTask_v0 to preserve backslashes in file writes and update uno-config.js handling

Copilot AI review requested due to automatic review settings May 21, 2026 19:04
@jeromelaban jeromelaban changed the title fix: Introduce WriteFileVerbatimTask_v0 to preserve backslashes in file writes and update uno-config.js handling Fix invalid escaping of environment variables in uno-config.js May 21, 2026
@github-actions

Copy link
Copy Markdown

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR introduces a custom MSBuild task to write uno-config.js content verbatim (avoiding MSBuild item-value backslash normalization) and updates the build/publish targets to use it when rewriting the dotnet.js fingerprint.

Changes:

  • Add WriteFileVerbatimTask_v0 (UTF-8, no BOM) to write content without MSBuild item pipeline transformations.
  • Replace <WriteLinesToFile> usages with WriteFileVerbatimTask_v0 for uno-config.js fingerprint updates (build, publish, and worker variants).
  • Add a unit-test regression check around JsStringHelper.EscapeJsString output and update server publish targets to use the new task.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
src/Uno.Wasm.Bootstrap/WriteFileVerbatimTask.cs Adds a dedicated MSBuild task to write file content verbatim (avoids \ → / corruption).
src/Uno.Wasm.Bootstrap/build/Uno.Wasm.Bootstrap.targets Registers and uses the new task to update uno-config.js fingerprinting without backslash normalization.
src/Uno.Wasm.Bootstrap.UnitTests/Given_ShellTask_EnvironmentVariableEscaping.cs Adds a regression test asserting escaped output contains literal backslash-quote.
src/Uno.Wasm.Bootstrap.Server/build/Uno.Wasm.Bootstrap.Server.targets Switches server publish-time fingerprint rewrite to use the new task via <UsingTask>.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@jeromelaban
jeromelaban marked this pull request as draft May 21, 2026 19:53
@github-actions

Copy link
Copy Markdown

@jeromelaban
jeromelaban marked this pull request as ready for review May 22, 2026 15:30
Copilot AI review requested due to automatic review settings May 22, 2026 15:30

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

@carldebilly carldebilly left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@jeromelaban
jeromelaban merged commit 2c8dd28 into main May 22, 2026
16 checks passed
@jeromelaban
jeromelaban deleted the dev/jela/env-escape branch May 22, 2026 17:33
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