-
Notifications
You must be signed in to change notification settings - Fork 68
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
prepare for breaking change in rules_nodejs #126
Conversation
Can we avoid using the patched |
bazel-contrib/rules_nodejs#2125 is going to turn off the patching of the require() function by default. The reason is that it breaks compatibility with many node programs. However rules_sass depends on this, and also has at least conceptual sharing with google3 which uses the patched require() as well. This change is a no-op for rules_nodejs 2.x where the default is true, but is required with rules_nodejs 3.0 where it will be false.
Sure, you could do that. In code I own I'm mostly removing the need for patching it. Generally the purpose of that patching in google3 was to make all programs inherently "runfiles-aware", that is, to provide the "unionfs" view of the filesystem as if the input tree and the output tree were overlaid. To remove the need for patching, you'll have to find places where you rely on this, and instead either
|
I'm guessing your team doesn't have much time to spend on OSS so I'd suggest accepting this PR to preserve the status quo, then remove the need for the patches when you find time. |
Can you file an issue with details on how to fix this going forward? |
Thanks, I appreciate you merging it! I'm not sure exactly where the fix belongs, mostly because the symptom I observed was that the sass compiler was just hanging. I probably could have connected a remote debugger to it so I could see the stack - but maybe it would have been hard to decipher since it's produced from the dart2js codegen. You can repro just by flipping the flag
and then
|
What does the patch do specifically? |
I think it's just this: https://github.com/bazelbuild/rules_nodejs/blob/stable/internal/node/require_patch.js |
bazel-contrib/rules_nodejs#2125 is going to turn off the patching of the require() function by default. The reason is that it breaks compatibility with many node programs. However rules_sass depends on this, and also has at least conceptual sharing with google3 which uses the patched require() as well.
This change is a no-op for rules_nodejs 2.x where the default is true, but is required with rules_nodejs 3.0 where it will be false.