Skip to content

fix #24550 - #24726

Merged
Jarred-Sumner merged 3 commits into
mainfrom
dylan/fix-postinstall-regression
Nov 17, 2025
Merged

Jarred-Sumner merged 3 commits into
mainfrom
dylan/fix-postinstall-regression

Conversation

@dylan-conway

@dylan-conway dylan-conway commented Nov 14, 2025 •

Copy link
Copy Markdown
Member

What does this PR do?

Fixes a regression introduced in Bun v1.3.2 with #24283.

We are not able to skip sharp lifecycle scripts before v0.33.0 because previous versions did not use optional dependencies with prebuilds.

Fixes #24550
Fixes ENG-21519

How did you verify your code works?

Manually

@robobun

robobun commented Nov 14, 2025 •

Copy link
Copy Markdown
Collaborator
Updated 10:48 AM PT - Nov 17th, 2025

❌ @dylan-conway, your commit 8c80bcd has 5 failures in Build #31878 (All Failures):


🧪   To try this PR locally:

bunx bun-pr 24726

That installs a local version of the PR into your bun-24726 executable, so you can run:

bun-24726 --bun

@dylan-conway
dylan-conway requested review from a team, Jarred-Sumner and cirospaciari and removed request for a team November 14, 2025 21:54
@coderabbitai

coderabbitai Bot commented Nov 14, 2025 •

Copy link
Copy Markdown
Contributor

Walkthrough

Function signatures in postinstall optimization were refactored to accept a struct containing package name hash, version, and string buffer instead of scalar arguments. This enables version-aware decision-making for lifecycle script handling and package optimization logic across the install system.

Changes

Cohort / File(s) Summary
Call site updates for struct-based arguments
src/install/PackageInstaller.zig, src/install/isolated_install/Installer.zig
Updated invocations of PostinstallOptimizer.get() to pass composite struct arguments containing name_hash, version, and version_buf instead of plain scalar name_hash parameters. Two call sites per file modified.
PostinstallOptimizer refactoring
src/install/postinstall_optimizer.zig
Redefined get(), shouldIgnoreLifecycleScripts(), and fromDefault() to accept PkgInfo struct parameter instead of scalar name_hash. Introduced internal DefaultIgnore structure with minimum_version field. Added version-aware comparison logic for lifecycle script and default-binlink decisions. Updated internal lookups to operate on pkg_info.name_hash with version checks.

Pre-merge checks

❌ Failed checks (1 inconclusive)
Check name Status Explanation Resolution
Title check ❓ Inconclusive The title 'fix #24550' directly references the linked issue but provides minimal detail about what is being fixed. Consider expanding the title to briefly summarize the fix, e.g., 'fix: restore sharp lifecycle script skipping for versions before v0.33.0' to better convey the change.
✅ Passed checks (3 passed)
Check name Status Explanation
Linked Issues check ✅ Passed The code changes address the regression by enabling version-aware lifecycle script skipping for sharp versions before v0.33.0 through struct-based parameter passing in postinstall optimizer.
Out of Scope Changes check ✅ Passed All changes are focused on postinstall optimizer logic and call sites to support version-aware lifecycle script filtering, directly addressing the regression.
Description check ✅ Passed The PR description follows the template with both required sections completed: 'What does this PR do?' explains the regression fix and references the linked issue; 'How did you verify your code works?' documents manual verification.

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

@linear

linear Bot commented Nov 14, 2025

Copy link
Copy Markdown

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.

Cannot find module '../build/Release/sharp-darwin-arm64v8.node'

3 participants