Skip to content

Commit

Permalink
refactor: update js_binary executable path to {name}_/{name}
Browse files Browse the repository at this point in the history
  • Loading branch information
gregmagolan committed May 7, 2024
1 parent b8434ce commit 55c00e3
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 10 deletions.
2 changes: 1 addition & 1 deletion e2e/worker/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ copy_file(
)

js_binary(
name = "worker_binary",
name = "worker",
data = [":copy_worker_js"],
entry_point = ":copy_dummy_worker",
visibility = ["//visibility:public"],
Expand Down
2 changes: 1 addition & 1 deletion e2e/worker/defs.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ pi_rule = rule(
"worker": attr.label(
executable = True,
cfg = "exec",
default = ":worker_binary",
default = ":worker",
),
},
)
2 changes: 1 addition & 1 deletion examples/coverage/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
load("@aspect_rules_js//js:defs.bzl", "js_test")

js_test(
name = "coverage_test",
name = "coverage",
data = [
"coverage.js",
"//:node_modules/@types/node",
Expand Down
2 changes: 1 addition & 1 deletion js/private/coverage/merger.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def _coverage_merger_impl(ctx):
node_path = _deprecated_target_tool_path_to_short_path(nodeinfo.target_tool_path)

# Create launcher
bash_launcher = ctx.actions.declare_file(ctx.label.name)
bash_launcher = ctx.actions.declare_file("{}_/{}".format(ctx.label.name, ctx.label.name))
ctx.actions.expand_template(
template = ctx.file._launcher_template,
output = bash_launcher,
Expand Down
2 changes: 1 addition & 1 deletion js/private/js_binary.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,7 @@ def _bash_launcher(ctx, nodeinfo, entry_point_path, log_prefix_rule_set, log_pre
"{{workspace_name}}": ctx.workspace_name,
}

launcher = ctx.actions.declare_file(ctx.label.name)
launcher = ctx.actions.declare_file("{}_/{}".format(ctx.label.name, ctx.label.name))
ctx.actions.expand_template(
template = ctx.file._launcher_template,
output = launcher,
Expand Down
2 changes: 1 addition & 1 deletion js/private/test/image/checksum.expected
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
e6a04b6344eb21154508bf246ebead12d436313739c478978cd5763262491f98 js/private/test/image/cksum_app.tar
413693b1ad714b0dac59551b063bc33d0a4a680c9d48b71eba88c06a301cfc4a js/private/test/image/cksum_app.tar
7990126e5961588efd2af7cdccac3846dfffb8ca2e26206840df8c7a1c34c42e js/private/test/image/cksum_node_modules.tar
5 changes: 3 additions & 2 deletions js/private/test/image/custom_owner_app.listing
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@ drwxr-xr-x 100/0 0 1970-01-01 00:00 app/js
drwxr-xr-x 100/0 0 1970-01-01 00:00 app/js/private
drwxr-xr-x 100/0 0 1970-01-01 00:00 app/js/private/test
drwxr-xr-x 100/0 0 1970-01-01 00:00 app/js/private/test/image
-r-xr-xr-x 100/0 131 1970-01-01 00:00 app/js/private/test/image/bin
-r-xr-xr-x 100/0 136 1970-01-01 00:00 app/js/private/test/image/bin
drwxr-xr-x 100/0 0 1970-01-01 00:00 app/js/private/test/image/bin.runfiles
drwxr-xr-x 100/0 0 1970-01-01 00:00 app/js/private/test/image/bin.runfiles/aspect_rules_js
drwxr-xr-x 100/0 0 1970-01-01 00:00 app/js/private/test/image/bin.runfiles/aspect_rules_js/js
drwxr-xr-x 100/0 0 1970-01-01 00:00 app/js/private/test/image/bin.runfiles/aspect_rules_js/js/private
drwxr-xr-x 100/0 0 1970-01-01 00:00 app/js/private/test/image/bin.runfiles/aspect_rules_js/js/private/test
drwxr-xr-x 100/0 0 1970-01-01 00:00 app/js/private/test/image/bin.runfiles/aspect_rules_js/js/private/test/image
-r-xr-xr-x 100/0 23908 1970-01-01 00:00 app/js/private/test/image/bin.runfiles/aspect_rules_js/js/private/test/image/bin
drwxr-xr-x 100/0 0 1970-01-01 00:00 app/js/private/test/image/bin.runfiles/aspect_rules_js/js/private/test/image/bin_
-r-xr-xr-x 100/0 23908 1970-01-01 00:00 app/js/private/test/image/bin.runfiles/aspect_rules_js/js/private/test/image/bin_/bin
drwxr-xr-x 100/0 0 1970-01-01 00:00 app/js/private/test/image/bin.runfiles/aspect_rules_js/js/private/test/image/bin_node_bin
-r-xr-xr-x 100/0 133 1970-01-01 00:00 app/js/private/test/image/bin.runfiles/aspect_rules_js/js/private/test/image/bin_node_bin/node
-r-xr-xr-x 100/0 20 1970-01-01 00:00 app/js/private/test/image/bin.runfiles/aspect_rules_js/js/private/test/image/main.js
5 changes: 3 additions & 2 deletions js/private/test/image/default_app.listing
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@ drwxr-xr-x 0/0 0 1970-01-01 00:00 app/js
drwxr-xr-x 0/0 0 1970-01-01 00:00 app/js/private
drwxr-xr-x 0/0 0 1970-01-01 00:00 app/js/private/test
drwxr-xr-x 0/0 0 1970-01-01 00:00 app/js/private/test/image
-r-xr-xr-x 0/0 131 1970-01-01 00:00 app/js/private/test/image/bin
-r-xr-xr-x 0/0 136 1970-01-01 00:00 app/js/private/test/image/bin
drwxr-xr-x 0/0 0 1970-01-01 00:00 app/js/private/test/image/bin.runfiles
drwxr-xr-x 0/0 0 1970-01-01 00:00 app/js/private/test/image/bin.runfiles/aspect_rules_js
drwxr-xr-x 0/0 0 1970-01-01 00:00 app/js/private/test/image/bin.runfiles/aspect_rules_js/js
drwxr-xr-x 0/0 0 1970-01-01 00:00 app/js/private/test/image/bin.runfiles/aspect_rules_js/js/private
drwxr-xr-x 0/0 0 1970-01-01 00:00 app/js/private/test/image/bin.runfiles/aspect_rules_js/js/private/test
drwxr-xr-x 0/0 0 1970-01-01 00:00 app/js/private/test/image/bin.runfiles/aspect_rules_js/js/private/test/image
-r-xr-xr-x 0/0 23908 1970-01-01 00:00 app/js/private/test/image/bin.runfiles/aspect_rules_js/js/private/test/image/bin
drwxr-xr-x 0/0 0 1970-01-01 00:00 app/js/private/test/image/bin.runfiles/aspect_rules_js/js/private/test/image/bin_
-r-xr-xr-x 0/0 23908 1970-01-01 00:00 app/js/private/test/image/bin.runfiles/aspect_rules_js/js/private/test/image/bin_/bin
drwxr-xr-x 0/0 0 1970-01-01 00:00 app/js/private/test/image/bin.runfiles/aspect_rules_js/js/private/test/image/bin_node_bin
-r-xr-xr-x 0/0 133 1970-01-01 00:00 app/js/private/test/image/bin.runfiles/aspect_rules_js/js/private/test/image/bin_node_bin/node
-r-xr-xr-x 0/0 20 1970-01-01 00:00 app/js/private/test/image/bin.runfiles/aspect_rules_js/js/private/test/image/main.js

0 comments on commit 55c00e3

Please sign in to comment.