FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

fix(global): preflight managed install bin conflicts by liangmiQwQ · Pull Request #1773 · voidzero-dev/vite-plus · GitHub

fix(global): preflight managed install bin conflicts - #1773

Closed
liangmiQwQ wants to merge 15 commits into
voidzero-dev:mainfrom
liangmiQwQ:codex/fix-global-install-bin-conflicts
Closed

fix(global): preflight managed install bin conflicts#1773
liangmiQwQ wants to merge 15 commits into
voidzero-dev:mainfrom
liangmiQwQ:codex/fix-global-install-bin-conflicts

Conversation

liangmiQwQ commented Jun 6, 2026
edited
Loading

Copy link
Copy Markdown
Collaborator

Close #1770

The current managed global install path uses a package-directory backup to recover from binary ownership conflicts after npm has already installed the package. According to #1770. That move-based backup logic can sometimes delete the package, like process kill or SIGINT.

This PR resolves managed bin conflicts before running npm install, then lets npm install directly into the final package prefix. It completely removes the backup logic and avoids potential problems. However, it may slightly reduce the installation speed (won't influence global update).

There is some behavior changes

  1. If users run vp install -g pkga pkgb --force, while pkga and pkgb have the same bin name, even if --force flag, it will still report error. The original behavior (install both of them, and uninstall the earlier one) can be a little bit odd and inefficient after this change, since we can get the package's bins before any installation. I believe this helps simplify the implementation and ensures the transparency and semantics of --force.
  2. Vite+ won't run the rest of packages' installation if there is a package not found. This is because the package's status can be known while checking bins, if we simply ignore npm view's error, network errors may cause bin overlapping issues.

🤖 Generated with Codex

netlify Bot commented Jun 6, 2026
edited
Loading

Copy link
Copy Markdown

Deploy Preview for viteplus-preview canceled.

Name Link
🔨 Latest commit 836c47d
🔍 Latest deploy log https://app.netlify.com/projects/viteplus-preview/deploys/6a255a36eecf890008fad7fc

liangmiQwQ marked this pull request as ready for review June 6, 2026 09:55

Copy link
Copy Markdown
Collaborator Author

@codex

chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: eb813a593b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

liangmiQwQ marked this pull request as draft June 6, 2026 10:45

Copy link
Copy Markdown
Collaborator Author

@codex

chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8bf4974b91

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

liangmiQwQ marked this pull request as ready for review June 6, 2026 12:46

Copy link
Copy Markdown
Collaborator Author

@codex

chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3889d4eea8

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

fengmk2 added test: e2e Auto run e2e tests test: install-e2e run vite install e2e test test: create-e2e Run `vp create` e2e tests labels Jun 6, 2026

fengmk2 commented Jun 6, 2026

Copy link
Copy Markdown
Member

@codex review

chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 79eedb120c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

liangmiQwQ commented Jun 6, 2026
edited
Loading

Copy link
Copy Markdown
Collaborator Author

For now, based on Codex's review suggestions, I don't think this is and there is a completely effective and feasible solution that can ensure all packages can be runnable for reinstall due to npm limitation or system IO performance (#1770). Changes like this PR just make the problem happen in different conditions that is not much meaningful. I also made some local attempts, but I really didn't come up with any good ideas. So based on that, maybe keeping the backup logic will be better?

liangmiQwQ marked this pull request as draft June 7, 2026 12:06

Copy link
Copy Markdown
Collaborator Author

@fengmk2 thanks for reviewing, but considering what I laid out in #1773 (comment), this PR just moves the problem rather than solving it, I suggest closing it and keeping the current behavior.

I will be kind of busy in the next two weeks, but I am still thinking about a way which can completely resolve this problem. I believe it would be better to revisit this later rather than merge a solution that doesn't really address the root cause ❤️

liangmiQwQ closed this Jun 7, 2026
liangmiQwQ deleted the codex/fix-global-install-bin-conflicts branch June 7, 2026 12:29

fengmk2 commented Jun 7, 2026

Copy link
Copy Markdown
Member

@liangmiQwQ No problem, good luck on your exam! 💯

fengmk2 added a commit that referenced this pull request Jun 25, 2026
The global package reinstall flow introduced by #1698 installs into the
final prefix, but it first moves the active prefix to a backup. An
interruption can leave the installed package unavailable, and the
approaches explored in #1770 and #1773 trade that failure mode for other
windows where bins can still break.

This PR adds an install ID to managed package metadata. Each install now
writes directly to a sibling prefix such as `packages/<name>#<uuid>`,
then activates that immutable directory by saving metadata after npm
succeeds. The ID is a standard UUID v4 prefixed with `#`, which is
filesystem-safe but invalid in npm package names. Binary dispatch, `vp
env which`, `vpx`, and global outdated output resolve the active
directory from metadata, so no installed prefix is moved.

Metadata without `installId`, or with an empty value, continues to
resolve `packages/<name>` for compatibility with existing installations.
A successful reinstall deletes only the installation it directly
replaced. Cleanup of any older interrupted-install directories through
`vp upgrade` is intentionally left to a follow-up PR.

🤖 Generated with Codex

---------

Signed-off-by: Liang <github@liangmi.dev>
Co-authored-by: MK (fengmk2) <fengmk2@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

test: create-e2e Run `vp create` e2e tests test: e2e Auto run e2e tests test: install-e2e run vite install e2e test

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants


Back | FazBrowse Home | New Git URL