Skip to content

fix(ci): stage the Rust release binary outside the repo root before archiving - #12918

Merged
zkochan merged 1 commit into
mainfrom
fix-pq-release
Jul 10, 2026
Merged

zkochan merged 1 commit into
mainfrom
fix-pq-release

Conversation

@zkochan

@zkochan zkochan commented Jul 10, 2026 •

Copy link
Copy Markdown
Member

Summary

The Release pnpm (Rust) run failed in the Publish job with EISDIR: illegal operation on a directory, copyfile '.../pnpm-darwin-x64'.

Root cause: the build job's non-Windows "Archive Binary" step renamed the built binary to pnpm at the repo root before tarring it. Since #12913 renamed the pacquet/ directory to pnpm/, that mv moved the binary into the existing pnpm/ source directory (as pnpm/pacquet), and tar czf ... pnpm archived the entire Rust source tree instead of the binary. The publish job then extracted a directory where it expected a binary, and generate-packages.mjs crashed. The Windows legs were unaffected because they rename to pnpm.exe, which doesn't collide.

This stages the binary in a scratch directory and tars from there. The archive layout is unchanged (a plain pnpm binary at the root), so the publish job, the GitHub release assets, and get.pnpm.io's install scripts all keep working as before. Verified locally that the new commands produce a tarball containing only pnpm and that the publish job's extract step yields a regular file. The pnpr release workflow doesn't have this bug — it renames its binary to pnpr-<target>, which doesn't collide with the pnpr/ directory.

Squash Commit Body

