Skip to content

Commit a8026bd

Browse files
authored
Update nixpkgs pins (#2250)
* Update nixpkgs pins * ifdLevel 0 * Simplify bootPkgs * Update materialized files * Bump nixpkgs-unstable and ghc911 * Simplify bootPkgs * Simplify bootPkgs * Update ghc911 * Reduce the number of compilers tested * Bump llvm for ghc >=9.10 * Update patch upper bounds * Include clang for useLLVM GHC * ifdLevel 1 * Add materialized files * Disable haskell-gi-overloading (it's too slow to build) * Update patch upper bound * ifdLevel 2 * Fixes for GHC HEAD * ifdLevel 3 * Fixes for GHC HEAD * Fix supported-languages for GHC HEAD * More fixes for GHC HEAD * Possible fix for plugin failure on aarch64-darwin * ifdLevel 0 * ifdLevel 3 * Add emar and emranlib to ghc js builds * Fix `repo-tar` downloads * Fix `repo-tar` downloads * More fixes for ghc HEAD * Fix for GHC 9.6 JS backend * Fix for GHC HEAD JS * ifdLevel 0 * ifdLevel 1 * Avoid building source-pins on hackage (just make sure the components needed are present). * ifdLevel 2 * ifdLevel 3 * Add missing materialized file * Fix gi-gtk test
1 parent e35f00f commit a8026bd

File tree

84 files changed

+10139
-886
lines changed

Some content is hidden

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

84 files changed

+10139
-886
lines changed

ci.nix

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -62,19 +62,17 @@
6262
# from here (so that is no longer cached) also remove ./materialized/ghcXXX.
6363
# Update supported-ghc-versions.md to reflect any changes made here.
6464
nixpkgs.lib.optionalAttrs (nixpkgsName == "R2405") {
65-
ghc94 = false;
6665
ghc96 = false;
6766
ghc98 = false;
6867
} // nixpkgs.lib.optionalAttrs (nixpkgsName == "unstable") {
6968
ghc810 = true;
70-
ghc90 = false;
71-
ghc92 = true;
72-
ghc94 = true;
69+
ghc92 = false;
70+
ghc94 = false;
7371
ghc96 = true;
74-
ghc96llvm = true;
7572
ghc98 = true;
76-
ghc98llvm = true;
73+
ghc98llvm = false;
7774
ghc910 = true;
75+
ghc910llvm = true;
7876
ghc911 = true;
7977
})));
8078
crossSystems = nixpkgsName: nixpkgs: compiler-nix-name:
@@ -85,21 +83,21 @@
8583
&& (__match ".*llvm" compiler-nix-name == null)
8684
&& ((system == "x86_64-linux" && !builtins.elem compiler-nix-name ["ghc884" "ghc902" "ghc928" "ghc948"])
8785
|| (system == "aarch64-linux" && !builtins.elem compiler-nix-name ["ghc884" "ghc902" "ghc928" "ghc948"])
88-
|| (system == "x86_64-darwin" && !builtins.elem compiler-nix-name ["ghc884" "ghc902" "ghc928" "ghc948"])
89-
|| (system == "aarch64-darwin" && !builtins.elem compiler-nix-name ["ghc884" "ghc902" "ghc928" "ghc948"])
86+
|| (system == "x86_64-darwin" && !builtins.elem compiler-nix-name ["ghc884" "ghc902" "ghc928" "ghc948" "ghc966" "ghc982"])
87+
|| (system == "aarch64-darwin" && !builtins.elem compiler-nix-name ["ghc884" "ghc902" "ghc928" "ghc948" "ghc966" "ghc982"])
9088
)) {
9189
inherit (lib.systems.examples) ghcjs;
9290
} // lib.optionalAttrs (
9391
(__match ".*llvm" compiler-nix-name == null)
94-
&& ((system == "x86_64-linux" && !builtins.elem compiler-nix-name ["ghc884" "ghc91120240620"]) # Including GHC HEAD here because the patches for rts/RtsSymbols.c no longer apply and mingwW64 GHC build fails without them
92+
&& ((system == "x86_64-linux" && !builtins.elem compiler-nix-name ["ghc884" "ghc902" "ghc928" "ghc91120240918"]) # Including GHC HEAD here because the patches for rts/RtsSymbols.c no longer apply and mingwW64 GHC build fails without them
9593
|| (system == "x86_64-darwin" && builtins.elem compiler-nix-name []))) { # TODO add ghc versions when we have more darwin build capacity
9694
inherit (lib.systems.examples) mingwW64;
9795
} // lib.optionalAttrs (nixpkgsName == "unstable"
9896
&& (__match ".*llvm" compiler-nix-name == null)
99-
&& ((system == "x86_64-linux" && !builtins.elem compiler-nix-name ["ghc884" "ghc8107" "ghc902" "ghc928"])
97+
&& ((system == "x86_64-linux" && !builtins.elem compiler-nix-name ["ghc884" "ghc8107" "ghc902" "ghc928" "ghc948"])
10098
|| (system == "x86_64-darwin" && builtins.elem compiler-nix-name []))) { # TODO add ghc versions when we have more darwin build capacity
10199
inherit (lib.systems.examples) ucrt64;
102-
} // lib.optionalAttrs (system == "x86_64-linux" && nixpkgsName == "unstable" && !builtins.elem compiler-nix-name ["ghc884"]) {
100+
} // lib.optionalAttrs (system == "x86_64-linux" && nixpkgsName == "unstable" && !builtins.elem compiler-nix-name ["ghc884" "ghc902" "ghc928" "ghc948"]) {
103101
# Musl cross only works on linux
104102
# aarch64 cross only works on linux
105103
inherit (lib.systems.examples) musl64 aarch64-multiplatform;

