Cloudef/nix-zig-stdenv
cross-compile nixpkgs with zig
{ "createdAt": "2022-10-30T22:26:28Z", "defaultBranch": "master", "description": "cross-compile nixpkgs with zig", "fullName": "Cloudef/nix-zig-stdenv", "homepage": null, "language": "Nix", "name": "nix-zig-stdenv", "pushedAt": "2024-01-21T04:28:18Z", "stargazersCount": 48, "topics": [], "updatedAt": "2025-03-12T15:44:47Z", "url": "https://github.com/Cloudef/nix-zig-stdenv"}Zig based cross-compiling toolchain
Section titled “Zig based cross-compiling toolchain”Major known issues:
Section titled “Major known issues:”-
Zig seems to randomly fail with parallel builds with ‘error: unable to build … CRT file: BuildingLibCObjectFailed’ This seems like race condition with the cache? https://github.com/ziglang/zig/issues/13160 https://github.com/ziglang/zig/issues/9711
-
Rust and zig fight for the ownership of libcompiler_rt https://github.com/ziglang/zig/issues/5320
Why zig for cross-compiling?
Section titled “Why zig for cross-compiling?”Zig can cross-compile out of the box to many target without having to bootstrap the whole cross-compiler and various libcs This means builds are very fast
- Generate meta.json with github actions
- Rank zig versions and targets depending how well they do in tests
- Provide
zigPkgsset with packages maintained in this repo- Packages that need major restructuring to compile
- Minimal versions of existing packages (we are mostly interested in libs only)
- Packages that do not exist yet in nixpkgs
- Namespaced for different platforms (c, rust, etc…)
- Generally zigPkgs is expected to compile and work while pkgs from nixpkg can be hit and miss
For other stuff, run things-to-do