-
Notifications
You must be signed in to change notification settings - Fork 519
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
fix: fix nodejs_binary cross-platform RBE issue #1305 #1320
Conversation
95ab983
to
0743693
Compare
cce1e08
to
e016ed0
Compare
7d9531c
to
edbd128
Compare
internal/node/node_launcher.sh
Outdated
Darwin*) machine=darwin;; | ||
CYGWIN*) machine=windows;; | ||
MINGW*) machine=windows;; | ||
MSYS_NT*) machine=windows;; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sigh, when we introduce a batch/powershell version of the launcher we'll have to pick through this logic again
4d0eef1
to
09446d7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need more error handling in the case fallthrough
afc1a95
to
d8dfa36
Compare
Done |
d8dfa36
to
d93fb4d
Compare
* patch for build_bazel_rules_nodejs from bazel-contrib/rules_nodejs#1320 * patch for @bazel/protractor from bazel-contrib/rules_nodejs#1320 * work-around for rules_webtesting cross-platform RBE issues
* patch for build_bazel_rules_nodejs from bazel-contrib/rules_nodejs#1320 * patch for @bazel/protractor from bazel-contrib/rules_nodejs#1320 * work-around for rules_webtesting cross-platform RBE issues
* patch for build_bazel_rules_nodejs from bazel-contrib/rules_nodejs#1320 * patch for @bazel/protractor from bazel-contrib/rules_nodejs#1320 * work-around for rules_webtesting cross-platform RBE issues
* patch for build_bazel_rules_nodejs from bazel-contrib/rules_nodejs#1320 * patch for @bazel/protractor from bazel-contrib/rules_nodejs#1320 * work-around for rules_webtesting cross-platform RBE issues
* patch for build_bazel_rules_nodejs from bazel-contrib/rules_nodejs#1320 * patch for @bazel/protractor from bazel-contrib/rules_nodejs#1320 * work-around for rules_webtesting cross-platform RBE issues
fda9c34
to
f68d6f4
Compare
* patch for build_bazel_rules_nodejs from bazel-contrib/rules_nodejs#1320 * patch for @bazel/protractor from bazel-contrib/rules_nodejs#1320 * work-around for rules_webtesting cross-platform RBE issues
b7e1030
to
e49745e
Compare
* patch for build_bazel_rules_nodejs from bazel-contrib/rules_nodejs#1320 * patch for @bazel/protractor from bazel-contrib/rules_nodejs#1320 * work-around for rules_webtesting cross-platform RBE issues
e49745e
to
92d269d
Compare
* patch for build_bazel_rules_nodejs from bazel-contrib/rules_nodejs#1320 * patch for @bazel/protractor from bazel-contrib/rules_nodejs#1320 * work-around for rules_webtesting cross-platform RBE issues
92d269d
to
1172135
Compare
.bazelci/presubmit.yml
Outdated
build_flags: | ||
- "--platforms=@build_bazel_rules_nodejs//toolchains/node:darwin_amd64" | ||
build_targets: | ||
- "//..." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
feels really expensive to re-build everything in each configuration. I wonder if we are using more CI resources than any other rules
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we do have quite a few jobs now. it's probably not strictly necessary to build in every permutation but I think at the least we should build everything or some subset of everything with each platform.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe just //internal/...
is sufficient to get the coverage we need?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 that should do it for now as only node_binary/node_test vary the build based on platform. We can expand coverage in the future if some of the packages with build differences based on platform.
readonly node=$(rlocation "${vendored_node}") | ||
|
||
if [ ! -f "${node}" ]; then | ||
printf "\n>>>> FAIL: The vendored node binary '${vendored_node}' not found in runfiles. <<<<\n\n" >&2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will users know what to do with this error?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It shouldn't happen as the vendored_node binary should be added to runfiles by nodejs_binary... but in the case where there is a bug or something unexpected happens better to have a semi-helpful error message & graceful exit than a crash.
A bit hacky but the issue can be reproduced in run_targets in bazelci. There doesn’t seem to be a run_flags to pass —config=remote so I used shell_commands to set the --platform to linux in a new mac_fake_rbe job on buildkite. This sets up the same scenario where the build with --platform linux selected (as it would be on RBE) but the resulting nodejs_binary runnable target is run on osx.
6461dad
to
d341869
Compare
* node_launcher.sh now picks the node binary at runtime instead of it being a templated arg evaluated at build time * node_binary now adds the correct node tool_files to the nodejs_binary runfiles Fixes bazel-contrib#1305 fix: node
d341869
to
4f9a00d
Compare
…unfiles for the host platform Runfiles are no longer tested as what should be tested is that ctx.toolchains["@build_bazel_rules_nodejs//toolchains/node:toolchain_type"].nodeinfo.tool_files are for the correct `--platform`.
4f9a00d
to
b0b638d
Compare
This release includes nodejs cross-platform RBE fix in bazel-contrib/rules_nodejs#1320 and adds `args` to terser_minified in bazel-contrib/rules_nodejs#1317. These changes are needed to land a few outstanding PRs. * build: fixes for cross-platform RBE angular#33708 * build: update zone.js to use the new rollup_bundle angular#33329
This release includes nodejs cross-platform RBE fix in bazel-contrib/rules_nodejs#1320 and adds `args` to terser_minified in bazel-contrib/rules_nodejs#1317. These changes are needed to land a few outstanding PRs. * build: fixes for cross-platform RBE angular#33708 * build: update zone.js to use the new rollup_bundle angular#33329
This release includes nodejs cross-platform RBE fix in bazel-contrib/rules_nodejs#1320 and adds `args` to terser_minified in bazel-contrib/rules_nodejs#1317. These changes are needed to land a few outstanding PRs. * build: fixes for cross-platform RBE angular#33708 * build: update zone.js to use the new rollup_bundle angular#33329 fix: fix
This release includes nodejs cross-platform RBE fix in bazel-contrib/rules_nodejs#1320 and adds `args` to terser_minified in bazel-contrib/rules_nodejs#1317. These changes are needed to land a few outstanding PRs. * build: fixes for cross-platform RBE angular#33708 * build: update zone.js to use the new rollup_bundle angular#33329 fix: fix
This release includes nodejs cross-platform RBE fix in bazel-contrib/rules_nodejs#1320 and adds `args` to terser_minified in bazel-contrib/rules_nodejs#1317. These changes are needed to land a few outstanding PRs. * build: fixes for cross-platform RBE #33708 * build: update zone.js to use the new rollup_bundle #33329 fix: fix PR Close #33802
This release includes nodejs cross-platform RBE fix in bazel-contrib/rules_nodejs#1320 and adds `args` to terser_minified in bazel-contrib/rules_nodejs#1317. These changes are needed to land a few outstanding PRs. * build: fixes for cross-platform RBE #33708 * build: update zone.js to use the new rollup_bundle #33329 fix: fix PR Close #33802
* patch for build_bazel_rules_nodejs from bazel-contrib/rules_nodejs#1320 * patch for @bazel/protractor from bazel-contrib/rules_nodejs#1320 * work-around for rules_webtesting cross-platform RBE issues
First commit reproduces #1305.
Repo here: https://buildkite.com/bazel/rules-nodejs-nodejs/builds/4727#5a880596-2b15-49a3-947c-a7b2894f6cca from #1324.
A bit hacky but the issue can be reproduced in run_targets in bazelci. There doesn’t seem to be a run_flags to pass
—config=remote
so I used shell_commands to set the--platform
to linux in a newmac_fake_rbe
job on buildkite. This sets up the same scenario where the build with --platform linux selected (as it would be on RBE) but the resulting nodejs_binary runnable target is run on osx.2nd commit fixes the issue.
3rd commit updates the nodejs toolchain test to no longer test for runfiles. What should be tested is that
ctx.toolchains["@build_bazel_rules_nodejs//toolchains/node:toolchain_type"].nodeinfo.tool_files
are for the correct selected--platform
.Fixes #1305.
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
nodejs_binary does not work with cross-platform RBE. For example, developer machine is osx and RBE is a linux box
What is the new behavior?
nodejs_binary works with cross-platform RBE
Does this PR introduce a breaking change?
Other information