compiler/ghc/default.nix

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ let
232232
if targetPlatform.isGhcjs
233233
then [ buildPackages.emscripten ]
234234
else if hostPlatform == buildPlatform
235-
then [ targetPackages.stdenv.cc ] ++ lib.optional useLLVM llvmPackages.llvm
235+
then [ targetPackages.stdenv.cc ] ++ lib.optionals useLLVM [llvmPackages.llvm llvmPackages.clang]
236236
else assert targetPlatform == hostPlatform; # build != host == target
237237
[ stdenv.cc ] ++ lib.optional useLLVM buildLlvmPackages.llvm;
238238

@@ -362,14 +362,8 @@ let
362362
# Sometimes we have to dispatch between the bintools wrapper and the unwrapped
363363
# derivation for certain tools depending on the platform.
364364
bintoolsFor = {
365-
# GHC needs install_name_tool on all darwin platforms. On aarch64-darwin it is
366-
# part of the bintools wrapper (due to codesigning requirements), but not on
367-
# x86_64-darwin.
368-
install_name_tool =
369-
if stdenv.targetPlatform.isAarch64
370-
then targetCC.bintools
371-
else targetCC.bintools.bintools;
372-
# Same goes for strip.
365+
# GHC needs install_name_tool on all darwin platforms.
366+
install_name_tool = targetCC.bintools.bintools;
373367
strip =
374368
# TODO(@sternenseemann): also use wrapper if linker == "bfd" or "gold"
375369
if stdenv.targetPlatform.isAarch64
@@ -403,14 +397,26 @@ stdenv.mkDerivation (rec {
403397
done
404398
''
405399
# Use emscripten and the `config.sub` saved by `postPatch`
406-
+ lib.optionalString (targetPlatform.isGhcjs) ''
400+
+ lib.optionalString (targetPlatform.isGhcjs) (''
407401
export CC="${targetCC}/bin/emcc"
408402
export CXX="${targetCC}/bin/em++"
409403
export LD="${targetCC}/bin/emcc"
410-
export NM="${targetCC}/share/emscripten/emnm"
404+
'' + (
405+
# Including AR and RANLIB here breaks tests.js-template-haskell for GHC 9.6
406+
# `LLVM ERROR: malformed uleb128, extends past end`
407+
if builtins.compareVersions ghc-version "9.8" >= 0
408+
then ''
409+
export AR="${targetCC}/bin/emar"
410+
export NM="${targetCC}/share/emscripten/emnm"
411+
export RANLIB="${targetCC}/bin/emranlib"
412+
''
413+
else ''
414+
export NM="${targetCC}/share/emscripten/emnm"
415+
''
416+
) + ''
411417
export EM_CACHE=$(mktemp -d)
412418
mv config.sub.ghcjs config.sub
413-
''
419+
'')
414420
# GHC is a bit confused on its cross terminology, as these would normally be
415421
# the *host* tools.
416422
+ lib.optionalString (!targetPlatform.isGhcjs) (''

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.

lazy-inputs/ghc911/flake.lock

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

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

Lines changed: 75 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -396,6 +396,7 @@ let
396396
# GHCJS 8.10 does not have these
397397
"Cabal-syntax"
398398
"exceptions"
399+
"file-io"
399400
"ghc"
400401
"ghc-bignum"
401402
"ghc-experimental"
@@ -422,6 +423,79 @@ let
422423
evalPackages.jq
423424
];
424425
} (let varname = x: builtins.replaceStrings ["-"] ["_"] x; in ''
426+
PACKAGE_VERSION=${ghc.version}
427+
ProjectVersion=${ghc.version}
428+
429+
# The following logic is from GHC m4/setup_project_version.m4
430+
431+
# Split PACKAGE_VERSION into (possibly empty) parts
432+
VERSION_MAJOR=`echo $PACKAGE_VERSION | sed 's/^\([^.]*\)\(\.\{0,1\}\(.*\)\)$/\1'/`
433+
VERSION_TMP=`echo $PACKAGE_VERSION | sed 's/^\([^.]*\)\(\.\{0,1\}\(.*\)\)$/\3'/`
434+
VERSION_MINOR=`echo $VERSION_TMP | sed 's/^\([^.]*\)\(\.\{0,1\}\(.*\)\)$/\1'/`
435+
ProjectPatchLevel=`echo $VERSION_TMP | sed 's/^\([^.]*\)\(\.\{0,1\}\(.*\)\)$/\3'/`
436+
437+
# Calculate project version as an integer, using 2 digits for minor version
438+
case $VERSION_MINOR in
439+
?) ProjectVersionInt=''${VERSION_MAJOR}0''${VERSION_MINOR} ;;
440+
??) ProjectVersionInt=''${VERSION_MAJOR}''${VERSION_MINOR} ;;
441+
*) echo bad minor version in $PACKAGE_VERSION; exit 1 ;;
442+
esac
443+
# AC_SUBST([ProjectVersionInt])
444+
445+
# The project patchlevel is zero unless stated otherwise
446+
test -z "$ProjectPatchLevel" && ProjectPatchLevel=0
447+
448+
# Save split version of ProjectPatchLevel
449+
ProjectPatchLevel1=`echo $ProjectPatchLevel | sed 's/^\([^.]*\)\(\.\{0,1\}\(.*\)\)$/\1/'`
450+
ProjectPatchLevel2=`echo $ProjectPatchLevel | sed 's/^\([^.]*\)\(\.\{0,1\}\(.*\)\)$/\3/'`
451+
452+
# The project patchlevel1/2 is zero unless stated otherwise
453+
test -z "$ProjectPatchLevel1" && ProjectPatchLevel1=0
454+
test -z "$ProjectPatchLevel2" && ProjectPatchLevel2=0
455+
456+
# AC_SUBST([ProjectPatchLevel1])
457+
# AC_SUBST([ProjectPatchLevel2])
458+
459+
# Remove dots from the patch level; this allows us to have versions like 6.4.1.20050508
460+
ProjectPatchLevel=`echo $ProjectPatchLevel | sed 's/\.//'`
461+
462+
# AC_SUBST([ProjectPatchLevel])
463+
464+
# The version of the GHC package changes every day, since the
465+
# patchlevel is the current date. We don't want to force
466+
# recompilation of the entire compiler when this happens, so for
467+
# GHC HEAD we omit the patchlevel from the package version number.
468+
#
469+
# The ProjectPatchLevel1 > 20000000 iff GHC HEAD. If it's for a stable
470+
# release like 7.10.1 or for a release candidate such as 7.10.1.20141224
471+
# then we don't omit the patchlevel components.
472+
473+
ProjectVersionMunged="$ProjectVersion"
474+
if test "$ProjectPatchLevel1" -gt 20000000; then
475+
ProjectVersionMunged="''${VERSION_MAJOR}.''${VERSION_MINOR}"
476+
fi
477+
# AC_SUBST([ProjectVersionMunged])
478+
479+
# The version used for libraries tightly coupled with GHC (e.g.
480+
# ghc-internal) which need a major version bump for every minor/patchlevel
481+
# GHC version.
482+
# Example: for GHC=9.10.1, ProjectVersionForLib=9.1001
483+
#
484+
# Just like with project version munged, we don't want to use the
485+
# patchlevel version which changes every day, so if using GHC HEAD, the
486+
# patchlevel = 00.
487+
case $VERSION_MINOR in
488+
?) ProjectVersionForLibUpperHalf=''${VERSION_MAJOR}.0''${VERSION_MINOR} ;;
489+
??) ProjectVersionForLibUpperHalf=''${VERSION_MAJOR}.''${VERSION_MINOR} ;;
490+
*) echo bad minor version in $PACKAGE_VERSION; exit 1 ;;
491+
esac
492+
# GHC HEAD uses patch level version > 20000000
493+
case $ProjectPatchLevel1 in
494+
?) ProjectVersionForLib=''${ProjectVersionForLibUpperHalf}0''${ProjectPatchLevel1} ;;
495+
??) ProjectVersionForLib=''${ProjectVersionForLibUpperHalf}''${ProjectPatchLevel1} ;;
496+
*) ProjectVersionForLib=''${ProjectVersionForLibUpperHalf}00
497+
esac
498+
425499
PKGS=""
426500
${pkgs.lib.concatStrings
427501
(builtins.map (name: ''
@@ -441,7 +515,7 @@ let
441515
fi
442516
if [[ "$cabal_file" != "" ]]; then
443517
fixed_cabal_file=$(mktemp)
444-
cat $cabal_file | sed -e 's/@ProjectVersionMunged@/${ghc.version}/g' -e 's/default: *@[A-Za-z0-9]*@/default: False/g' -e 's/@Suffix@//g' > $fixed_cabal_file
518+
cat $cabal_file | sed -e "s/@ProjectVersionMunged@/$ProjectVersionMunged/g" -e "s/@ProjectVersionForLib@/$ProjectVersionForLib/g" -e 's/default: *@[A-Za-z0-9]*@/default: False/g' -e 's/@Suffix@//g' > $fixed_cabal_file
445519
json_cabal_file=$(mktemp)
446520
cabal2json $fixed_cabal_file > $json_cabal_file
447521

lib/load-cabal-plan.nix

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,13 @@ in {
9292
} // pkgs.lib.optionalAttrs (p.pkg-src.type or "" == "source-repo") {
9393
# Replace the source repository packages with versions created when
9494
# parsing the `cabal.project` file.
95-
src = pkgs.lib.lists.elemAt callProjectResults.sourceRepos (pkgs.lib.strings.toInt p.pkg-src.source-repo.location) + "/${p.pkg-src.source-repo.subdir}";
95+
src = pkgs.lib.lists.elemAt callProjectResults.sourceRepos (pkgs.lib.strings.toInt p.pkg-src.source-repo.location)
96+
+ pkgs.lib.optionalString (p.pkg-src.source-repo.subdir != ".") "/${p.pkg-src.source-repo.subdir}";
97+
} // pkgs.lib.optionalAttrs (p.pkg-src.type or "" == "repo-tar") {
98+
src = pkgs.lib.mkDefault (pkgs.fetchurl {
99+
url = p.pkg-src.repo.uri + "${pkgs.lib.optionalString (!pkgs.lib.hasSuffix "/" p.pkg-src.repo.uri) "/"}package/${p.pkg-name}-${p.pkg-version}.tar.gz";
100+
sha256 = p.pkg-src-sha256;
101+
});
96102
} // pkgs.lib.optionalAttrs (cabal2nix ? package-description-override && p.pkg-version == cabal2nix.package.identifier.version) {
97103
# Use the `.cabal` file from the `Cabal2Nix` if it for the matching
98104
# version of the package (the one in the plan).

lib/supported-languages.nix

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -308,5 +308,9 @@ evalPackages.writeTextFile {
308308
${pkgs.lib.optionalString (builtins.compareVersions ghc.version "9.11" >=0) ''
309309
OrPatterns
310310
NoOrPatterns
311+
MultilineStrings
312+
NoMultilineStrings
313+
NamedDefaults
314+
NoNamedDefaults
311315
''}'';
312316
}

materialized/alex-3.2.7.1/plan.json

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

0 commit comments

Comments
 (0)