diff --git a/builder/comp-builder.nix b/builder/comp-builder.nix index 808d8c89dd..9cd2b9f90d 100644 --- a/builder/comp-builder.nix +++ b/builder/comp-builder.nix @@ -1,6 +1,4 @@ { pkgs, stdenv, buildPackages, pkgsBuildBuild, ghc, llvmPackages, lib, gobject-introspection ? null, haskellLib, makeConfigFiles, haddockBuilder, ghcForComponent, hsPkgs, compiler, runCommand, libffi, gmp, windows, zlib, ncurses, nodejs, nonReinstallablePkgs }@defaults: -lib.makeOverridable ( -let self = { componentId , component , package @@ -92,7 +90,76 @@ let self = # LLVM , useLLVM ? ghc.useLLVM or false , smallAddressSpace ? false - +}: +# makeOverridable is called here after all the `? DEFAULT` arguments +# will have been applied. This makes sure that `c.override (oldAttrs: {...})` +# includes these `DEFAULT` values in `oldAttrs`. This is important +# so that overrides can modify the existing values instead of replacing them. +lib.makeOverridable ( +let self = +{ componentId +, component +, package +, name +, setup +, src +, flags +, cabalFile +, cabal-generator +, patches +, preUnpack +, configureFlags +, prePatch +, postPatch +, preConfigure +, postConfigure +, setupBuildFlags +, preBuild +, postBuild +, preCheck +, postCheck +, setupInstallFlags +, preInstall +, postInstall +, preHaddock +, postHaddock +, shellHook +, configureAllComponents +, allComponent +, build-tools +, pkgconfig +, platforms +, frameworks +, dontPatchELF +, dontStrip +, dontUpdateAutotoolsGnuConfigScripts +, hardeningDisable +, enableStatic +, enableShared +, enableExecutableDynamic +, enableDeadCodeElimination +, writeHieFiles +, ghcOptions +, contentAddressed +, doHaddock +, doHoogle +, hyperlinkSource +, quickjump +, keepConfigFiles +, keepGhc +, keepSource +, setupHaddockFlags +, enableLibraryProfiling +, enableProfiling +, profilingDetail +, doCoverage +, enableSeparateDataOutput +, enableLibraryForGhci +, enableDebugRTS +, enableDWARF +, enableTSanRTS +, useLLVM +, smallAddressSpace }@drvArgs: let @@ -719,4 +786,68 @@ let // lib.optionalAttrs (hardeningDisable != [] || stdenv.hostPlatform.isMusl) { hardeningDisable = hardeningDisable ++ lib.optional stdenv.hostPlatform.isMusl "pie"; }); -in drv; in self) +in drv; in self) { + inherit componentId + component + package + name + setup + src + flags + cabalFile + cabal-generator + patches + preUnpack + configureFlags + prePatch + postPatch + preConfigure + postConfigure + setupBuildFlags + preBuild + postBuild + preCheck + postCheck + setupInstallFlags + preInstall + postInstall + preHaddock + postHaddock + shellHook + configureAllComponents + allComponent + build-tools + pkgconfig + platforms + frameworks + dontPatchELF + dontStrip + dontUpdateAutotoolsGnuConfigScripts + hardeningDisable + enableStatic + enableShared + enableExecutableDynamic + enableDeadCodeElimination + writeHieFiles + ghcOptions + contentAddressed + doHaddock + doHoogle + hyperlinkSource + quickjump + keepConfigFiles + keepGhc + keepSource + setupHaddockFlags + enableLibraryProfiling + enableProfiling + profilingDetail + doCoverage + enableSeparateDataOutput + enableLibraryForGhci + enableDebugRTS + enableDWARF + enableTSanRTS + useLLVM + smallAddressSpace; +} diff --git a/lib/check.nix b/lib/check.nix index 5b9a643560..15270975e5 100644 --- a/lib/check.nix +++ b/lib/check.nix @@ -3,7 +3,7 @@ let self = drvOrig: let # Work around problem running dynamicially linked Android executables with qemu. - drv = drvOrig.override (lib.optionalAttrs stdenv.hostPlatform.isAndroid { setupBuildFlags = ["--ghc-option=-optl-static" ]; }); + drv = drvOrig.override (oldAttrs: lib.optionalAttrs stdenv.hostPlatform.isAndroid { setupBuildFlags = (oldAttrs.setupBuildFlags or []) ++ ["--ghc-option=-optl-static"]; }); component = drv.config; diff --git a/test/th-dlls/default.nix b/test/th-dlls/default.nix index a25fe93b74..8ec1425654 100644 --- a/test/th-dlls/default.nix +++ b/test/th-dlls/default.nix @@ -43,9 +43,9 @@ in recurseIntoAttrs { }; build = packages.th-dlls.components.library; - just-template-haskell = packages.th-dlls.components.exes.just-template-haskell; + just-template-haskell = haskellLib.check packages.th-dlls.components.exes.just-template-haskell; build-ei = packages-ei.th-dlls.components.library; - just-template-haskell-ei = packages-ei.th-dlls.components.exes.just-template-haskell; + just-template-haskell-ei = haskellLib.check packages-ei.th-dlls.components.exes.just-template-haskell; } // optionalAttrs (!(builtins.elem compiler-nix-name ["ghc984" "ghc9122" "ghc9122llvm" "ghc91320250523"] && stdenv.buildPlatform.isx86_64 && stdenv.hostPlatform.isAarch64 # The dependency on `math-functions` somehow breaks GHC 9.6.7 musl profiled builds (only with the external interpreter though)