Skip to content

Conversation

@Hasnep
Copy link
Contributor

@Hasnep Hasnep commented Nov 5, 2025

This adds a Nix package for the new Zig based compiler to the Nix flake in src/, it can be tested by running

nix run github:hasnep/roc/add-nix-packages-for-new-compiler?dir=src

This will build the compiler package using Nix and run it.

@Anton-4
Copy link
Collaborator

Anton-4 commented Nov 5, 2025

Looks like this is ziglang/zig#20976

Prepare all required actions
Run ./.github/actions/flaky-retry
Run attempt=1
Attempt 1 of 4
Running command: nix build ./src/#roc && ./result/bin/roc check src/PROFILING/bench_repeated_check.roc
this derivation will be built:
  /nix/store/5j70vyv6kzh4ijhbfwrwswkwivg6nkpb-roc.drv
this path will be fetched (0.00 MiB download, 0.00 MiB unpacked):
  /nix/store/999ilh77rzjg38y3cpbg780b99bbjznc-zig-hook
copying path '/nix/store/999ilh77rzjg38y3cpbg780b99bbjznc-zig-hook' from 'https://cache.nixos.org/'...
building '/nix/store/5j70vyv6kzh4ijhbfwrwswkwivg6nkpb-roc.drv'...
error: builder for '/nix/store/5j70vyv6kzh4ijhbfwrwswkwivg6nkpb-roc.drv' failed with exit code 1;
       last 15 log lines:
       > Running phase: unpackPhase
       > unpacking source archive /nix/store/pqk46pzvp5rpqghhfd09gwzp1c99qgg9-g9y6lgai98rm7jpi4zl681mb5casyglg-source
       > source root is g9y6lgai98rm7jpi4zl681mb5casyglg-source
       > Running phase: patchPhase
       > Running phase: updateAutotoolsGnuConfigScriptsPhase
       > Running phase: configurePhase
       > no configure script, doing nothing
       > Running phase: buildPhase
       > zig build flags: -j4 -Dcpu=baseline --release=safe
       > /build/g9y6lgai98rm7jpi4zl681mb5casyglg-source/build.zig.zon:52:20: error: unable to discover remote git server capabilities: TemporaryNameServerFailure
       >             .url = "git+https://github.com/rdunnington/bytebox#5c8753ba11c394e4d642dddbb459edcd7c97ac26",
       >                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       > /build/g9y6lgai98rm7jpi4zl681mb5casyglg-source/build.zig.zon:56:20: error: unable to discover remote git server capabilities: TemporaryNameServerFailure
       >             .url = "git+https://github.com/allyourcodebase/zstd.git#01327d49cbc56dc24c20a167bb0055d7fc23de84", // 1.5.7
       >                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       For full logs, run:
         nix log /nix/store/5j70vyv6kzh4ijhbfwrwswkwivg6nkpb-roc.drv
Command failed with exit code 1 and error output contains 'TemporaryNameServerFailure'
Retrying...

@Anton-4
Copy link
Collaborator

Anton-4 commented Nov 5, 2025

nix build ./src/#roc is taking 12 minutes on macOS 15, while zig build -Dfuzz -Dsystem-afl=false -Doptimize=ReleaseFast only takes 5 minutes outside of nix.

@Hasnep Hasnep force-pushed the add-nix-packages-for-new-compiler branch from 75e79f1 to c98171f Compare November 10, 2025 02:17
@Hasnep
Copy link
Contributor Author

Hasnep commented Nov 10, 2025

I believe the slow build was because Nix was spending a long time copying files it didn't need to, I've added the Nix gitignore input to easily use the .gitignore files to reduce the files copied, and the build is taking 5 minutes for me now.

@Hasnep Hasnep force-pushed the add-nix-packages-for-new-compiler branch 3 times, most recently from bb139b6 to 40fe39b Compare November 12, 2025 02:02
@Hasnep Hasnep force-pushed the add-nix-packages-for-new-compiler branch 2 times, most recently from 231a8f7 to d0617a4 Compare November 21, 2025 08:08
@Hasnep Hasnep force-pushed the add-nix-packages-for-new-compiler branch from d0617a4 to 66d0a49 Compare November 21, 2025 08:41
@Anton-4
Copy link
Collaborator

Anton-4 commented Nov 21, 2025

@Hasnep can you check if we can add a workaround for ziglang/zig#20976 ?

@Hasnep
Copy link
Contributor Author

Hasnep commented Nov 21, 2025

I was looking at that earlier today, I'll push my experiment in the next few days :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants