Skip to content

ci: upgrade to Node 20 for Windows long path support#3645

Open
ramsessanchez wants to merge 3 commits into
mainfrom
ramsess/upgrade-node20-long-paths
Open

ci: upgrade to Node 20 for Windows long path support#3645
ramsessanchez wants to merge 3 commits into
mainfrom
ramsess/upgrade-node20-long-paths

Conversation

@ramsessanchez

Copy link
Copy Markdown
Contributor

Problem

The CI build fails with \ENOENT\ errors on generated files with paths exceeding 260 characters (e.g., the Reports module has paths ~309 chars long). The previously added
eg add\ for \LongPathsEnabled\ had no effect.

Root Cause

The Windows \LongPathsEnabled\ registry key only works for applications that declare \longPathAware\ in their PE manifest. Node.js 18 does not include this flag — it was added in Node.js 20. Since autorest (which generates the C# files) runs on Node.js, the registry key was silently ignored.

Fix

  • Upgrade Node.js from 18.x to 20.x in the pipeline
  • Add \RUSH_ALLOW_UNSUPPORTED_NODEJS=1\ for Rush commands (rush.json in the autorest.powershell submodule constrains to <20, but this is a soft guard)
  • Pass -AllowUnsupportedNode\ to all \GenerateModules.ps1\ calls (which sets the same env var internally)

Risk

Low — Node 20 is backward-compatible with 18 for the npm/rush/autorest ecosystem. The autorest.powershell packages declare \�ngines.node: >=10.12.0\ with no upper bound. If any issue arises, it would manifest as an immediate build failure (not a subtle regression).

Node.js 18 does not include the 'longPathAware' manifest flag in its
executable, which means the Windows LongPathsEnabled registry key has
no effect. Node.js 20+ ships with this manifest flag, enabling proper
long path support (>260 chars) when combined with the registry key.

Changes:
- Upgrade Node from 18.x to 20.x in install-tools.yml
- Set RUSH_ALLOW_UNSUPPORTED_NODEJS=1 for the Rush Build step
- Add -AllowUnsupportedNode to all GenerateModules.ps1 invocations

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@ramsessanchez ramsessanchez requested a review from a team as a code owner June 17, 2026 17:44
ramsessanchez and others added 2 commits June 17, 2026 10:55
The parameter was being passed from the pipeline YAML but did not exist
in the script on main. Adds the switch parameter and sets
RUSH_ALLOW_UNSUPPORTED_NODEJS=1 when specified, allowing Rush to run
on Node 20+.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.

1 participant