fix(npm): restore execute bits for prebuilt binaries#204
Merged
benvinegar merged 2 commits intomainfrom Apr 14, 2026
Merged
Conversation
Contributor
Greptile SummaryFixes the Confidence Score: 5/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant User
participant npm
participant hunkdiff as hunkdiff (meta pkg)
participant platform as hunkdiff-linux-x64 (platform pkg)
participant bin as installDir/bin/hunk
User->>npm: npm install -g hunkdiff
npm->>hunkdiff: extract + install
hunkdiff->>npm: "optionalDependencies: { hunkdiff-linux-x64: "^0.9.x" }"
npm->>platform: extract + install as nested dep
Note over platform: bin.hunk → ./bin/hunk<br/>npm sets chmod +x on bin/hunk
platform-->>npm: binary installed with 755
hunkdiff->>bin: JS wrapper symlink → hunkdiff/bin/hunk.js
bin-->>User: hunk --help ✓ (no EACCES)
Prompt To Fix All With AIThis is a comment left during a code review.
Path: scripts/prebuilt-package-helpers.test.ts
Line: 83-98
Comment:
**Test coverage gap for `name` and `version` fields**
The test verifies `bin`, `os`, and `cpu` but doesn't assert `name` (derived from `spec.packageName`) or `version` (passed through from `rootPackage`). These are the fields most likely to silently regress — e.g. if the manifest builder accidentally dropped `name` or pulled `version` from the wrong source, no test would catch it.
```suggestion
test("buildPlatformPackageManifest declares the native binary as a bin entry", () => {
const manifest = buildPlatformPackageManifest(
{
version: "1.2.3",
description: "Desktop diff viewer",
license: "MIT",
},
getPlatformPackageSpecForHost("linux", "x64"),
);
expect(manifest.name).toBe("hunkdiff-linux-x64");
expect(manifest.version).toBe("1.2.3");
expect(manifest.bin).toEqual({
hunk: "./bin/hunk",
});
expect(manifest.os).toEqual(["linux"]);
expect(manifest.cpu).toEqual(["x64"]);
});
```
How can I resolve this? If you propose a fix, please make it concise.
---
This is a comment left during a code review.
Path: scripts/smoke-prebuilt-install.ts
Line: 50-69
Comment:
**Temp dirs not cleaned up on early-exit error**
`packageDir`, `installDir`, and `smokeMetaDir` are all created before the `try` block. If either the `node` or `bash` resolution check throws, the three temp dirs are left behind. This was a pre-existing gap for the first two dirs, but `smokeMetaDir` is new here.
Moving the `mkdtempSync` calls inside the `try` block (or wrapping the resolution checks inside it too) would close the leak. At minimum, adding a comment acknowledging the intentional trade-off would avoid surprises.
How can I resolve this? If you propose a fix, please make it concise.Reviews (1): Last reviewed commit: "fix(npm): restore execute bits for prebu..." | Re-trigger Greptile |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
binmanifest so npm restores execute bits on installTesting
hunkdiff@0.9.3installs nestedhunkdiff-linux-x64/bin/hunkas644and fails withspawnSync ... EACCEShunkdiff@0.9.4-beta.0installs that binary as755andhunk --helpsucceedsFixes #202.
This PR description was generated by Pi using GPT-5