Repository navigation
fix(link-bins): reapply executable bit to restored bins - #13630
Conversation
|
💖 Thanks for opening this pull request! 💖 |
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more → On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
|
Warning Review limit reached
Next review available in: 1 minute You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughThe linker now tracks matching existing symlinks and shims, then restores executable permissions or normalizes Windows shebangs when needed. A POSIX regression test verifies permission restoration during relinking. ChangesBin relinking
Estimated code review effort: 2 (Simple) | ~10 minutes Suggested labels: Suggested reviewers: ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains. Reviews (3): Last reviewed commit: "fix(link-bins): skip the executable-bit ..." | Re-trigger Greptile |
There was a problem hiding this comment.
🧹 Nitpick comments (2)
pnpm11/bins/linker/test/index.ts (1)
102-113: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winUse asynchronous filesystem APIs in this async test.
fs.chmodSyncandfs.statSyncblock the Jest worker. Use the repository's asynchronous filesystem helpers and await both operations.Example
- fs.chmodSync(binSource, 0o644) + await fs.promises.chmod(binSource, 0o644) - expect(fs.statSync(binSource).mode & 0o777).toBe(0o755) + expect((await fs.promises.stat(binSource)).mode & 0o777).toBe(0o755)As per coding guidelines, prefer asynchronous filesystem APIs and
async/await.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@pnpm11/bins/linker/test/index.ts` around lines 102 - 113, Update the test around linkBins() repairs a non-executable source to replace fs.chmodSync and fs.statSync with the repository’s asynchronous filesystem helpers, awaiting both operations while preserving the existing permissions assertion.Source: Coding guidelines
pnpm11/bins/linker/src/index.ts (1)
278-284: 🚀 Performance & Scalability | 🔵 TrivialMeasure the added warm-install filesystem work.
Every matching bin now calls
ensureExecutableIfNeeded. That helper performsfs.statand, for executable files, opens and reads up to 2 KiB to checkhasWindowsShebang. Aliases that sharecmd.pathrepeat the same work.Cache the result per source path within one
linkBinsrun, or measure and document why this extra hot-path I/O is acceptable.As per path instructions, avoid unnecessary filesystem work on the linking hot path.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@pnpm11/bins/linker/src/index.ts` around lines 278 - 284, Update the linkBins flow around ensureExecutableIfNeeded to cache the executable/shebang-check result by cmd.path for the duration of a single run, so aliases sharing a source path do not repeat stat/read I/O. Reuse the cached result for subsequent matching bins while preserving the existing executable-bit behavior.Source: Path instructions
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@pnpm11/bins/linker/src/index.ts`:
- Around line 278-284: Update the linkBins flow around ensureExecutableIfNeeded
to cache the executable/shebang-check result by cmd.path for the duration of a
single run, so aliases sharing a source path do not repeat stat/read I/O. Reuse
the cached result for subsequent matching bins while preserving the existing
executable-bit behavior.
In `@pnpm11/bins/linker/test/index.ts`:
- Around line 102-113: Update the test around linkBins() repairs a
non-executable source to replace fs.chmodSync and fs.statSync with the
repository’s asynchronous filesystem helpers, awaiting both operations while
preserving the existing permissions assertion.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: c4b5d95e-2cbb-4561-92db-94eb476e89c3
📒 Files selected for processing (2)
pnpm11/bins/linker/src/index.tspnpm11/bins/linker/test/index.ts
When a `pnpm install` fails, on a rerun we may re-copy a bin script from the store. After pnpm#11069 though, we wouldn't reapply the executable bit to the bin script that we did on the first install attempt. This change fixes that by reapplying the executable bit when necessary. This should fix pnpm#12742
3a8d892 to
fe8988f
Compare
… missing A correctly linked shim whose source file has vanished must not fail the install: the skip path previously returned without touching the source, and pacquet swallows NotFound in the same spot. Also add the missing changeset for pnpm#12742. Co-Authored-By: Claude Fable 5 <[email protected]>
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
Code Review by Qodo
1. ensureExecutableIfNeeded comment historical
|
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
|
Congrats on merging your first pull request! 🎉🎉🎉 |
Summary
When a
pnpm installfails we may re-copy a bin script from the store whenpnpm installis rerun. After #11069 though, we don't reapply the executable bit to the bin script that we did on the first install attempt. This change fixes that by reapplying the executable bit when necessary. This should fix #12742.Squash Commit Body
Checklist
already linked to it solves it.
pnpm changeset) if this PR changes any publishedpackage. Keep it short and written for pnpm users — it becomes a release note.
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.Summary by CodeRabbit