flake: fix build with slang feature#328
Open
Smephite wants to merge 1 commit into
Open
Conversation
fischeti
approved these changes
Jul 3, 2026
fischeti
left a comment
Contributor
There was a problem hiding this comment.
The changes in build.rs looks good to me. I don't have any experience for flake nix, but I trust you there :)
The question is whether this requires a new release of bender-slang. Does nix pull from crates.io? or does it just build from source?
Author
|
Thanks guys!
No release needed. |
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.
The
slangfeature (enabled by default) requires cmake and network access for FetchContent dependencies (slang, fmt, mimalloc), both unavailable in the nix sandbox. This breaks the flake build.To support sandboxed builds without patching,
build.rsnow accepts optional env vars (SLANG_SRC_DIR,FMT_SRC_DIR,MIMALLOC_SRC_DIR). When set, they are forwarded asFETCHCONTENT_SOURCE_DIR_*cmake variables and used to derive include paths. Normal builds are unaffected — cmake still fetches everything when the vars are unset. This also simplifies the nixpkgs packaging in NixOS/nixpkgs#532944, which currently patchesbuild.rswithreplaceVarsto achieve the same effect.The flake is updated to use this mechanism: pre-fetched GitHub sources are passed via the env vars,
cmakeandpython3are added as build inputs, source filters are extended for C++/test files,NO_COLOR=1is set for owo-colors test compatibility, andrun_all.shis run as an integration test.