-
-
Notifications
You must be signed in to change notification settings - Fork 168
fix: allow js_run_binary to hoist runfiles in the exec configuration #2809
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
Changes from 1 commit
bb975a4
34f9e68
3873c45
adac4ad
4d6f900
2e0deee
49a6e78
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 |
|---|---|---|
|
|
@@ -19,7 +19,7 @@ bazel_dep(name = "rules_nodejs", version = "6.7.3") | |
|
|
||
| # Changes ensured by rules_js: | ||
| # 3.2.2: https://github.com/bazel-contrib/bazel-lib/commit/cac2d7855949d1b222fa26888892fbbe1d31015d | ||
|
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. Add a comment just like this for the reason we need 3.3.0? |
||
| bazel_dep(name = "bazel_lib", version = "3.2.2") | ||
| bazel_dep(name = "bazel_lib", version = "3.3.1") | ||
|
|
||
| # NB: LOWER BOUND on earliest BCR release of protobuf module, to avoid upgrading the root module by accident | ||
| bazel_dep(name = "protobuf", version = "3.19.6") | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -97,10 +97,18 @@ function logf_debug { | |
|
|
||
| function resolve_execroot_bin_path { | ||
| local short_path="$1" | ||
| local suffix | ||
| if [[ "$short_path" == ../* ]]; then | ||
| echo "$JS_BINARY__EXECROOT/${BAZEL_BINDIR:-$JS_BINARY__BINDIR}/external/${short_path:3}" | ||
| suffix="external/${short_path:3}" | ||
|
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. Can we just modify |
||
| else | ||
| echo "$JS_BINARY__EXECROOT/${BAZEL_BINDIR:-$JS_BINARY__BINDIR}/$short_path" | ||
| suffix="$short_path" | ||
| fi | ||
| local exec_path="$JS_BINARY__EXECROOT/$JS_BINARY__BINDIR/$suffix" | ||
| local target_path="$JS_BINARY__EXECROOT/${BAZEL_BINDIR:-$JS_BINARY__BINDIR}/$suffix" | ||
| if [ -e "$exec_path" ]; then | ||
| echo "$exec_path" | ||
| else | ||
| echo "$target_path" | ||
| fi | ||
| } | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -117,12 +117,12 @@ js_test( | |
| # TEST: js_test(data = js_run_binary(srcs)) --------------- | ||
| js_run_binary( | ||
| name = "run-write-srcs", | ||
| srcs = ["data.json"], | ||
|
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. This was essentially an undeclared input before, but magically worked because the
Contributor
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. Yes, that's right. With the new option enabled and without this line adding the dep via
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. That sounds correct to me 👍 |
||
| outs = ["rb0.json"], | ||
| args = [ | ||
| "rb0.json", | ||
| "data.json", | ||
| "$(rootpath rb0.json)", | ||
| "$(rootpath data.json)", | ||
| ], | ||
| chdir = package_name(), | ||
|
acozzette marked this conversation as resolved.
|
||
| tool = ":write-js_library-srcs", | ||
| ) | ||
|
|
||
|
|
@@ -142,12 +142,12 @@ js_test( | |
| # TEST: js_test(data = js_run_binary(srcs = js_library(srcs))) ---------------- | ||
| js_run_binary( | ||
| name = "run-write-js_library-srcs", | ||
| srcs = ["data.json"], | ||
| outs = ["rb1.json"], | ||
| args = [ | ||
| "rb1.json", | ||
| "data.json", | ||
| "$(rootpath rb1.json)", | ||
| "$(rootpath data.json)", | ||
| ], | ||
| chdir = package_name(), | ||
| tool = ":write-js_library-srcs", | ||
| ) | ||
|
|
||
|
|
@@ -174,12 +174,12 @@ js_binary( | |
|
|
||
| js_run_binary( | ||
| name = "run-write-js_library-data", | ||
| srcs = ["data.json"], | ||
| outs = ["rb2.json"], | ||
| args = [ | ||
| "rb2.json", | ||
| "data.json", | ||
| "$(rootpath rb2.json)", | ||
| "$(rootpath data.json)", | ||
| ], | ||
| chdir = package_name(), | ||
| tool = ":write-js_library-data", | ||
| ) | ||
|
|
||
|
|
@@ -199,12 +199,12 @@ js_test( | |
| # TEST: js_test(data = js_run_binary(srcs = genrule())) ----------------------- | ||
| js_run_binary( | ||
| name = "run-write-generated", | ||
| srcs = ["data-generated.json"], | ||
| outs = ["rb3.json"], | ||
| args = [ | ||
| "rb3.json", | ||
| "data-generated.json", | ||
| "$(rootpath rb3.json)", | ||
| "$(rootpath data-generated.json)", | ||
| ], | ||
| chdir = package_name(), | ||
| tool = ":write-genrule", | ||
| ) | ||
|
|
||
|
|
@@ -224,12 +224,12 @@ js_test( | |
| # TEST: js_test(data = js_run_binary(srcs = genrule(srcs = filegroup))) ------- | ||
| js_run_binary( | ||
| name = "run-write-generated-copied", | ||
| srcs = ["data-copied.json"], | ||
| outs = ["rb4.json"], | ||
| args = [ | ||
| "rb4.json", | ||
| "data-copied.json", | ||
| "$(rootpath rb4.json)", | ||
| "$(rootpath data-copied.json)", | ||
| ], | ||
| chdir = package_name(), | ||
| tool = ":write-genrule-filegroup-srcs", | ||
| ) | ||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.