-
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
Support for entry points relative to current BUILD file directory #32
Comments
Sorry it took me so long to reply, and thanks for sending a PR for this. I'm concerned about the namespace collisions, as you point out. I think the Note that any build file can use the https://docs.bazel.build/versions/master/skylark/lib/native.html#package_name and You also suggested allowing a label in the entry_point - this is already supported by bazel with special what do you think about that approach? |
Thanks for the response! Apologies about the equally late reply 😛 Great points, and I agree the namespace collision is a major downside of this suggestion. Also wasn't aware of those native.* functions, cool! Shame they can't really be used, so the |
Hi. Right now, folks I talked to are having trouble figuring out how to use entry_point, probably because the instructions are unclear and there is no support for @alexeagle seems to be working on support |
BREAKING CHANGE: This forces us to use workspace-relative paths since the rootpath helper returns this format. Users are now exposed to the external path segment to reference other workspaces. See discussion: bazel-contrib#84 Fixes bazel-contrib#32
Instead of using |
Co-authored-by: @gregmagolan Closes: bazel-contrib#32
Explicitly set/override the users declarationDir setting to suppress *.d.ts files from being emitted in a non-predicatable fashion. Fixes bazel-contrib#32 Closes bazel-contrib#33 PiperOrigin-RevId: 168608369
Explicitly set/override the users declarationDir setting to suppress *.d.ts files from being emitted in a non-predicatable fashion. Fixes bazel-contrib#32 Closes bazel-contrib#33 PiperOrigin-RevId: 168608369
Currently, users provide the full path to a local js file to use it as an entry point, including the workspace name. It's a bit of extra typing, but it's workable.
This gets a bit more cumbersome for nodejs_binary using entry points that aren't at fixed locations e.g. from other rules in macros. (FWIW this isn't an issue for rules e.g.
ctx.workspace_name + "/" + ctx.file.foo.path
, but it's unrelated because rules can't call other rules.)Below is an example: we have an intermediary rule which outputs a js file, and we want the nodejs_binary to use it as an entry point. But the macro doesn't know the path to the js file, so we have to get the user to specify the path.
Proposal
Add the current path to the node module resolver's list of resolve paths.
The above entry point can be changed to a relative path:
Caveats
Files supplied in
data
would clash with node_modules. Convoluted example:Alternatives considered
Change entry_point to be
attr.label
instead of attr.stringRuled out because this would break references to node_modules.
Split entry_point into two attributes, one attr.label for local references, one attr.string for node_modules references
Not as straightforward for users.
Split nodejs_binary into two rules, one for local entry points, one for node_modules entry points
Not as straightforward for users.
The text was updated successfully, but these errors were encountered: