shells/filc-llvm.nix
Shell for hacking on the Fil-C LLVM/Clang (FilPizlonator, clang CodeGen) outside Nix with incremental ninja builds. See docs/llvm-dev.md.
λpkgs, sources?
| pkgs | |
| sources | default import../lib/sources.nix inherit pkgs; |
let
import../toolchain.nix
pkgs.writeShellScriptBin"filc-llvm-worktree"
# usage: filc-llvm-worktree <existing fil-c clone> <new worktree dir> <branch>
# Creates a sparse worktree at the revision filnix pins (${sources.coreRev}).
set -eu
git -C "$1" worktree add --no-checkout -b "$3" "$2" ${sources.coreRev}
git -C "$2" sparse-checkout set --no-cone \
/LLVM-LICENSE.txt /llvm/ /clang/ /cmake/ /third-party/ \
/libcxx/ /libcxxabi/ /libc/ /runtimes/ /filc/ /libpas/
git -C "$2" checkout "$3"
in
pkgs.mkShell
"filc-llvm"
export FILC_SRC="''${FILC_SRC:-$HOME/fil-c-dev}"
export FILC_DEV_LLVM="''${FILC_DEV_LLVM:-$FILC_SRC/build-filnix}"
echo "Fil-C LLVM dev shell"
echo " FILC_SRC=$FILC_SRC"
echo " FILC_DEV_LLVM=$FILC_DEV_LLVM"
echo " filc-llvm-build [targets] (default: clang)"
echo " clang / clang++ run the dev clang with the pinned Fil-C runtime"