Skip to content

Commit 12ecc24

Browse files
committedAug 16, 2022
Keep config files and wrapped ghc for cabal-doctest
1 parent 11fe87c commit 12ecc24

File tree

3 files changed

+9
-10
lines changed

3 files changed

+9
-10
lines changed
 

‎builder/comp-builder.nix

+4-3
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,7 @@ let
382382
[ghc buildPackages.removeReferencesTo]
383383
++ executableToolDepends;
384384

385-
outputs = ["out"]
385+
outputs = ["out" "configFiles" "ghc"]
386386
++ (lib.optional enableSeparateDataOutput "data")
387387
++ (lib.optional keepSource "source")
388388
++ (lib.optional writeHieFiles "hie");
@@ -402,9 +402,10 @@ let
402402
'') + commonAttrs.prePatch;
403403

404404
configurePhase = ''
405-
configFiles=$(mktemp -d)
405+
mkdir -p $configFiles
406+
mkdir -p $ghc
407+
wrappedGhc=$ghc
406408
${configFiles.script}
407-
wrappedGhc=$(mktemp -d)
408409
${shellWrappers.script}
409410
PATH=$wrappedGhc/bin:$PATH
410411

‎builder/haddock-builder.nix

+4-5
Original file line numberDiff line numberDiff line change
@@ -63,16 +63,14 @@ let
6363
name = fullName;
6464

6565
passthru = {
66-
configFiles = docsConfigFiles;
67-
6866
# The directory containing the haddock documentation.
6967
haddockDir = lib.const (if doHaddock' then "${docdir drv.doc}/html" else null);
7068
};
7169

7270
# `out` contains the `package.conf.d` files used for building the
7371
# haddock files.
7472
# `doc` contains just the haddock output files.
75-
outputs = ["out"]
73+
outputs = ["out" "configFiles" "ghc"]
7674
++ lib.optional doHaddock' "doc";
7775

7876
propagatedBuildInputs =
@@ -86,9 +84,10 @@ let
8684
++ componentDrv.executableToolDepends;
8785

8886
configurePhase = ''
89-
configFiles=$(mktemp -d)
87+
mkdir -p $configFiles
88+
mkdir -p $ghc
89+
wrappedGhc=$ghc
9090
${docsConfigFiles.script}
91-
wrappedGhc=$(mktemp -d)
9291
${shellWrappers.script}
9392
PATH=$wrappedGhc/bin:$PATH
9493
runHook preConfigure

‎builder/setup-builder.nix

+1-2
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ let
5757
srcSubDir = cleanSrc'.subDir;
5858
srcSubDirPath = cleanSrc'.root + cleanSrc'.subDir;
5959
cleanSrc = cleanSrc';
60-
inherit configFiles;
6160
dwarf = self (drvArgs // { enableDWARF = true; });
6261
smallAddressSpace = self (drvArgs // { smallAddressSpace = true; });
6362
};
@@ -69,9 +68,9 @@ let
6968
platforms = if component.platforms == null then lib.platforms.all else component.platforms;
7069
};
7170

71+
outputs = ["out" "configFiles"];
7272
phases = ["unpackPhase" "patchPhase" "buildPhase" "installPhase"];
7373
buildPhase = ''
74-
configFiles=$(mktemp -d)
7574
mkdir -p $configFiles
7675
${configFiles.script}
7776
runHook preBuild

0 commit comments

Comments
 (0)
Please sign in to comment.