-
-
Notifications
You must be signed in to change notification settings - Fork 30
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: add helper plugin to keep paths within sandbox #160
Conversation
@thesayyn and I discussed this and overall agree with what you're suggesting. I think this should be setup 100% of the time by the launcher like you said. In one sense it would be nice to avoid more node since one of the main advantages of esbuild is the use of go, but when we're already launching esbuild from node I don't think this adds any harm (we're not adding another node process being launched etc). |
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.
Thanks for the review. I attempted an initial stab at integrating it with launcher.js
, but not very sure if I did it in an acceptable way (or fully if it works yet).
I agree that I'd prefer this work within esbuild instead, and while I was hesitant to add a JS resolver call for every single resolution call, having the assurance that it plays better with the sandbox seemed worthwhile.
@vpanta seeing the sandbox issue again reminded me of this PR... did you have a chance to look at the latest comments or have any other updates? |
shoot, sorry, I spaced on this PR. Let me see what I can do with it today. |
ugh, sorry again, it's been a crazy time but I am actively working on this PR right now and am hoping to settle it this week. |
c160e57
to
f60de04
Compare
Ok, the examples are all compiling and I've verified the plugin is being used, so I think this is good for review again. |
…bug logs and the ability to set the JS and esbuild log levels
@vpanta I pushed a few changes and updated the description to get this ready for landing |
3f9a4ab
to
cfc9004
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.
🚀
Big thanks @gregmagolan to getting this over the line! |
Fixes #58.
Adds a "bazel-sandbox" helper plugin when using Esbuild under Bazel.
It is on by default but can be opted-out by setting
bazel_sandbox_plugin = False
on anesbuild
target.This PR also adds
js_log_level
andesbuild_log_level
attributes. Whenjs_log_level
isdebug
, the bazel-sandbox plugin will print out resolution changes it makes.Type of change
For changes visible to end-users
Addition of an automatic plugin ensuring esbuild resolution remains within the sandbox.
Test plan
Manually tested changing log levels and disabling the new plugin by setting
bazel_sandbox_plugin = False
. A follow-up with more testing for this plugin would be good.