fix: replicate launcher's AVX2/musl detection in postinstall.mjs#875
Open
GautamKumarOffical wants to merge 1 commit into
Open
fix: replicate launcher's AVX2/musl detection in postinstall.mjs#875GautamKumarOffical wants to merge 1 commit into
GautamKumarOffical wants to merge 1 commit into
Conversation
postinstall.mjs always hardcoded the non-baseline, non-musl binary package name. On non-AVX2 x64 CPUs this wrote a cache file pointing to the wrong binary, and the launcher short-circuited to that cache before its own CPU detection ran, causing SIGILL. Now postinstall.mjs builds the same candidate list as bin/mimo (AVX2 detection, musl detection, priority ordering) and picks the first one that resolves, so the cached binary matches what the launcher would have chosen.
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.
Fixes #871
postinstall.mjsalways hardcodes the non-baseline, non-musl binary package name. On non-AVX2 x64 CPUs (Sandy Bridge, Ivy Bridge, pre-Excavator AMD) this writes a cache file pointing to the wrong binary, and the launcher short-circuits to that cache before its own CPU detection runs, causing SIGILL.What changed:
Replicated the launcher's (
bin/mimo) binary selection logic inpostinstall.mjs:supportsAvx2()— checks/proc/cpuinfoon Linux,sysctlon macOSdetectMusl()— checks for Alpine or musl-linked lddfindBinary()now builds the same candidate list with correct priority ordering (baseline first for non-AVX2, musl variants for Alpine) and picks the first that resolvesThe cached
bin/.mimocodenow points to the correct binary for the user's CPU.