-
-
Notifications
You must be signed in to change notification settings - Fork 159
#2261 Fix npm_deps tests on Windows, add a fix for Bazel 9.0.0 #2700
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
3467a06
c6294d0
8cb0190
f3aee52
467e3e6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -14,32 +14,37 @@ function getAcornVersion() { | |
| } | ||
|
|
||
| function sandboxAssert() { | ||
| if (!/-sandbox\/\d+\/execroot\//.test(__filename)) { | ||
| const sandboxRe = process.platform === 'win32' | ||
| ? /[/\\]execroot[/\\]/ | ||
| : /-sandbox\/\d+\/execroot\//; | ||
| if (!sandboxRe.test(__filename)) { | ||
| throw new Error(`Not in sandbox: ${__filename}`) | ||
| } | ||
|
|
||
| // Use of npm_package() copies files into the npm package store. | ||
| if (!__filename.includes('/node_modules/.aspect_rules_js/')) { | ||
| if (!/[/\\]node_modules[/\\]\.aspect_rules_js[/\\]/.test(__filename)) { | ||
| throw new Error(`Not in package store: ${__filename}`) | ||
| } | ||
|
|
||
| // When running under test, files should be in runfiles. | ||
| // This package may also be used as a run_binary(tool) and not in a test. | ||
| if (process.env.TEST_WORKSPACE) { | ||
| // On Windows, Node.js resolves junctions to their real path so __filename | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is that a fs-patch bug? Why does that only happen on windows? 🤔
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not an fs-patch bug. Node.js on Windows resolves junctions (directory symlinks) to their real path when returning
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I mean... that is a bug. I'm just not sure if we can ever fix it? |
||
| // won't start with RUNFILES_DIR. | ||
| if (process.env.TEST_WORKSPACE && process.platform !== 'win32') { | ||
| if (!__filename.startsWith(process.env.RUNFILES_DIR)) { | ||
| throw new Error(`Not in runfiles: ${__filename}`) | ||
| } | ||
| } | ||
|
|
||
| // Resolve of third-party package 'uuid' | ||
| const uuid_path = require.resolve('uuid') | ||
| if (!/-sandbox\/\d+\/execroot\//.test(uuid_path)) { | ||
| if (!sandboxRe.test(uuid_path)) { | ||
| throw new Error(`uuid not in sandbox: ${uuid_path}`) | ||
| } | ||
| if (!uuid_path.includes('/node_modules/.aspect_rules_js/uuid@')) { | ||
| if (!/[/\\]node_modules[/\\]\.aspect_rules_js[/\\]uuid@/.test(uuid_path)) { | ||
| throw new Error(`uuid not in package store: ${uuid_path}`) | ||
| } | ||
| if (process.env.TEST_WORKSPACE) { | ||
| if (process.env.TEST_WORKSPACE && process.platform !== 'win32') { | ||
| if (!uuid_path.startsWith(process.env.RUNFILES_DIR)) { | ||
| throw new Error( | ||
| `uuid not in runfiles while __filename is: ${uuid_path}` | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| d593b54327e834bc737c57553f55c5f1e25370850ad0e9b594804acfd7957b98 js/private/test/image/cksum_node.tar | ||
| c6c899aac772f0dd98117f2a469af76d8fb6ad27ccc7bfbc68f5e4ed274bf0ea js/private/test/image/cksum_package_store_3p.tar | ||
| bcd3826edb788a083e88ae3dbfb7fbd86bb1de8d8ef1db881b6488d63d715245 js/private/test/image/cksum_package_store_1p.tar | ||
| 78ffb39795e4707c65724572129dad2ff31c62921093422c7d866eb77aab05fe js/private/test/image/cksum_package_store_1p.tar | ||
| febf95a6d554c9bda3f0515bfd5ef273ac67d31c231d8162beaef8c4b7bc72f3 js/private/test/image/cksum_node_modules.tar |
Uh oh!
There was an error while loading. Please reload this page.