Skip to content

Commit 1086081

Browse files
committed
Merge branch 'master' of github.com:input-output-hk/haskell.nix into circuithub
2 parents d8d8fe3 + 834a120 commit 1086081

File tree

3,673 files changed

+252217
-11739
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

3,673 files changed

+252217
-11739
lines changed

builder/comp-builder.nix

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ let self =
88
, setup
99
, src
1010
, flags
11-
, revision
1211
, cabalFile
1312
, cabal-generator
1413
, patches ? []
@@ -247,12 +246,12 @@ let
247246
&& x.identifier.name or "" != "hsc2hs")
248247
(map
249248
(p: if builtins.isFunction p
250-
then p { inherit (package.identifier) version; inherit revision; }
249+
then p { inherit (package.identifier) version; }
251250
else p) build-tools))) ++
252251
lib.optional (pkgconfig != []) buildPackages.cabalPkgConfigWrapper;
253252

254253
# Unfortunately, we need to wrap ghc commands for cabal builds to
255-
# work in the nix-shell. See ../doc/removing-with-package-wrapper.md.
254+
# work in the nix-shell. See ../docs/dev/removing-with-package-wrapper.md.
256255
shellWrappers = ghcForComponent {
257256
componentName = fullName;
258257
inherit configFiles enableDWARF;
@@ -280,6 +279,9 @@ let
280279

281280
SETUP_HS = setup + /bin/Setup;
282281

282+
inherit cabalFile;
283+
passAsFile = [ "cabalFile" ];
284+
283285
prePatch =
284286
# If the package is in a sub directory `cd` there first.
285287
# In some cases the `cleanSrc.subDir` will be empty and the `.cabal`
@@ -293,7 +295,7 @@ let
293295
''
294296
) +
295297
(if cabalFile != null
296-
then ''cat ${cabalFile} > ${package.identifier.name}.cabal''
298+
then ''cp -v $cabalFilePath ${package.identifier.name}.cabal''
297299
else
298300
# When building hpack package we use the internal nix-tools
299301
# (compiled with a fixed GHC version)
@@ -302,11 +304,11 @@ let
302304
''
303305
);
304306
}
305-
# patches can (if they like) depend on the version and revision of the package.
307+
# patches can (if they like) depend on the version of the package.
306308
// lib.optionalAttrs (patches != []) {
307309
patches = map (p:
308310
if builtins.isFunction p
309-
then p { inherit (package.identifier) version; inherit revision; }
311+
then p { inherit (package.identifier) version; }
310312
else p
311313
) patches;
312314
}
@@ -316,11 +318,15 @@ let
316318
}
317319
// lib.optionalAttrs (stdenv.buildPlatform.libc == "glibc") {
318320
LOCALE_ARCHIVE = "${buildPackages.glibcLocales}/lib/locale/locale-archive";
321+
}
322+
// lib.optionalAttrs stdenv.hostPlatform.isMusl {
323+
# This fixes musl compilation of TH code that depends on C++ (for instance TH code that uses the double-conversion package)
324+
LD_LIBRARY_PATH="${pkgs.buildPackages.gcc-unwrapped.lib}/x86_64-unknown-linux-musl/lib";
319325
};
320326

321327
haddock = haddockBuilder {
322328
inherit componentId component package flags commonConfigureFlags
323-
commonAttrs revision doHaddock
329+
commonAttrs doHaddock
324330
doHoogle hyperlinkSource quickjump setupHaddockFlags
325331
needsProfiling configFiles preHaddock postHaddock pkgconfig;
326332

builder/haddock-builder.nix

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
, component
55
, package
66
, flags
7-
, revision
87
, commonAttrs
98
, preHaddock
109
, postHaddock

builder/hspkg-builder.nix

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@ config:
99
, name
1010
, sha256
1111
, src
12-
, revision
13-
, revisionSha256
12+
, package-description-override
1413
, patches
1514

1615
, shellHook
@@ -48,12 +47,8 @@ let
4847
# repository.
4948
inputMap.${__head baseUrlMatch} + "/package/${__elemAt baseUrlMatch 1}"
5049
else pkg.src;
51-
cabalFile = if revision == null || revision == 0 || bundledSrc != null then null else
52-
fetchurl {
53-
name = "${name}-${toString revision}.cabal";
54-
url = "https://hackage.haskell.org/package/${name}/revision/${toString revision}.cabal";
55-
sha256 = revisionSha256;
56-
};
50+
51+
cabalFile = if package-description-override == null || bundledSrc != null then null else package-description-override;
5752

5853
defaultSetupSrc = if stdenv.hostPlatform.isGhcjs then ./Setup.ghcjs.hs else ./Setup.hs;
5954

@@ -134,12 +129,12 @@ let
134129
extraSrcFiles = components.setup.extraSrcFiles ++ [ "Setup.hs" "Setup.lhs" ];
135130
pkgconfig = if components ? library then components.library.pkgconfig or [] else [];
136131
};
137-
inherit package name src flags revision patches defaultSetupSrc;
132+
inherit package name src flags patches defaultSetupSrc;
138133
inherit (pkg) preUnpack postUnpack;
139134
};
140135

