-
-
Notifications
You must be signed in to change notification settings - Fork 114
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
[Bug]: Dependency aliases of transitive dependencies are not working #1062
Comments
Have a repro here, #1063. Working on a fix. |
Hmm. It is a tricky one and more than an hour of work. I think this one will have to wait until next week when either @jbedard or I have more time. |
Notes from repro in #1063... In
The transitive closure is calculated wrong from the looks of it, it should likely be:
Although even then I think there will also be fixed needed in
|
cc @jbedard |
The other key observation is that this issue ONLY happens when the package name in the pnpm lock file starts with
which only happens when the When
with the aliases clearly distinguishable and rules_js correctly handles this default case. The generated
and the deps, lc_deps and ref_deps look like this,
|
@devversion This is a potential work-around for the material repository: https://github.com/angular/material.angular.io/pull/1208/files |
@gregmagolan Thanks for the investigation. So based on that, to me it sounds like the registry prefixes are currently just throwing off the logic, but in practice- with both variants (with registry prefix, or not), the aliases should be distinguishable, right? e.g. with prefixes
without prefix
|
Essentially, yes. The logic breaks for the aliases somewhere along the way with the |
FYI that team members often run into issues, even with the workaround, because |
I think this may have been fixed with various lockfile cleanup/fixes. @devversion any idea if you're still running into this issue? |
What happened?
Consider you are using a project that has a direct dependency on
A
. WhereA
then has a dependency onB
, but the package is aliased to e.g.alias
. e.g.rules_js
will properly configure the store target forcliui
to look forstring-width-cjs
as a store dependency. But the store target with the aliased name does actually not exist.This causes errors like:
Version
Linux amd64. Rules_JS rules_js-1.20.1. Bazel 5.1.0. A team member also tried with the latest version.
How to reproduce
No response
Any other information?
Looking into it without diving too much into implementation, the issue seems to be that
pnpm_lock_file.packages()
is used to create the store entries. But this never holds the aliased package names. i.e.rules_js
iterates through thepackages:
entry in the lock file and then creates store entries for those.There will never be an entry with the alias though because the alias name will only ever appear in the
dependencies
section of an entry. The transitive closure detection already has access to this information.Likely we could use that to compile a more precise list of
packages
that will then be usedto create the links.
The text was updated successfully, but these errors were encountered: