-
-
Notifications
You must be signed in to change notification settings - Fork 109
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
feat: add patch_node_fs attribute to js_binary and js_run_binary for easy opt-out #281
Conversation
4537e58
to
fe09ce8
Compare
fe09ce8
to
0ef1115
Compare
0ef1115
to
eb8cc7c
Compare
@@ -168,6 +168,19 @@ _ATTRS = { | |||
values = _LOG_LEVELS.keys(), | |||
default = "error", | |||
), | |||
"patch_node_fs": attr.bool( |
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.
Should we try to put the word "sandbox" in the name since "patch" normally implies a bug-fix?
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.
sandbox wouldn't be accurate either since the guards prevent leaving execroot, runfiles and the sandbox. I create a pretty verbose docstring on this one. most users will never need to touch it but it does leave an easy opt-out if needed.
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.
node_fs_guards
perhaps but I like "patch" as it is technically what we are doing by changing the behavior of the node fs code
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 guess I'd worry that fs
will become overloaded and will mean patching a lot more then the node "fs" library like the name implies 🤷
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.
Hopefully we won't be patching much more in node so we won't to worry about it :)
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.
🐒 -patch
@@ -168,6 +168,19 @@ _ATTRS = { | |||
values = _LOG_LEVELS.keys(), | |||
default = "error", | |||
), | |||
"patch_node_fs": attr.bool( |
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 child process patch will also have a flag? patch_node_child_process
?
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 the child process fs patches should just be implied if this is true since they are the same fs patches applied to spawn processes; just more a more robust implementation that covers the child spawn case when we get to it for 1.1
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.
Ah yeah, you're correct... it's the same patches but just properly applied to sub-processes as well
No description provided.