-
Notifications
You must be signed in to change notification settings - Fork 520
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(): remove _repository_args from nodejs_binary #3142
Conversation
Lets remove it out of |
Thinking about the current default which is to add --preserve-symlinks. I think we should just go with the nodejs default of not setting that flag and the releases notes for 5.0 should be for users to add
if they want it set. @alexeagle do you think that would be too breaking? I suppose we'll see how CI is if we flip the default in RNJ. User's would have to do this for all their nodejs_binary, nodejs_test targets. Suggestion in release notes could be to use a defaults macro. If we don't want to flip the default, we'll need to figure out some API to have this thing be on by default outside of the standard There is some precedent with the |
0cebc80
to
938cb3b
Compare
26121d2
to
ab829d1
Compare
I've left "--preserve-symlinks" in for right now to pass the tests. I'll keep trying to get things working with the flag removed and then flip it when that works. |
I think this may be a use case for a custom flag. https://docs.bazel.build/versions/main/configurable-attributes.html#custom-flags So users would |
Great thanks for the recommendation @alexeagle I'll look into using a custom flag |
Hey @alexeagle just wanted to follow up in the example you gave it has these flags living in the nodejs folder. Would these flags still be used in the internal/node/node.bzl and passed along to launcher.sh through template variables. Or is there a different way you were thinking that these flags would be integrated in. |
I would expect the custom flag in the nodejs/ folder like that example, yes. Can then be used in internal/node/node.bzl or anywhere else that wants to reference them |
2982099
to
4d0ffec
Compare
# allowed args ["--preserve-symlinks", ""] | ||
user_args( | ||
name = "default_args", | ||
build_setting_default = "--preserve-symlinks", |
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.
if this is the default, then why did you have to add it explicitly to a bunch of examples? seems wrong, I'd expect the examples not to change, since those illustrate the changes users would have to make as well.
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.
The flags were added to the examples to see how things would work when the default was changed. If we wanted to go with the nodejs default. As mentioned earlier in the comments on the pr. I'm happy to remove them from this pr though and reevaluate when we want to change the default.
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.
I think keeping the default to match what node_repositories() had makes sense for 5.0. We'd want to do some more due diligence before we flip the default.
load("//nodejs/private/providers:user_build_settings.bzl", "UserBuildSettingInfo") | ||
|
||
# this can be used to limit user input for flags and also provide useful error messages for incorrect flags | ||
user_args_allowed = ["--preserve-symlinks", ""] |
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.
I think we should just open this up and let users can set whatever default they want. Guessing they can set a defaults in their .bazelrc file with this improved approach?
a897aed
to
38119c9
Compare
693d79a
to
ce574ba
Compare
docs/Cypress.md
Outdated
@@ -156,6 +156,10 @@ Now you can add `--config=debug` to any `bazel test` command line. | |||
The runtime will pause before executing the program, allowing you to connect a | |||
remote debugger. | |||
|
|||
You can also change the default args that are sent to nodejs. This can be done through a flag. The default is --preserve-symlinks while anything | |||
can be passed. The flag is --@build_bazel_rules_nodejs//nodejs:default_args="" ex: bazel test --@build_bazel_rules_nodejs//nodejs:default_args="test" main |
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.
Lets add a real flag here to better illustrate what it does. Maybe pass two such as
"--preserve-symlinks --no-warnings"
to show that you can pass multiple. A drop a link to https://nodejs.org/api/cli.html for reference.
6fec93b
to
b7c4c32
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.
🌮
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 requires _repository_args and has a dependency on @nodejs
What is the new behavior?
removes the need for @nodejs for _repository_args
Does this PR introduce a breaking change?
Other information