141136
buildComp = allComponent: componentId: component: comp-builder {
142-
inherit allComponent componentId component package name src flags setup cabalFile cabal-generator patches revision
137+
inherit allComponent componentId component package name src flags setup cabalFile cabal-generator patches
143138
shellHook
144139
;
145140
};
@@ -150,7 +145,7 @@ in rec {
150145
(_: d: haskellLib.check d)
151146
(lib.filterAttrs (_: d: d.config.doCheck) components.tests));
152147
inherit (package) identifier detailLevel isLocal isProject buildType;
153-
inherit setup cabalFile;
148+
inherit setup;
154149
isHaskell = true;
155150
inherit src;
156151
}

builder/setup-builder.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ let
105105
cd ${lib.removePrefix "/" cleanSrc'.subDir}
106106
'';
107107
})
108-
// (lib.optionalAttrs (patches != []) { patches = map (p: if builtins.isFunction p then p { inherit (package.identifier) version; inherit revision; } else p) patches; })
108+
// (lib.optionalAttrs (patches != []) { patches = map (p: if builtins.isFunction p then p { inherit (package.identifier) version; } else p) patches; })
109109
// hooks
110110
);
111111
in drv; in self

flake.lock

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/cabal-project-parser.nix

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,6 @@ let
157157
${pkgs.lib.optionalString (attrs ? root-keys) "root-keys: ${attrs.root-keys}"}
158158
${pkgs.lib.optionalString (attrs ? key-threshold) "key-threshold: ${attrs.key-threshold}"}
159159
EOF
160-
161160
cabal v2-update ${name}
162161
cp -r $HOME/.cabal/packages/${name} $out
163162
''
@@ -180,7 +179,6 @@ let
180179
${pkgs.lib.optionalString (attrs ? root-keys) "root-keys: ${attrs.root-keys}"}
181180
${pkgs.lib.optionalString (attrs ? key-threshold) "key-threshold: ${attrs.key-threshold}"}
182181
EOF
183-
184182
export SSL_CERT_FILE=${evalPackages.cacert}/etc/ssl/certs/ca-bundle.crt
185183
cabal v2-update ${name}
186184
cp -r $HOME/.cabal/packages/${name} $out

lib/call-cabal-project-to-nix.nix

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -527,12 +527,8 @@ let
527527
export SSL_CERT_FILE=${cacert}/etc/ssl/certs/ca-bundle.crt
528528
export GIT_SSL_CAINFO=${cacert}/etc/ssl/certs/ca-bundle.crt
529529
530-
# Using `cabal v2-freeze` will configure the project (since
531-
# it is not configured yet), taking the existing `cabal.project.freeze`
532-
# file into account. Then it "writes out a freeze file which
533-
# records all of the versions and flags that are picked" (from cabal docs).
534530
echo "Using index-state ${index-state-found}"
535-
HOME=${
531+
CABAL_DIR=${
536532
# This creates `.cabal` directory that is as it would have
537533
# been at the time `cached-index-state`. We may include
538534
# some packages that will be excluded by `index-state-found`
@@ -543,7 +539,7 @@ let
543539
index-state = cached-index-state;
544540
sha256 = index-sha256-found;
545541
}
546-
} cabal v2-freeze ${
542+
} make-install-plan ${
547543
# Setting the desired `index-state` here in case it is not
548544
# in the cabal.project file. This will further restrict the
549545
# packages used by the solver (cached-index-state >= index-state-found).
@@ -596,6 +592,11 @@ let
596592
# as they should not be in the output hash (they may change slightly
597593
# without affecting the nix).
598594
find $out \( -type f -or -type l \) ! -name '*.nix' -delete
595+
596+
# Make the revised cabal files available (after the delete step avove)
597+
echo "Moving cabal files from $tmp${subDir'}/dist-newstyle/cabal-files to $out${subDir'}/cabal-files"
598+
mv $tmp${subDir'}/dist-newstyle/cabal-files $out${subDir'}/cabal-files
599+
599600
# Remove empty dirs
600601
find $out -type d -empty -delete
601602

materialized/dummy-ghc/ghc-8.10.4.20210212-x86_64-linux/ghc-pkg/dump-global

Lines changed: 1 addition & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

materialized/dummy-ghc/ghc-8.10.4.20210212-x86_64-linux/ghc/info

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)