rules_nodejs icon indicating copy to clipboard operation
rules_nodejs copied to clipboard

test(builtin): test showing duplicate module load when using workspace root

Open joeljeske opened this issue 4 years ago • 2 comments

This PR is a test case showing a bug in the linker when using link_workspace_root.

PR Checklist

Please check if your PR fulfills the following requirements:

  • [X] Tests for the changes have been added (for bug fixes / features)
  • [ ] Docs have been added / updated (for bug fixes / features)

PR Type

What kind of change does this PR introduce?

  • [ ] Bugfix
  • [ ] Feature (please, look at the "Scope of the project" section in the README.md file)
  • [ ] Code style update (formatting, local variables)
  • [ ] Refactoring (no functional changes, no api changes)
  • [ ] Build related changes
  • [ ] CI related changes
  • [ ] Documentation content changes
  • [ ] Other... Please describe:

What is the current behavior?

When using link_workspace_root = True, any file that is loaded using the root import link will see a difference node_modules. This means that the same node_modules are available but at a different path, thus asking node to load the library twice. This is a bug not just for performance, but that many libraries require the same module being used and not multiple copies due to state management, etc...

What is the new behavior?

This bug should be fixed. I am not sure of the best strategy as I am not very familiar with the linker internals

Does this PR introduce a breaking change?

  • [ ] Yes
  • [X] No

Other information

joeljeske avatar Mar 07 '22 02:03 joeljeske

Looks same or adjacent to bugs @gregmagolan is planning to track down soon

alexeagle avatar Mar 20 '22 14:03 alexeagle

This Pull Request has been automatically marked as stale because it has not had any activity for 6 months. It will be closed if no further activity occurs in 30 days. Collaborators can add a "cleanup" or "need: discussion" label to keep it open indefinitely. Thanks for your contributions to rules_nodejs!

github-actions[bot] avatar Sep 20 '22 03:09 github-actions[bot]

This PR was automatically closed because it went 30 days without any activity since it was labeled "Can Close?"

github-actions[bot] avatar Oct 21 '22 03:10 github-actions[bot]