Skip to content

test: fix non-ASCII addon cache path - #3370

Merged
legendecas merged 1 commit into
nodejs:mainfrom
gengjiawen:fix/non-ascii-addon-devdir
Sep 10, 2026
Merged

test: fix non-ASCII addon cache path#3370
legendecas merged 1 commit into
nodejs:mainfrom
gengjiawen:fix/non-ascii-addon-devdir

Conversation

@gengjiawen

Copy link
Copy Markdown
Member

The non-ASCII addon test passes a downloaded SDK version directory through --nodedir. On Windows this makes node-gyp look for Release/node.lib, while the downloaded library is stored in <arch>/node.lib, causing LNK1104.

Python 3.15 enables UTF-8 mode by default, allowing the Latīna fixture 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. Keep Latīna and the existing symlink error handling, and clean up the temporary directory in finally.

Related to #3369 and nodejs/gyp-next#357.

Validation
  • npm run lint passed.
  • NODE_OPTIONS=--dns-result-order=ipv4first npm test: 114 passing, 6 pending. IPv4-first is needed for localhost resolution in the local container.
  • Local addon tests with the encoding-name selection overridden to cp1252: 3 passing, no skips, including actual build/load through Latīna. Verified EEXIST, EPERM, other symlink errors, and temporary-directory cleanup with fault injection.
  • Windows validation on Node.js 24 with Python 3.14 (PYTHONUTF8=1) and Python 3.15 (default mode): each had 3 addon tests passing, no skips. This run used revision 5fc9412; the final revision keeps the same successful build path and adds explanatory comments and the original symlink error handling.
Checklist
  • Lint and tests pass as described above.
  • The existing regression test is updated.
  • Commit message follows the commit guidelines.

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.
@legendecas
legendecas merged commit e6f699f into nodejs:main Sep 10, 2026
38 checks passed
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.

3 participants