-
Notifications
You must be signed in to change notification settings - Fork 522
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
Remove runfiles. #798
Remove runfiles. #798
Conversation
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.
LGTM. Really nice simplification. Thanks Markus.
My two concerns were:
-
@nodejs//:yarn
,@nodejs//:npm
,@nodejs//:bin/yarn
,@nodejs//:bin/npm
still need to use the/bin/node
&/bin/node.cmd
entry points which still sets the PATH since those code paths don't use the launcher -
RBE still works for nodejs_binary which looks like it will since the node binary is still in runfiles
From the looks of it both are good
Is it safe to remove
filegroup(
name = "node_runfiles",
srcs = [
${nodejsSrcFiles.map(f => `"${NODE_DIR}/${f}",`).join('\n ')}
${yarnSrcFiles.map(f => `"${YARN_DIR}/${f}",`).join('\n ')}
],
)
with this or is there still someone downstream who would use it besides nodejs_binary?
@gregmagolan Yeah I was not sure why anyone would depend on the runfiles downstream - but that is why I left them, because I don't know. But I would be very happy to remove them and we can always bring it back if someone needs them for some reason. |
Done - I kept it in 2 commits. One to address the comment. The other to remove the runfiles. |
6c821bf
to
bf5e1c3
Compare
@alexeagle squashed. |
bf5e1c3
to
bc14303
Compare
I rebased around the merge conflict and force-pushed to your branch, FYI. will merge now if green |
@alexeagle anything blocking this now from getting merged? |
These were removed in [#798][798] which is part of `rules_nodejs` from version 0.31.0 onward. 798: bazel-contrib/rules_nodejs#798
These were removed in [#798][#798] which is part of `rules_nodejs` from version 0.31.0 onward. [#798]: bazel-contrib/rules_nodejs#798
These were removed in [#798][#798] which is part of `rules_nodejs` from version 0.31.0 onward. [#798]: bazel-contrib/rules_nodejs#798
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
Simplifying the setup/build of
nodejs_binary
andnodejs_test
, which simplifies work for Initial Toolchain support #645 and Add NodeJSSourcesInfo provider to allow for better layering in docker rules. #283What is the current behavior?
Every nodejs_binary gets the
_node_runfiles
filegroup added, which adds the real node binary as well as npm, yarn and some other libraries. Further the implicit node binary dependency is a wrapper script which adds the bazel managed node to the PATH.What is the new behavior?
For
nodejs_binary
the wrapper script target was exchanged with the real node binary and the functionality of the wrapper script, setting thePATH
was added to thenode_loader.js
. The runfiles are entirely removed as an implicit dependency as binaries can run fine without these now.These means we only depend on one single file to execute our
nodejs_binary
, that should make things a little faster as less things will need to be symlinked but also reduce size of docker containers for most and it will simplify things for the toolchain PR as now it only has to worry about providing one single file target.Does this PR introduce a breaking change?
People that depended on the fact that yarn or node was included as an implicit dependency would now have to add
@nodejs//:node_runfiles
explicitely to their data dependencies.