Skip to content

Commit

Permalink
Revert "fix(builtin): fix for nodejs_binary entry point in bazel-out …
Browse files Browse the repository at this point in the history
…logic (bazel-contrib#1739)"

This reverts commit a6e29c2.
  • Loading branch information
alexeagle committed Mar 27, 2020
1 parent 362ba69 commit 79c97e5
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 36 deletions.
5 changes: 1 addition & 4 deletions internal/node/launcher.sh
Original file line number Diff line number Diff line change
Expand Up @@ -191,10 +191,7 @@ for ARG in "${ALL_ARGS[@]:-}"; do
case "$ARG" in
--bazel_node_modules_manifest=*) MODULES_MANIFEST="${ARG#--bazel_node_modules_manifest=}" ;;
--nobazel_patch_module_resolver)
declare MAIN=$(rlocation "TEMPLATED_entry_point_manifest_path")
if [[ ! -f "$MAIN" ]]; then
MAIN="TEMPLATED_entry_point_execroot_path"
fi
MAIN="TEMPLATED_script_path"
LAUNCHER_NODE_OPTIONS=( "--require" "$node_patches_script" )

# In this case we should always run the linker
Expand Down
3 changes: 1 addition & 2 deletions internal/node/node.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -216,8 +216,6 @@ def _nodejs_binary_impl(ctx):
expand_location_into_runfiles(ctx, a, ctx.attr.data)
for a in ctx.attr.templated_args
]),
"TEMPLATED_entry_point_execroot_path": _to_execroot_path(ctx, ctx.file.entry_point),
"TEMPLATED_entry_point_manifest_path": _to_manifest_path(ctx, ctx.file.entry_point),
"TEMPLATED_env_vars": env_vars,
"TEMPLATED_expected_exit_code": str(expected_exit_code),
"TEMPLATED_link_modules_script": _to_manifest_path(ctx, ctx.file._link_modules_script),
Expand All @@ -227,6 +225,7 @@ def _nodejs_binary_impl(ctx):
"TEMPLATED_repository_args": _to_manifest_path(ctx, ctx.file._repository_args),
"TEMPLATED_require_patch_script": _to_manifest_path(ctx, ctx.outputs.require_patch_script),
"TEMPLATED_runfiles_helper_script": _to_manifest_path(ctx, ctx.file._runfiles_helper_script),
"TEMPLATED_script_path": _to_execroot_path(ctx, ctx.file.entry_point),
"TEMPLATED_vendored_node": "" if is_builtin else strip_external(ctx.file._node.path),
}
ctx.actions.expand_template(
Expand Down
26 changes: 0 additions & 26 deletions internal/node/test/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
load("@build_bazel_rules_nodejs//:index.bzl", "nodejs_binary", "nodejs_test", "npm_package_bin")
load("@build_bazel_rules_nodejs//internal/golden_file_test:golden_file_test.bzl", "golden_file_test")
load("@npm//typescript:index.bzl", "tsc")
load("//internal/js_library:js_library.bzl", "js_library")
load("//internal/node:node_repositories.bzl", "BUILT_IN_NODE_PLATFORMS")
load("//third_party/github.com/bazelbuild/bazel-skylib:rules/copy_file.bzl", "copy_file")
Expand Down Expand Up @@ -343,28 +342,3 @@ nodejs_test(
entry_point = "empty_args_fail.js",
expected_exit_code = 0,
)

tsc(
name = "main_lib",
outs = [
"main.js",
],
args = [
"-p",
"$(execpath tsconfig.json)",
"--outDir",
# $(RULEDIR) is a shorthand for the dist/bin directory where Bazel requires we write outputs
"$(RULEDIR)",
],
data = [
"main.ts",
"tsconfig.json",
],
)

nodejs_test(
name = "main_test",
data = [":main_lib"],
entry_point = ":main.js",
templated_args = ["--nobazel_patch_module_resolver"],
)
1 change: 0 additions & 1 deletion internal/node/test/main.ts

This file was deleted.

3 changes: 0 additions & 3 deletions internal/node/test/tsconfig.json

This file was deleted.

0 comments on commit 79c97e5

Please sign in to comment.