-
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
feat: create symlink for build files present on node modules installed with relative paths #2330
feat: create symlink for build files present on node modules installed with relative paths #2330
Conversation
Awesome, this looks good to me. Thanks! I think I agree that no one really should rely on the current behavior but @gregmagolan added that and has a better memory than I do. |
This looks great. I read through the issue and the code and agree that this is the right thing to do if the node_module is a symlink to inside the workspace. It's a clever way to consume 1st party deps. The only thing I'd add is to update the yarn_install & npm_install docs to document this feature & the reasoning. As an aside, why use this method instead of |
@gregmagolan Thanks for reviewing this as you are one of the few people well positioned and with enough knowledge to validate the idea. Regarding your question, |
@alexeagle I've also added some content both to the I've also squashed the commits into a single one with a meaningful commit message for the feature. |
… installed with relative paths test(builtin): test setup attempt for support local linked packages chore(builtin): format fix chore(builtin): format fix chore(builtin): format fix chore(builtin): put back unintended changes test(builtin): correct test implementation feat(builtin): include warning log about not found build file chore(builtin): use specific workspace on local-module one for each package manager fix(builtin): only symlink package if it is inside the workspace chore(builtin): add note about corner case as suggested in the pr review docs(builtin): add docs for new behaviour on npm_install and yarn_install rules
06c2e2f
to
ea599a5
Compare
I'm still not sure this use case of bazel -> bazel dependency makes sense, even given your problem description I still think you should have a |
…local-linked-modules-3.x
…local-linked-modules-3.x
All (the pull request submitter and all commit authors) CLAs are signed, but one or more commits were authored or co-authored by someone other than the pull request submitter. We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that by leaving a comment that contains only Note to project maintainer: There may be cases where the author cannot leave a comment, or the comment is not properly detected as consent. In those cases, you can manually confirm consent of the commit author(s), and set the ℹ️ Googlers: Go here for more info. |
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?
Currently if a local module installed with npm contains a BUILD file we generate the usual BUILD file content and just append the one found on the BUILD file.
Issue Number: #2131
What is the new behavior?
With this PR the BUILD file inside an installed local module will be symlinked instead of generated and get its content appended.
Does this PR introduce a breaking change?
It is really unlikely that the current behaviour is being useful to someone who relies on having a BUILD file in a local installed npm module as it introduces a race condition. However, the migration path would be to rewrite their BUILD files inside such modules to contain the expected generated targets by npm_install/yarn_install rules like
*-module__contents
or*--module__files
and also add the extra targets they have previously defined on the BUILD file.HINT: In order to don't have to manually writ
*-module__contents
or*--module__files
we can remove the BUILD file, run the npm_install/yarn_install rules and just grasp the generated BUILD file content.Other information