test: fix non-ASCII addon cache path - #3370
Merged
Merged
Conversation
On cp1252 Windows, the charmap fixture cannot print U+012B with UTF-8 mode disabled, so the addon test is skipped. Python 3.15 enables UTF-8 mode by default, allowing the test to run and exposing a cache layout mismatch: --nodedir selects Release/node.lib, but the downloaded SDK stores it under the target architecture. Link the cache root through a temporary non-ASCII path and pass it with --devdir, preserving the version/architecture/node.lib layout. Clean up the temporary directory in finally while preserving the existing symlink error handling, including the administrator hint for EPERM.
4 tasks
StefanStojanovic
approved these changes
Sep 10, 2026
legendecas
approved these changes
Sep 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The non-ASCII addon test passes a downloaded SDK version directory through
--nodedir. On Windows this makes node-gyp look forRelease/node.lib, while the downloaded library is stored in<arch>/node.lib, causingLNK1104.Python 3.15 enables UTF-8 mode by default, allowing the
Latīnafixture to pass the encoding guard on cp1252 Windows and exposing this existing path mismatch. Older Python versions with UTF-8 mode disabled skip the test when the fixture cannot print U+012B.Link the cache root through the non-ASCII path and pass it with
--devdir, so node-gyp resolves<version>/<arch>/node.lib. KeepLatīnaand the existing symlink error handling, and clean up the temporary directory infinally.Related to #3369 and nodejs/gyp-next#357.
Validation
npm run lintpassed.NODE_OPTIONS=--dns-result-order=ipv4first npm test: 114 passing, 6 pending. IPv4-first is needed for localhost resolution in the local container.cp1252: 3 passing, no skips, including actual build/load throughLatīna. VerifiedEEXIST,EPERM, other symlink errors, and temporary-directory cleanup with fault injection.PYTHONUTF8=1) and Python 3.15 (default mode): each had 3 addon tests passing, no skips. This run used revision5fc9412; the final revision keeps the same successful build path and adds explanatory comments and the original symlink error handling.Checklist