-
Notifications
You must be signed in to change notification settings - Fork 522
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: ensure BAZEL_NODE_RUNFILES_HELPER & BAZEL_NODE_PATCH_REQUIRE are…
… absolute (#1634) * fix: ensure BAZEL_NODE_RUNFILES_HELPER & BAZEL_NODE_PATCH_REQUIRE are absolute ``` export BAZEL_NODE_RUNFILES_HELPER=$(rlocation "build_bazel_rules_nodejs/internal/linker/runfiles_helper.js") ``` resolves to `/Users/greg/google/rules_nodejs/internal/linker/runfiles_helper.js` when workers are on as there is no sandbox & resolves to `bazel-out/host/bin/external/build_bazel_rules_typescript/internal/tsc_wrapped_bin.sh.runfiles/build_bazel_rules_nodejs/internal/linker/runfiles_helper.js` when workers are off as there is a sandbox The latter is a relative path and won't work in a require() statement unless joined with the CWD. This commit adds the CWD in the launcher. * test: test require(process.env['BAZEL_NODE_RUNFILES_HELPER']) in npm_package_bin
- Loading branch information
1 parent
d635dca
commit 25600ea
Showing
4 changed files
with
33 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
hello_world |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
const fs = require('fs'); | ||
const args = process.argv.slice(2); | ||
const outfile = args.shift(); | ||
const runfiles = require(process.env['BAZEL_NODE_RUNFILES_HELPER']); | ||
const golden = | ||
runfiles.resolve('build_bazel_rules_nodejs/internal/node/test/test_runfiles_helper.golden'); | ||
fs.writeFileSync(outfile, fs.readFileSync(golden, 'utf-8'), 'utf-8'); |