Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
74 commits
Select commit Hold shift + click to select a range
b6d3ea5
cabal2nix: fix cabal→nixpkgs arch predicate names
hamishmack Jul 4, 2026
5787302
Add per-component additional-prebuilt-depends
hamishmack Jul 4, 2026
02bcc10
system-nixpkgs-map: GHC 9.14 rts/ghc-internal extra-libraries
hamishmack Jul 4, 2026
c72384d
non-reinstallable: add libffi-clib for GHC 9.14+
hamishmack Jul 4, 2026
fc00aa0
redirect.nix: treat TargetDisabledByUser as not buildable
hamishmack Jul 4, 2026
645eca6
roots: guard hadrianProject and iserv-proxy-exes existence
hamishmack Jul 4, 2026
9265887
Add replace-hackage-tarball-urls project option
hamishmack Jul 4, 2026
ad79748
Add sghc914: stable-haskell GHC 9.14 built with cabalProject
hamishmack Jul 4, 2026
d333858
ci: enable sghc914 tests (unstable)
hamishmack Jul 4, 2026
6eb7254
Build ghc.generated cheaply via generated-light (no full GHC at eval)
hamishmack Jul 6, 2026
fe43140
sghc914: fix native ghc --make -jN WHITEHOLE crash (rts.cabal THREADE…
hamishmack Jul 7, 2026
595192b
sghc914: enable text +simdutf and haskeline +terminfo
hamishmack Jul 8, 2026
0de50c9
Rename sghc914 -> ghc914-sh
hamishmack Jul 8, 2026
a71c548
ghc914-sh: repin to stable-ghc-9.14 (rts THREADED_RTS fix merged, #191)
hamishmack Jul 8, 2026
48e3311
ghc914-sh: fix dummy ghc-pkg dump for srp and flag-dependent boot libs
hamishmack Jul 8, 2026
bf52e4a
Fix isNativeMusl misclassifying darwin->linux-musl as native musl
hamishmack Jul 8, 2026
4741d05
Support Linux cross-compilation from darwin via hyper-linux (hl)
hamishmack Jul 8, 2026
e5a3c95
hadrian ghc: fix stage0 libffi link when cross-compiling from darwin
hamishmack Jul 8, 2026
f4bc0d6
Merge branch 'master' into hkm/darwin-linux-cross-hl
hamishmack Jul 8, 2026
24f4ab7
v2 + ghc914-sh: align stable-haskell UnitIds with plan-nix
hamishmack Jul 9, 2026
3fe0188
Merge remote-tracking branch 'origin/master' into hkm/darwin-linux-cr…
hamishmack Jul 10, 2026
d64a7c0
ci: darwin -> linux cross for ghc914 / ghc914-sh (aarch64 + musl64) v…
hamishmack Jul 10, 2026
601c509
Merge remote-tracking branch 'origin/master' into hkm/darwin-linux-cr…
hamishmack Jul 12, 2026
7fa2c97
ghcjs: trim Apple-ranlib wasm member padding in the archive reader
hamishmack Jul 13, 2026
d018e05
test: bump head.hackage.ghc.haskell.org --sha256
hamishmack Jul 13, 2026
cd4185f
nix-tools: link the stable-haskell cabal fork + port to Cabal 3.17
hamishmack Jul 13, 2026
3367f2d
builder: build v2CabalInstall from the stable-haskell cabal fork (3.17)
hamishmack Jul 13, 2026
d1e40ff
haskell.nix: from-source nix-tools + plan-time support for the cabal …
hamishmack Jul 13, 2026
d0054c1
ghc914-sh: break the Windows cross Win32 cycle via the cabal stage sy…
hamishmack Jul 13, 2026
84f50a6
ghc914-sh: thread ghcEvalPackages so plan-to-nix runs on the eval host
hamishmack Jul 14, 2026
0215655
haskell.nix: strip the ghc914-sh index-state at source, not in plan code
hamishmack Jul 14, 2026
7733e4f
ghc914-sh: thread ghcEvalPackages through the cross path too
hamishmack Jul 14, 2026
17e48ee
load-cabal-plan: prefer a configured unit over its pre-existing shadow
hamishmack Jul 14, 2026
c996da5
load-cabal-plan: redirect the `-inplace` pre-existing shadow to the c…
hamishmack Jul 14, 2026
c1b0943
v2 builder: support the stable-haskell cabal fork's staged store layout
hamishmack Jul 15, 2026
ebe78e2
ghc914-sh: build native stage2 with the v2 builder
hamishmack Jul 15, 2026
d5af2e6
v2 builder: reuse pre-built build tools via fork unit receipts; stric…
hamishmack Jul 15, 2026
6177451
ghc914-sh: replace-hackage-tarball-urls project module + eval-indepen…
hamishmack Jul 16, 2026
6aa8615
ghc914-sh: re-enable source filtering on stage1/stage2 evalSrc
hamishmack Jul 16, 2026
01461b5
iserv-proxy + v2 cabal: run plan-to-nix on the project's eval platform
hamishmack Jul 16, 2026
50807da
Merge remote-tracking branch 'origin/master' into hkm/stable-haskell
hamishmack Jul 16, 2026
b964132
v2: deterministic boot-lib unit ids, boot-Cabal slice fix, plan-nix r…
hamishmack Jul 17, 2026
a260929
v2: three fixes from the leksah full-build shakedown
hamishmack Jul 17, 2026
6c1f028
v2: stage-aware plan loading (host/build twins share bare unit ids)
hamishmack Jul 17, 2026
8ed10d8
tools: drop redundant builderVersion mkDefault (conflicted for stable…
hamishmack Jul 17, 2026
c9abb3a
v2: only infer `documentation: True` when the project text sets it
hamishmack Jul 17, 2026
239a1ad
ghc914-sh ghcjs cross: name emar/emranlib/emnm for ghc-toolchain
hamishmack Jul 18, 2026
f0780fe
v2 two-stage cross: resolve host boot-lib deps to the from-source twin
hamishmack Jul 18, 2026
6a24cf2
v2 two-stage cross: skip strict unit-id check for global-style slices
hamishmack Jul 18, 2026
fda3500
v2 two-stage cross: compose rts WAY sublibs into host boot slices
hamishmack Jul 18, 2026
400f670
v2 two-stage cross: force +os-string for directory/file-io/process/unix
hamishmack Jul 18, 2026
224e400
v2: fix build-stage exe naming (.exe) in two-stage cross plans
hamishmack Jul 19, 2026
3cd3318
flake: bump nixpkgs-unstable (2026-04-11 → 2026-07-18)
hamishmack Jul 19, 2026
a74be1a
ghc914-sh: boot from nixpkgs' cached ghc9103, not a from-source build
hamishmack Jul 19, 2026
6881e4f
v2: two-stage cross build-tool source injection + Win32/hsc2hs/shared…
hamishmack Jul 19, 2026
d69f4cf
ghc914-sh: keep the nixpkgs boot ghc's eval-time raw-src on the eval …
hamishmack Jul 19, 2026
05e9bb4
v2 cross: select the build-hosted compiler for withBuildCompiler plans
hamishmack Jul 19, 2026
97544f8
wasm: build the llvm monorepoSrc with the build-platform stdenv
hamishmack Jul 19, 2026
9d4b094
wasm: build the wasi-libc fork with its Makefile under the bumped nix…
hamishmack Jul 19, 2026
1fce1ad
ci: keep x86_64-darwin on the 26.05 pin (unstable/26.11 dropped it)
hamishmack Jul 20, 2026
7ca6c67
pkgconf-map: silence renamed-attr warnings, keep older-nixpkgs fallback
hamishmack Jul 20, 2026
f942734
test: refresh stale head.hackage.ghc.haskell.org pin
hamishmack Jul 20, 2026
660ee41
stable-haskell: plan-time dummy + install-plan fixes for the JS cross
hamishmack Jul 22, 2026
cce050b
v2 builders: two-stage build-tool staging + GHC JS backend slice support
hamishmack Jul 22, 2026
10aee11
stable-haskell injection: GHC JS backend support
hamishmack Jul 22, 2026
dc493fb
ghc914-sh: GHC JS backend cross-wrapper fixes
hamishmack Jul 22, 2026
956be1d
Merge remote-tracking branch 'origin/master' into hkm/stable-haskell
hamishmack Jul 24, 2026
1feecc6
ci: pin evalSystem to aarch64-darwin (impure evaluator)
hamishmack Jul 24, 2026
74b5680
test: thread evalSystem into the setup-deps test
hamishmack Jul 24, 2026
6e741d5
v2 builder + ghc914-sh: make leksah build on darwin (store layout, pr…
hamishmack Jul 24, 2026
61a7d74
Merge remote-tracking branch 'origin/master' into hkm/stable-haskell
hamishmack Jul 30, 2026
0e01aad
Merge remote-tracking branch 'origin/master' into hkm/stable-haskell
hamishmack Aug 5, 2026
ccac160
ghc914-sh: pin stable-ghc-9.14-hn (ghcjs HEAP8 + Apple ranlib ar fix)
hamishmack Aug 5, 2026
90e2ae6
ghc914-sh: bump stable-ghc-9.14-hn (aarch64/windows/android linker fi…
hamishmack Aug 5, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
73 changes: 73 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
# haskell.nix Developer Notes

## General rules

- **Never use materialization** (`materialized` argument).
- **Never use `index-state`** for tools — just pin the version.
- **Never run `cabal` or `ghc --make`** — use `pkgs.haskell-nix.cabalProject` or `pkgs.haskell-nix.tool`
- **Never search /nix/store** — do not use `grep`, `find`, `ls`, or any glob pattern against `/nix/store`. Instead use `nix build` or `nix eval` to find exactly what you are looking for. Searching `/nix/store` is unreliable because it can return stale or unexpected versions from unrelated builds.

## `haskell-nix.tool` — build a tool from Hackage or Source

```nix
pkgs.haskell-nix.tool "ghc9103" "cabal" "3.12.1.0"
pkgs.haskell-nix.tool "ghc9103" "hlint" { version = "3.8"; inherit evalSystem; }
pkgs.haskell-nix.tool "ghc9103" "my-tool" { src = ./path/to/my-tool; }
```

## Using generated source with `haskell-nix.cabalProject`

If possible try to avoid generated source. If you do have
to generate source avoid large monolythic source derivations.

If the `.cabal` file is not generated use:

```
modules = [{
packages.package-name.src = generatedSrc;
}];
```

If the `.cabal` file is also generated use:

```
cabalProjectLocal = ''
packages: ${generatedSrc};
'';
```

Remove it from `cabal.project` file if necessary.

## Updating the `head.hackage` pin (stale-hash build failures)

`head.hackage.ghc.haskell.org` is a **rolling** repository, so the fixed-output
derivation that runs `cabal v2-update` against it (see
`lib/cabal-project-parser.nix`) goes stale whenever head.hackage updates. Symptom
(hits GHC >= 9.13 / `ghc914-sh` plans that use head.hackage):

```
error: hash mismatch in fixed-output derivation '…-head.hackage.ghc.haskell.org.drv':
specified: sha256-<old>
got: sha256-<new>
```

Fix — build the failing FOD to learn the current hash, then update the
`--sha256:` line of the `head.hackage.ghc.haskell.org` repository block in
`test/cabal.project.local`:

```
nix build /nix/store/…-head.hackage.ghc.haskell.org.drv^out --no-link # prints specified/got
# copy the `got:` value into test/cabal.project.local (the `--sha256:` under `repository head.hackage…`)
```

Expect to redo this periodically; it is inherent to pinning a rolling repo.

## Notes

- `"cabal"` is aliased to package `cabal-install`; other aliases in `overlays/tools.nix`.
- Pass `evalSystem` (a system string) whenever possible; the project's
`evalPackages` option is read-only and derived from it.
- Compilers built with `cabalProject` instead of hadrian (e.g. `ghc914-sh`, the
stable-haskell GHCs) set `passthru.isStableHaskell = true`. Their boot packages
are **not** in the GHC source tree, so the `ghc-boot-packages` /
`ghc-extra-pkgs` machinery in `overlays/ghc-packages.nix` is skipped for them.
17 changes: 11 additions & 6 deletions build.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,24 @@
{ nixpkgs ? haskellNix.sources.nixpkgs-unstable
, nixpkgsArgs ? haskellNix.nixpkgsArgs
, pkgs ? import nixpkgs nixpkgsArgs
, evalPackages ? import nixpkgs nixpkgsArgs
, evalSystem ? pkgs.pkgsBuildBuild.stdenv.hostPlatform.system
, ifdLevel ? 1000
, compiler-nix-name ? throw "No `compiler-nix-name` passed to build.nix"
, haskellNix ? (import ./default.nix {})
}:

let
haskell = pkgs.haskell-nix;
# Master takes `evalPackages` as an argument; here `evalSystem` is the sole
# knob and `evalPackages` is derived from it, via the per-eval-system memoised
# nixpkgs in overlays/haskell.nix, so every consumer sharing an `evalSystem`
# reuses one nixpkgs instance. Only head-hackage.nix needs it directly.
evalPackages = pkgs.haskell-nix.evalPackages.${evalSystem};
buildHaskell = pkgs.buildPackages.haskell-nix;
tool = buildHaskell.tool;
ghcFromTo = from: to: __compareVersions haskell.compiler.${compiler-nix-name}.version from >= 0 && __compareVersions haskell.compiler.${compiler-nix-name}.version to < 0;
in rec {
tests = import ./test/default.nix { inherit pkgs evalPackages ifdLevel compiler-nix-name; };
tests = import ./test/default.nix { inherit pkgs evalSystem ifdLevel compiler-nix-name; };

# See test/head-hackage.nix: the tests use the head.hackage repository
# haskell.nix builds, not the published one.
Expand All @@ -26,14 +31,14 @@ in rec {
tools = pkgs.lib.optionalAttrs (ifdLevel >= 3) (
pkgs.lib.recurseIntoAttrs ({
cabal-latest = tool compiler-nix-name "cabal" ({
inherit evalPackages;
inherit evalSystem;
} // pkgs.lib.optionalAttrs (ghcFromTo "9.13" "9.14") {
inputMap = headHackage.inputMap;
cabalProjectLocal = headHackage.cabalProjectLocal;
});
} // pkgs.lib.optionalAttrs (__compareVersions haskell.compiler.${compiler-nix-name}.version "9.8" < 0) {
hlint-latest = tool compiler-nix-name "hlint" {
inherit evalPackages;
inherit evalSystem;
version = {
"ghc865" = "3.2.8";
"ghc882" = "3.3.6";
Expand All @@ -53,11 +58,11 @@ in rec {
stack =
tool compiler-nix-name "stack" {
version = "2.11.1";
inherit evalPackages;
inherit evalSystem;
};
} // pkgs.lib.optionalAttrs (ghcFromTo "9.0" "9.13") {
"hls" = tool compiler-nix-name "haskell-language-server" {
inherit evalPackages;
inherit evalSystem;
};
})
);
Expand Down
Loading
Loading