Fil-C on Nix

Filnix wiki

mbrock/filnix

toolchain.nix

λpkgs, sources?, devLlvm?
pkgs
sourcesdefault import./lib/sources.nix inherit pkgs;

When true, the final compiler wrapper runs the clang binary from an out-of-Nix LLVM build directory named by $FILC_DEV_LLVM at run time. Runtime libraries (libpizlo, glibc, libc++) still come from the pinned Nix-built compiler, so only the compiler itself is swapped.

devLlvmdefault false
let
11lib=
import./lib inherit pkgs;
used by filc0-dev
12filc0=
import./compiler/filc0.nix inherit pkgs sources;.filc0
used by filc0-dev
13filc-pinned=
import./build-filc.nix inherit pkgs sources filc0;
15filc0-dev=
pkgs.runCommand"filc0-dev" { }
mkdir -p $out/bin
ln -s ${filc0}/lib $out/lib
cat > $out/bin/clang-${lib.llvmMajor} <<'EOF'
#!${pkgs.runtimeShell}
: "''${FILC_DEV_LLVM:?set FILC_DEV_LLVM to a Fil-C LLVM build directory}"
exec -a "$0" "$FILC_DEV_LLVM/bin/clang-${lib.llvmMajor}" "$@"
EOF
chmod +x $out/bin/clang-${lib.llvmMajor}
uses filc0 lib used by filc
26filc=
if devLlvm then filc-pinned.overridefilc0 = filc0-dev; else filc-pinned
28filc-binutils=
import./toolchain/binutils.nix inherit pkgs;
29filc-sysroot=
33toolchain=
34inherit
pkgs filc filc-sysroot filc-binutils

ccache keys on the wrapper, which does not change when the dev clang does.

41useCcache=
in
toolchain.filcc.overrideAttrs
λold
45passthru=
old.passthru or { }
//
46inherit
sources
47components=