Scope compiler selection to the cached Hydra build context

This commit is contained in:
Moritz Angermann committed 2026-10-15 18:03:46 +09:00
1 parent 94ad3c9595
commit 251f342313
3 files changed
+13

No files matched your search

+2
View File
@@ -37,6 +37,7 @@
}; in
# `appendOverlays` with a singleton is identical to `extend`.
let pkgs = haskellNix.legacyPackages.${system}.appendOverlays [android26]; in
let compilerSelection = import ./scripts/nix/compiler-selection.nix { inherit haskellNix; }; in
let drv' = { extra-modules, pkgs', package-flags ? {}, package-ghc-options ? {}, ... }:
let packageFlags = pkgs.lib.recursiveUpdate {
direct-sqlcipher = { openssl = true; commoncrypto = false; tomcrypt = false; };
@@ -47,6 +48,7 @@
}) package-ghc-options;
in pkgs'.haskell-nix.project {
compiler-nix-name = "ghc914-sh";
inherit compilerSelection;
# We need this, to specify we want the cabal project.
# If the stack.yaml was dropped, this would not be necessary.
projectFileName = "cabal.project";
+4
View File
@@ -5,6 +5,10 @@ The compiler and all cross-compilers come from the haskell.nix input pinned in
GHC 9.14 release from GHCup. Use the same source checkout and lock file for every
platform; Android ARMv7 does not require a separate branch or tag.
`compiler-selection.nix` matches Hydra's compiler build context so the pinned
compiler can use its existing cache. That context is scoped to the compiler and
its build tools; application dependencies keep the project's current packages.
Run these commands from the repository root:
```sh
+7
View File
@@ -0,0 +1,7 @@
{ haskellNix }:
pkgs:
# Hydra's compiler builds use this overlay. Its pkg-config metadata changes
# the Cabal build tool's hash, and therefore every compiler slice's hash.
# Keep that context inside compiler selection: application dependencies still
# use the project's package set and its current libsodium mapping.
(pkgs.appendOverlays [ (import (haskellNix + "/test/overlay.nix")) ]).haskell-nix.compiler