on iko/ghcjs-patch-master help sign in
Throw better error when conf files are missing (#1030)
feea345Silvan Mosberger
builder/comp-builder.nix+9−9
@@ -371,7 +371,14 @@ let
371 echo "package-id $id" >> $out/envDep
371 echo "package-id $id" >> $out/envDep
372 else
372 else
373 echo 'ERROR: ${package.identifier.name} id could not be found with ${target-pkg-and-db}'
373 echo 'ERROR: ${package.identifier.name} id could not be found with ${target-pkg-and-db}'
374− exit 0
374+ exit 1
375+ fi
376+ if ver=$(${target-pkg-and-db} field ${package.identifier.name} version --simple-output); then
377+ echo "constraint: ${package.identifier.name} == $ver" >> $out/exactDep/cabal.config
378+ echo "constraint: ${package.identifier.name} installed" >> $out/exactDep/cabal.config
379+ else
380+ echo 'ERROR: ${package.identifier.name} version could not be found with ${target-pkg-and-db}'
381+ exit 1
375 fi
382 fi
376 ''
383 ''
377 else
384 else
@@ -389,17 +396,10 @@ let
389 echo "--dependency=${package.identifier.name}:''${name#z-${package.identifier.name}-z-}=$id" >> $out/exactDep/configure-flags
396 echo "--dependency=${package.identifier.name}:''${name#z-${package.identifier.name}-z-}=$id" >> $out/exactDep/configure-flags
390 else
397 else
391 echo 'ERROR: ${package.identifier.name} id could not be found with ${target-pkg-and-db}'
398 echo 'ERROR: ${package.identifier.name} id could not be found with ${target-pkg-and-db}'
392− exit 0
399+ exit 1
393 fi
400 fi
394 '')
401 '')
395 }
402 }
396− if ver=$(${target-pkg-and-db} field ${package.identifier.name} version --simple-output); then
397− echo "constraint: ${package.identifier.name} == $ver" >> $out/exactDep/cabal.config
398− echo "constraint: ${package.identifier.name} installed" >> $out/exactDep/cabal.config
399− else
400− echo 'ERROR: ${package.identifier.name} version could not be found with ${target-pkg-and-db}'
401− exit 0
402− fi
403 ''}
403 ''}
404 ${(lib.optionalString (haskellLib.isTest componentId || haskellLib.isBenchmark componentId) ''
404 ${(lib.optionalString (haskellLib.isTest componentId || haskellLib.isBenchmark componentId) ''
405 mkdir -p $out/bin
405 mkdir -p $out/bin
builder/make-config-files.nix+14−2
@@ -93,12 +93,24 @@ let
93
93
94 for l in "${cfgFiles}"; do
94 for l in "${cfgFiles}"; do
95 if [ -n "$l" ]; then
95 if [ -n "$l" ]; then
96+ files=("$l/${packageCfgDir}/"*.conf)
97+ if (( ''${#files[@]} )); then
96− cp -f "$l/${packageCfgDir}/"*.conf $out/${packageCfgDir}
98+ cp -f "''${files[@]}" $out/${packageCfgDir}
99+ else
100+ echo "$l/${packageCfgDir} didn't contain any *.conf files!"
101+ exit 1
102+ fi
97 fi
103 fi
98 done
104 done
99 for l in "${libs}"; do
105 for l in "${libs}"; do
100 if [ -n "$l" ]; then
106 if [ -n "$l" ]; then
107+ files=("$l/package.conf.d/"*.conf)
108+ if (( ''${#files[@]} )); then
101− cp -f "$l/package.conf.d/"*.conf $out/${packageCfgDir}
109+ cp -f "''${files[@]}" $out/${packageCfgDir}
110+ else
111+ echo "$l/package.conf.d didn't contain any *.conf files!"
112+ exit 1
113+ fi
102 fi
114 fi
103 done
115 done
104
116
ci.nix+5−1
@@ -25,6 +25,7 @@
25 # Update supported-ghc-versions.md to reflect any changes made here.
25 # Update supported-ghc-versions.md to reflect any changes made here.
26 {
26 {
27 ghc865 = true;
27 ghc865 = true;
28+ ghc884 = false; # Just included because the native version is needed at eval time
28 } // nixpkgs.lib.optionalAttrs (nixpkgsName == "R2009") {
29 } // nixpkgs.lib.optionalAttrs (nixpkgsName == "R2009") {
29 ghc883 = false;
30 ghc883 = false;
30 ghc884 = true;
31 ghc884 = true;
@@ -51,9 +52,12 @@
51 || (nixpkgsName == "R2003" && __elem compiler-nix-name ["ghc865"]))) {
52 || (nixpkgsName == "R2003" && __elem compiler-nix-name ["ghc865"]))) {
52 # Windows cross compilation is currently broken on macOS
53 # Windows cross compilation is currently broken on macOS
53 inherit (lib.systems.examples) mingwW64;
54 inherit (lib.systems.examples) mingwW64;
54− } // lib.optionalAttrs (system == "x86_64-linux") {
55+ } // lib.optionalAttrs (system == "x86_64-linux"
56+ && !(nixpkgsName == "R2003" && compiler-nix-name == "ghc884")) {
55 # Musl cross only works on linux
57 # Musl cross only works on linux
56 # aarch64 cross only works on linux
58 # aarch64 cross only works on linux
59+ # We also skip these for the R2003 was build of ghc884 (we only need the
60+ # native so ifdLevel 1 includes compiler needed in ifdLevel2 eval)
57 inherit (lib.systems.examples) musl64 aarch64-multiplatform;
61 inherit (lib.systems.examples) musl64 aarch64-multiplatform;
58 };
62 };
59 isDisabled = d:
63 isDisabled = d:
compiler/ghc/default.nix+4−4
@@ -285,19 +285,19 @@ stdenv.mkDerivation (rec {
285 # Sanity checks for https://github.com/input-output-hk/haskell.nix/issues/660
285 # Sanity checks for https://github.com/input-output-hk/haskell.nix/issues/660
286 if ! "$out/bin/${targetPrefix}ghc" --version; then
286 if ! "$out/bin/${targetPrefix}ghc" --version; then
287 echo "ERROR: Missing file $out/bin/${targetPrefix}ghc"
287 echo "ERROR: Missing file $out/bin/${targetPrefix}ghc"
288− exit 0
288+ exit 1
289 fi
289 fi
290 if ! "$out/bin/${targetPrefix}ghc-pkg" --version; then
290 if ! "$out/bin/${targetPrefix}ghc-pkg" --version; then
291 echo "ERROR: Missing file $out/bin/${targetPrefix}ghc-pkg"
291 echo "ERROR: Missing file $out/bin/${targetPrefix}ghc-pkg"
292− exit 0
292+ exit 1
293 fi
293 fi
294 if [[ ! -d "$out/lib/${targetPrefix}ghc-${version}" ]]; then
294 if [[ ! -d "$out/lib/${targetPrefix}ghc-${version}" ]]; then
295 echo "ERROR: Missing directory $out/lib/${targetPrefix}ghc-${version}"
295 echo "ERROR: Missing directory $out/lib/${targetPrefix}ghc-${version}"
296− exit 0
296+ exit 1
297 fi
297 fi
298 if (( $(ls -1 "$out/lib/${targetPrefix}ghc-${version}" | wc -l) < 30 )); then
298 if (( $(ls -1 "$out/lib/${targetPrefix}ghc-${version}" | wc -l) < 30 )); then
299 echo "ERROR: Expected more files in $out/lib/${targetPrefix}ghc-${version}"
299 echo "ERROR: Expected more files in $out/lib/${targetPrefix}ghc-${version}"
300− exit 0
300+ exit 1
301 fi
301 fi
302 '';
302 '';
303
303
mk-local-hackage-repo/default.nix+1−1
@@ -31,7 +31,7 @@ ${
31 pkgs.lib.optionalString (index ? outputHash) ''
31 pkgs.lib.optionalString (index ? outputHash) ''
32 if [[ "${index.outputHash}" != "$index_sha256" ]]; then
32 if [[ "${index.outputHash}" != "$index_sha256" ]]; then
33 echo "ERROR See https://github.com/input-output-hk/haskell.nix/issues/884"
33 echo "ERROR See https://github.com/input-output-hk/haskell.nix/issues/884"
34− exit 0
34+ exit 1
35 fi
35 fi
36''}
36''}
37export index_length=$(stat --printf="%s" ${index})
37export index_length=$(stat --printf="%s" ${index})
test/index-state/default.nix+2−2
@@ -26,11 +26,11 @@ in
26 buildCommand = ''
26 buildCommand = ''
27 if [[ "${version-before}" != "0.6.0.0" ]]; then
27 if [[ "${version-before}" != "0.6.0.0" ]]; then
28 echo 'Unexpected version ${version-before} (expected "0.6.0.0")'
28 echo 'Unexpected version ${version-before} (expected "0.6.0.0")'
29− exit 0
29+ exit 1
30 fi
30 fi
31 if [[ "${version-after}" != "0.6.0.1" ]]; then
31 if [[ "${version-after}" != "0.6.0.1" ]]; then
32 echo 'Unexpected version ${version-after} (expected "0.6.0.1")'
32 echo 'Unexpected version ${version-after} (expected "0.6.0.1")'
33− exit 0
33+ exit 1
34 fi
34 fi
35
35
36 touch $out
36 touch $out