Skip to content

fix(cli): clean stale global package installs#1945

Merged
fengmk2 merged 5 commits into
voidzero-dev:mainfrom
liangmiQwQ:liang/codex/global-install-stale-cleanup
Jun 25, 2026
Merged

fix(cli): clean stale global package installs#1945
fengmk2 merged 5 commits into
voidzero-dev:mainfrom
liangmiQwQ:liang/codex/global-install-stale-cleanup

Conversation

@liangmiQwQ

Copy link
Copy Markdown
Collaborator

The current global install cleanup only removes the install directory recorded by previous metadata. If a reinstall is interrupted, unrecorded package directories can stay behind, and the legacy empty install-id package directory can also survive.

This PR keeps a file lock for each in-progress global package install directory, then replaces the previous-install cleanup with a same-package stale directory sweep. The sweep skips locked directories so concurrent global installs are protected, and removes both package#installId stale directories and the empty install-id layout.

Related:

🤖 Generated with Codex.

@netlify

netlify Bot commented Jun 25, 2026

Copy link
Copy Markdown

Deploy Preview for viteplus-preview canceled.

Name Link
🔨 Latest commit 828e775
🔍 Latest deploy log https://app.netlify.com/projects/viteplus-preview/deploys/6a3cdf8f522e9300089946ed

@liangmiQwQ

Copy link
Copy Markdown
Collaborator Author

@codex

@chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6f65bd6830

ℹ️ 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".

Comment thread crates/vite_global_cli/src/commands/global/install.rs
@liangmiQwQ

liangmiQwQ commented Jun 25, 2026

Copy link
Copy Markdown
Collaborator Author

Adding hooks in vp upgrade was not chosen at last, cleaning while upgrading sounds odd and this approach might be better.

@liangmiQwQ liangmiQwQ marked this pull request as ready for review June 25, 2026 07:37
@liangmiQwQ liangmiQwQ added test: e2e Auto run e2e tests test: install-e2e run vite install e2e test test: create-e2e Run `vp create` e2e tests test: sfw labels Jun 25, 2026
@liangmiQwQ liangmiQwQ requested a review from fengmk2 June 25, 2026 08:13
@fengmk2 fengmk2 merged commit 1137bbe into voidzero-dev:main Jun 25, 2026
120 of 160 checks passed
@liangmiQwQ liangmiQwQ deleted the liang/codex/global-install-stale-cleanup branch June 25, 2026 08:52
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 test: sfw

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants