on iko/ghcjs-patch-master help sign in
Make haskell.nix quieter (#944)
dbff20dMichael Peyton Jones
builder/comp-builder.nix+5−3
@@ -76,9 +76,8 @@ let self =
76
76
77let
77let
78 # TODO fix cabal wildcard support so hpack wildcards can be mapped to cabal wildcards
78 # TODO fix cabal wildcard support so hpack wildcards can be mapped to cabal wildcards
79− cleanSrc = if cabal-generator == "hpack" && !(package.cleanHpack or false)
79+ canCleanSource = !(cabal-generator == "hpack" && !(package.cleanHpack or false));
80− then builtins.trace ("Cleaning component source not supported for hpack package: " + name) src
81− else haskellLib.cleanCabalComponent package component src;
80+ cleanSrc = if canCleanSource then haskellLib.cleanCabalComponent package component src else src;
82
81
83 nameOnly = "${package.identifier.name}-${componentId.ctype}-${componentId.cname}";
82 nameOnly = "${package.identifier.name}-${componentId.ctype}-${componentId.cname}";
84
83
@@ -287,6 +286,9 @@ let
287 ++ (lib.optional keepSource "source");
286 ++ (lib.optional keepSource "source");
288
287
289 configurePhase =
288 configurePhase =
289+ (lib.optionalString (!canCleanSource) ''
290+ echo "Cleaning component source not supported, leaving it un-cleaned"
291+ '') +
290 (lib.optionalString keepSource ''
292 (lib.optionalString keepSource ''
291 cp -r . $source
293 cp -r . $source
292 cd $source
294 cd $source
builder/shell-for.nix+6−8
@@ -3,18 +3,13 @@
3{ # `packages` function selects packages that will be worked on in the shell itself.
3{ # `packages` function selects packages that will be worked on in the shell itself.
4 # These packages will not be built by `shellFor`, but their
4 # These packages will not be built by `shellFor`, but their
5 # dependencies will be included in the shell's `ghc-pkg list`.
5 # dependencies will be included in the shell's `ghc-pkg list`.
6− packages ? ps:
7− let
8− selected = haskellLib.selectLocalPackages ps;
6+ packages ? ps: builtins.attrValues (haskellLib.selectLocalPackages ps)
9− in
10− builtins.trace ("Shell for " + toString (builtins.attrNames selected))
11− (builtins.attrValues selected)
12 # `components` function selects components that will be worked on in the shell itself.
7 # `components` function selects components that will be worked on in the shell itself.
13 # By default `shellFor` will include the dependencies of all of the components
8 # By default `shellFor` will include the dependencies of all of the components
14 # in the selected packages. If only as subset of the components will be
9 # in the selected packages. If only as subset of the components will be
15 # worked on in the shell then we can pass a different `components` function
10 # worked on in the shell then we can pass a different `components` function
16 # to select those.
11 # to select those.
17−, components ? ps: lib.concatMap haskellLib.getAllComponents (packages hsPkgs)
12+, components ? ps: lib.concatMap haskellLib.getAllComponents (packages hsPkgs)
18 # Additional packages to be added unconditionally
13 # Additional packages to be added unconditionally
19, additional ? _: []
14, additional ? _: []
20, withHoogle ? true
15, withHoogle ? true
@@ -143,7 +138,10 @@ in
143 "$@"
138 "$@"
144 '');
139 '');
145 phases = ["installPhase"];
140 phases = ["installPhase"];
141+ installPhase = ''
142+ echo "${"Shell for " + toString (builtins.map (p : p.identifier.name) selectedPackages)}"
146− installPhase = "echo $nativeBuildInputs $buildInputs > $out";
143+ echo $nativeBuildInputs $buildInputs > $out
144+ '';
147 LANG = "en_US.UTF-8";
145 LANG = "en_US.UTF-8";
148 LOCALE_ARCHIVE = lib.optionalString (stdenv.hostPlatform.libc == "glibc") "${glibcLocales}/lib/locale/locale-archive";
146 LOCALE_ARCHIVE = lib.optionalString (stdenv.hostPlatform.libc == "glibc") "${glibcLocales}/lib/locale/locale-archive";
149
147
lib/call-cabal-project-to-nix.nix+6−4
@@ -111,8 +111,9 @@ let
111 then index-state
111 then index-state
112 else if cabalProjectIndexState != null
112 else if cabalProjectIndexState != null
113 then cabalProjectIndexState
113 then cabalProjectIndexState
114+ else
115+ let latest-index-state = pkgs.lib.last (builtins.attrNames index-state-hashes);
114− else builtins.trace ("Using latest index state" + (if name == null then "" else " for " + name) + "!")
116+ in builtins.trace ("No index state specified" + (if name == null then "" else " for " + name) + ", using the latest index state that we know about (${latest-index-state})!") latest-index-state;
115− (pkgs.lib.last (builtins.attrNames index-state-hashes));
116
117
117 index-state-pinned = index-state != null || cabalProjectIndexState != null;
118 index-state-pinned = index-state != null || cabalProjectIndexState != null;
118
119
@@ -423,6 +424,8 @@ let
423 ''}
424 ''}
424 export SSL_CERT_FILE=${cacert}/etc/ssl/certs/ca-bundle.crt
425 export SSL_CERT_FILE=${cacert}/etc/ssl/certs/ca-bundle.crt
425 export GIT_SSL_CAINFO=${cacert}/etc/ssl/certs/ca-bundle.crt
426 export GIT_SSL_CAINFO=${cacert}/etc/ssl/certs/ca-bundle.crt
427+
428+ echo "Using index-state ${index-state-found}"
426 HOME=${
429 HOME=${
427 # This creates `.cabal` directory that is as it would have
430 # This creates `.cabal` directory that is as it would have
428 # been at the time `cached-index-state`. We may include
431 # been at the time `cached-index-state`. We may include
@@ -438,8 +441,7 @@ let
438 # Setting the desired `index-state` here in case it was not
441 # Setting the desired `index-state` here in case it was not
439 # from the cabal.project file. This will further restrict the
442 # from the cabal.project file. This will further restrict the
440 # packages used by the solver (cached-index-state >= index-state-found).
443 # packages used by the solver (cached-index-state >= index-state-found).
441− builtins.trace ("Using index-state: ${index-state-found}" + (if name == null then "" else " for " + name))
442− index-state-found} \
444+ index-state-found} \
443 -w ${
445 -w ${
444 # We are using `-w` rather than `--with-ghc` here to override
446 # We are using `-w` rather than `--with-ghc` here to override
445 # the `with-compiler:` in the `cabal.project` file.
447 # the `with-compiler:` in the `cabal.project` file.