fix(nixos): add per-version gcroots for patched solc linker#188
Open
0xferrous wants to merge 1 commit into
Open
fix(nixos): add per-version gcroots for patched solc linker#1880xferrous wants to merge 1 commit into
0xferrous wants to merge 1 commit into
Conversation
On NixOS, installed solc binaries are patched to use a dynamic linker from the nix store. Without a gcroot, that interpreter path can be garbage-collected, breaking previously installed solc binaries. This change resolves the linker path explicitly, adds a persistent gcroot under the SVM `data_dir` in `.gcroots` for each solc version, and then patches the binary to that resolved interpreter. Using per-version roots avoids repointing a shared root when linker paths change across system updates. Adds a dedicated error variant for gcroot creation failures.
8564246 to
4b56b3d
Compare
mattsse
reviewed
Mar 6, 2026
Member
mattsse
left a comment
There was a problem hiding this comment.
no idea how to review this
maybe @DaniPopes has an idea
Contributor
|
maybe @shekhirin / @joshieDo? implementation generally makes sense to me |
Member
|
@decofe check this out |
Author
|
It didn't error when i tried, it derives the root from the given path. $ nix-store --add-root /tmp/test --realise /nix/store/wb6rhpznjfczwlwx23zmdrrw74bayxw4-glibc-2.42-47/lib/ld-linux-x86-64.so.2
$ nix-store --gc --print-roots | grep /tmp/test
/tmp/test -> /nix/store/wb6rhpznjfczwlwx23zmdrrw74bayxw4-glibc-2.42-47 |
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.
On NixOS, installed solc binaries are patched to use a dynamic linker from
the nix store. Without a gcroot, that interpreter path can be garbage-collected,
breaking previously installed solc binaries.
This change resolves the linker path explicitly, adds a persistent gcroot under
the SVM
data_dirin.gcrootsfor each solc version, and then patches the binaryto that resolved interpreter. Using per-version roots avoids repointing a shared root
when linker paths change across system updates.
Adds a dedicated error variant for gcroot creation failures.