From b71f9d933a97a8d73f47721242fea92353127dfa Mon Sep 17 00:00:00 2001 From: Alex Eagle Date: Mon, 17 May 2021 12:49:06 -0700 Subject: [PATCH] fix(builtin): write stdout/stderr to correct path under chdir (#2681) fixes #2680 --- internal/node/launcher.sh | 4 ++-- internal/node/test/chdir/BUILD.bazel | 1 + internal/node/test/chdir/cp.js | 1 + 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/internal/node/launcher.sh b/internal/node/launcher.sh index 6aa67c1722..ef168eb583 100644 --- a/internal/node/launcher.sh +++ b/internal/node/launcher.sh @@ -187,9 +187,9 @@ for ARG in ${ALL_ARGS[@]+"${ALL_ARGS[@]}"}; do # Supply custom linker arguments for first-party dependencies --bazel_node_modules_manifest=*) MODULES_MANIFEST="${ARG#--bazel_node_modules_manifest=}" ;; # Captures stdout of the node process to the file specified - --bazel_capture_stdout=*) STDOUT_CAPTURE="${ARG#--bazel_capture_stdout=}" ;; + --bazel_capture_stdout=*) STDOUT_CAPTURE="${PWD}/${ARG#--bazel_capture_stdout=}" ;; # Captures stderr of the node process to the file specified - --bazel_capture_stderr=*) STDERR_CAPTURE="${ARG#--bazel_capture_stderr=}" ;; + --bazel_capture_stderr=*) STDERR_CAPTURE="${PWD}/${ARG#--bazel_capture_stderr=}" ;; # Captures the exit code of the node process to the file specified --bazel_capture_exit_code=*) EXIT_CODE_CAPTURE="${ARG#--bazel_capture_exit_code=}" ;; # Disable the node_loader.js monkey patches for require() diff --git a/internal/node/test/chdir/BUILD.bazel b/internal/node/test/chdir/BUILD.bazel index 1f75e1c49d..aa772f007b 100644 --- a/internal/node/test/chdir/BUILD.bazel +++ b/internal/node/test/chdir/BUILD.bazel @@ -25,6 +25,7 @@ npm_package_bin( args = ["/".join([".."] * _package_segments + ["$@"])], chdir = package_name(), data = ["_package.json"], + stdout = "do_copy.log", tool = ":tool_cp", ) diff --git a/internal/node/test/chdir/cp.js b/internal/node/test/chdir/cp.js index 3e810e4c3a..13aedc45b9 100644 --- a/internal/node/test/chdir/cp.js +++ b/internal/node/test/chdir/cp.js @@ -12,3 +12,4 @@ function mkdirp(p) { mkdirp(dirname(dest)); fs.copyFileSync('_package.json', dest); +console.log('Copied _package.json ->', dest);