The Release pnpm (Rust) workflow renamed the built binary to `pnpm` at the
repo root before tarring it. Since the pacquet/ directory was renamed to
pnpm/ (pnpm/pnpm#12913), that `mv` moved the binary *into* the existing
`pnpm/` source directory instead, so the non-Windows archives contained the
whole Rust source tree. The publish job then extracted a directory where it
expected a binary and failed with EISDIR in generate-packages.mjs
(https://github.com/pnpm/pnpm/actions/runs/29113833296).

Stage the binary in a scratch directory and tar from there, keeping the
archive layout (a plain `pnpm` binary at the root) unchanged.

Checklist

  • The change is implemented in both the TypeScript CLI and the Rust pnpm/ port, or the description notes what still needs porting. (CI-only change to the Rust release workflow; nothing to port.)

🤖 Generated with Claude Code


Written by an agent (Claude Code, claude-fable-5).

Summary by CodeRabbit

  • Bug Fixes
    • Improved packaging of non-Windows binary archives to ensure consistent archive contents and layout across platforms.
    • Preserved compatibility with subsequent release steps while avoiding changes to files in the repository root.

…rchiving

The Release pnpm (Rust) workflow renamed the built binary to `pnpm` at the
repo root before tarring it. Since the pacquet/ directory was renamed to
pnpm/, that `mv` moved the binary *into* the existing `pnpm/` source
directory instead, so the non-Windows archives contained the whole Rust
source tree. The publish job then extracted a directory where it expected a
binary and failed with EISDIR in generate-packages.mjs
(https://github.com/pnpm/pnpm/actions/runs/29113833296).

Stage the binary in a scratch directory and tar from there, keeping the
archive layout (a plain `pnpm` binary at the root) unchanged.

Co-Authored-By: Claude Fable 5 <[email protected]>
Copilot AI review requested due to automatic review settings July 10, 2026 19:10

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@coderabbitai

coderabbitai Bot commented Jul 10, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 8bcdfc16-fa9d-4794-ad76-9ce677169ee4

📥 Commits

Reviewing files that changed from the base of the PR and between 78c2245 and caab3d8.

📒 Files selected for processing (1)
  • .github/workflows/pacquet-release-to-npm.yml

📝 Walkthrough

Walkthrough

The release workflow now stages the non-Windows pacquet binary under stage/pnpm before creating the pnpm-<code-target>.tar.gz archive, avoiding a root-level temporary pnpm file.

Changes

Binary packaging

Layer / File(s) Summary
Stage and archive non-Windows binary
.github/workflows/pacquet-release-to-npm.yml
The workflow creates a temporary stage directory, moves the built binary to stage/pnpm, and archives it using tar -C stage pnpm.

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

Possibly related PRs

  • pnpm/pnpm#12907: Updates the same release workflow’s per-platform binary archive layout and asset naming.
  • pnpm/pnpm#11657: Modifies related GitHub Actions workflow setup and packaging logic.

Suggested labels: product: pacquet

Suggested reviewers: qodo-code-review

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix-pq-release

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@qodo-code-review

Copy link
Copy Markdown

PR Summary by Qodo

Fix Rust release workflow tarball by staging pnpm binary outside repo root

🐞 Bug fix ⚙️ Configuration changes 🕐 Less than 10 minutes

Grey Divider

AI Description

• Prevent non-Windows Rust release archives from tarring the entire pnpm/ source tree.
• Stage the built pacquet binary in a scratch directory before renaming to pnpm.
• Keep the published tarball layout unchanged (single pnpm binary at archive root).
Diagram

graph TD
  A["Build pacquet binary"] --> B["Stage as stage/pnpm"] --> C[("pnpm-<target>.tar.gz") ] --> D["Upload artifact"] --> E["Publish job"] --> F["Extract & package"]
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Use tar path + rename transform (no staging directory)
  • ➕ Avoids creating a scratch directory
  • ➕ Keeps repo workspace cleaner
  • ➖ GNU tar transform flags are less readable and can be portability-sensitive
  • ➖ More fragile to maintain in CI YAML
2. Tar directly from build output directory with a copy to temp filename
  • ➕ Still avoids repo-root name collisions
  • ➕ Can be implemented with cp instead of mv to preserve original artifact
  • ➖ Slightly more I/O and commands than the current approach
  • ➖ Doesn't materially reduce risk vs staging directory

Recommendation: The scratch staging directory approach is the best tradeoff: it is explicit, portable, and directly prevents the pnpm/ directory name collision while preserving the existing archive layout expected by downstream publish/extract logic.

Files changed (1) +7 / -2

Bug fix (1) +7 / -2
pacquet-release-to-npm.ymlStage non-Windows pnpm binary before creating release tarball +7/-2

Stage non-Windows pnpm binary before creating release tarball

• Updates the non-Windows "Archive Binary" step to move the built pacquet binary into a scratch stage/ directory and tar from there. This prevents the rename-to-pnpm step from accidentally moving into the existing pnpm/ source directory and producing a tarball with the entire Rust tree.

.github/workflows/pacquet-release-to-npm.yml

@qodo-code-review

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)

Grey Divider

Great, no issues found!

Qodo reviewed your code and found no material issues that require review

Grey Divider

Auto-approved notes - no code review findings
- 'auto_approve_for_no_suggestions' flag enabled

Qodo Logo

@github-actions github-actions Bot added the reviewed: coderabbit CodeRabbit submitted an approving review label Jul 10, 2026
@qodo-code-review

Copy link
Copy Markdown

PR Code Suggestions ✨

Warning

/improve is deprecated. Use /agentic_review instead (removal date not yet scheduled).

Explore these optional code suggestions:

CategorySuggestion                                                                                                                                    Impact
Possible issue
Make directory creation idempotent

Use mkdir -p to make directory creation idempotent.

.github/workflows/pacquet-release-to-npm.yml [174-176]

-mkdir stage
+mkdir -p stage
 mv target/${{ matrix.target }}/release/pacquet stage/pnpm
 tar czf pnpm-${{ matrix.code-target }}.tar.gz -C stage pnpm
  • Apply / Chat
Suggestion importance[1-10]: 4

__

Why: Using mkdir -p is a good defensive programming practice for shell scripts, although GitHub Actions runners typically start with a fresh workspace.

Low
  • More

@zkochan
zkochan merged commit 2d7e723 into main Jul 10, 2026
26 checks passed
@zkochan
zkochan deleted the fix-pq-release branch July 10, 2026 19:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

product: pacquet reviewed: coderabbit CodeRabbit submitted an approving review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants