Skip to content

fix: invoke Bun package exec via bun x on Windows - #104

Merged
kjanat merged 3 commits into
masterfrom
103-windows-unlisted-command-fails-bunx
Aug 3, 2026
Merged

fix: invoke Bun package exec via bun x on Windows#104
kjanat merged 3 commits into
masterfrom
103-windows-unlisted-command-fails-bunx

Conversation

@kjanat

@kjanat kjanat commented Aug 3, 2026

Copy link
Copy Markdown
Owner

Summary

  • invoke Bun package-exec fallback through the explicit bun x subcommand instead of the bunx hard-link alias
  • preserve forced Bun runtime behavior as bun x --bun
  • update dispatch labels, documentation, schema text, and regression tests

Why

On Windows, runner resolves executables through PATH and PATHEXT. The standard uppercase .EXE entry can produce bunx.EXE; released Bun versions classify the invocation name case-sensitively and treat that spelling as plain bun, resulting in error: Script not found for an otherwise valid package.

Using bun x avoids depending on alias-name detection and keeps runner compatible with released Bun versions even if the upstream fix lands later.

Fixes #103

Upstream: oven-sh/bun#36826 and oven-sh/bun#36827

Validation

  • cargo fmt --check
  • cargo test tool::bun::tests — 8 passed
  • cargo test exec_uses_each_runtimes_own_primitive — passed
  • cargo test --test runtime_override runtime_selects_the_exec_fallback_primitive — passed
  • manual Windows reproduction in shoppingmall: patched runner prints → bun x sort-package-json --version, returns exit 0, and reports sort-package-json 4.0.0

A full Windows cargo test run reached 975 passed / 36 failed. The remaining failures are outside this Bun path and are dominated by existing Windows assumptions around absolute resolved executable paths, Unix-style file URIs, and temporary Git commits.

@kjanat kjanat linked an issue Aug 3, 2026 that may be closed by this pull request
@coderabbitai

coderabbitai Bot commented Aug 3, 2026

Copy link
Copy Markdown

Review Change Stack

Important

Review skipped

Auto reviews are limited based on label configuration.

🏷️ Required labels (at least one) (1)
  • cr:review
🚫 Excluded labels (none allowed) (2)
  • wip
  • cr:skip

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 318433bb-87b8-4eb5-be09-6fbd9f810acf

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
📝 Walkthrough

Use bun x for Bun package execution

Replace bunx fallback invocations with the explicit bun x subcommand, including forced Bun execution with bun x --bun. This fixes Windows failures where bunx.EXE is treated as bun and produces Script not found.

Update related labels, documentation, schema text, and regression tests. Validate formatting, targeted tests, and Windows execution of sort-package-json.

Walkthrough

The Bun package-execution path now invokes bun x instead of the bunx alias. Forced Bun execution retains the --bun argument. Tests validate executable names and argument ordering. Documentation, help text, schemas, comments, and the changelog now use the updated command.

Estimated code review effort: 2 (Simple) | ~10 minutes

Sequence Diagram(s)

sequenceDiagram
  participant RunCommand
  participant BunTool
  participant Bun
  RunCommand->>BunTool: request package execution
  BunTool->>Bun: invoke `bun x` with package arguments
  BunTool->>Bun: add `--bun` when forced
  Bun-->>BunTool: execute package
Loading

Possibly related PRs

  • kjanat/runner#21: Both changes update Bun command execution and include Windows-specific handling.
  • kjanat/runner#75: Both changes update Bun execution handling, but this PR changes package execution.
  • kjanat/runner#92: Both changes update Bun package execution in the run dispatch path.

Suggested labels: bug, documentation, area: cli

Poem

Bunx sailed out with a Windows frown,
bun x now steers the command down.
Tests check stems and arguments bright,
Docs match the path, precise and right.
Hoist the fix, matey—smooth execution tonight!

🚥 Pre-merge checks | ✅ 7 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Semver Version Bump Validation ⚠️ Warning Rust source files contain functional changes, but Cargo.toml remains 0.24.0 in both HEAD~1 and HEAD; no version bump is present. Update the package version in Cargo.toml from 0.24.0 to 0.24.1 for this bug fix, and include that change in the pull request.
✅ Passed checks (7 passed)
Check name Status Explanation
Title check ✅ Passed The title uses the required fix prefix, stays concise, and clearly describes the Bun Windows invocation change.
Description check ✅ Passed The description clearly explains the Windows failure, the bun x fix, affected documentation, tests, and validation results.
Linked Issues check ✅ Passed The changes address issue [#103] by replacing bunx with bun x for Windows-safe package execution and adding regression coverage.
Out of Scope Changes check ✅ Passed The code, documentation, schema, and test updates directly support the Bun invocation fix and contain no unrelated changes.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 30.00%.
Changelog Update ✅ Passed Source files changed, and CHANGELOG.md adds a descriptive Fixed entry under ## [Unreleased]. No version bump is present in the PR diff.
Agents.Md Documentation Updated ✅ Passed No AGENTS.md file exists anywhere in the repository, so the check's prerequisite for a mandatory update is not met.

Comment @coderabbitai help to get the list of available commands.

@kjanat kjanat self-assigned this Aug 3, 2026
@kjanat kjanat added the cr:review Allow CodeRabbit review label Aug 3, 2026
@coderabbitai coderabbitai Bot added area: cli Argument parsing, commands, and CLI UX bug Something isn't working documentation Improvements or additions to documentation labels Aug 3, 2026
coderabbitai[bot]

This comment was marked as resolved.

@kjanat kjanat added cr:skip Skip CodeRabbit review and removed cr:review Allow CodeRabbit review labels Aug 3, 2026
@kjanat
kjanat force-pushed the 103-windows-unlisted-command-fails-bunx branch from 3cb322e to 62491c3 Compare August 3, 2026 15:05
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Aug 3, 2026

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
runner 29387b5 Commit Preview URL Aug 03 2026, 03:51 PM

Comment thread CHANGELOG.md
Comment thread CHANGELOG.md
Comment thread CHANGELOG.md Outdated
Comment thread CHANGELOG.md Outdated
@kjanat
kjanat force-pushed the 103-windows-unlisted-command-fails-bunx branch from 62491c3 to 29387b5 Compare August 3, 2026 15:48
@kjanat
kjanat merged commit 71d87ea into master Aug 3, 2026
9 checks passed
@kjanat
kjanat deleted the 103-windows-unlisted-command-fails-bunx branch August 3, 2026 15:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: cli Argument parsing, commands, and CLI UX bug Something isn't working cr:skip Skip CodeRabbit review documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Windows: run <unlisted-command> fails via bunx while Linux succeeds

1 participant