Skip to content

fix(cli): Prefer npm bin entries provided by packages closer to the root #24024

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

Merged
merged 8 commits into from
May 30, 2024

Conversation

nathanwhit
Copy link
Member

Fixes #24012.

In the case of multiple packages providing a binary with a same name, we were basically leaving the results undefined (since we set up things in parallel, and whichever got set up first won). In addition, we were warning about these cases, even though it's a situation that's expected to occur.

Instead, in the case of a collision in the binary names, we prefer the binary provided by the package with the least depth in the dependency tree.

While I was at it, I also took moved more code to bin_entries.rs since it was starting to get a bit cluttered.

Copy link
Contributor

@marvinhagemeister marvinhagemeister left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested and confirmed that warnings in the reproduction case aren't showing up anymore 👍

Copy link
Member

@dsherret dsherret left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@nathanwhit nathanwhit merged commit a379009 into denoland:main May 30, 2024
17 checks passed
@nathanwhit nathanwhit deleted the bin_entries_prefer_direct branch May 30, 2024 00:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug: deno install produces warnings for packages it installed itself
3 participants