Skip to content

fix(install): dispatch managed bunx through bun x#2151

Open
liangmiQwQ wants to merge 3 commits into
voidzero-dev:mainfrom
liangmiQwQ:liang/codex/fix-bunx-shim
Open

fix(install): dispatch managed bunx through bun x#2151
liangmiQwQ wants to merge 3 commits into
voidzero-dev:mainfrom
liangmiQwQ:liang/codex/fix-bunx-shim

Conversation

@liangmiQwQ

Copy link
Copy Markdown
Collaborator

Close #2123

Managed bunx shims currently execute bun.native without preserving the bunx argv0. Bun then treats bunx <package> as bun <package>, which can recursively invoke a matching package script.

This PR generates the managed bunx shims as bun.native x <args> for sh, Command Prompt, and PowerShell. The managed bun shim remains unchanged.

🤖 Generated with Codex

@netlify

netlify Bot commented Jul 11, 2026

Copy link
Copy Markdown

Deploy Preview for viteplus-preview canceled.

Name Link
🔨 Latest commit 17889e1
🔍 Latest deploy log https://app.netlify.com/projects/viteplus-preview/deploys/6a52327c8214f000080f40ed

@liangmiQwQ

Copy link
Copy Markdown
Collaborator Author

The CI falling should be fixed in #2150.

@liangmiQwQ liangmiQwQ force-pushed the liang/codex/fix-bunx-shim branch from 919ed21 to 686a8f5 Compare July 11, 2026 11:39
@liangmiQwQ

Copy link
Copy Markdown
Collaborator Author

@codex review

@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: 686a8f5f84

ℹ️ 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_install/src/package_manager.rs

/// Refresh an older managed Bun installation without touching its native binary
/// or the separate `bun` wrappers.
async fn refresh_bunx_shim_if_needed(bin_prefix: &AbsolutePath) -> Result<(), Error> {

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Should we add this refresh logic?

  • If we don't add it, the fix won't work for already-installed Bun. (As Codex's review)
  • If we add it, it will be a patch forever, maintaining this may make code not so clean.

@liangmiQwQ

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Hooray!

Reviewed commit: 17889e167e

ℹ️ 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 liangmiQwQ marked this pull request as ready for review July 11, 2026 12:21
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.

Managed Bun toolchain: bunx shim drops argv0 dispatch — bunx <name> behaves as bun <name>, causing infinite self-recursion with common wrapper scripts

1 participant