feat(build): add Nix-native Linux toolchains - #2875
Open
SDAChess wants to merge 5 commits into
Open
Conversation
SDAChess
requested review from
a team,
derekwaynecarr,
mrunalp and
sjenning
as code owners
August 21, 2026 15:07
drew
approved these changes
Aug 21, 2026
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.
Goal
This PR introduces Nix-managed Linux toolchains that aim to replace
cargo-zigbuildfor release builds.The existing
cargo-zigbuildCI workflows remain in place for now. These development shells establish and validate the replacement toolchains before CI is migrated.Toolchains
Two Linux development shells are added:
glibc-2-28builds dynamically linked GNU binaries compatible with glibc 2.28.musluses musl-native Rust, Cargo, and C toolchains to produce static PIE binaries.Both environments support plain Cargo commands without target-specific linker configuration.
System dependencies
Another goal is to vendor external system dependencies through Nix, especially native dependencies that are expensive to compile.
Z3 and AWS-LC are built as static Nix packages and discovered by their Rust
-syscrates instead of being rebuilt from bundled sources by Cargo. This allows those builds to be cached and reused while keeping incremental Cargo builds focused on Rust code.Additional native dependencies can follow the same pattern where it provides a meaningful build-time improvement.
Link performance
Both toolchains use mold.
OpenShell has a large dependency graph and produces many binaries, test executables, proc-macro shared objects, and other linked artifacts. Link time therefore represents a significant portion of clean builds and development iterations. Using mold keeps these linker-heavy workloads practical without requiring Cargo-specific linker wrappers or flags.
Validation
.commentsection that mold performed the links.