Skip to content

Commit 9e552b1

Browse files
authored
Add nixpkgs-2505 (#2377)
* Add nixpkgs-2505 * Fix EM_CACHE issue * fix ghcjs * Update ghc913 * Disable ghc 9.10.2 js backend * Update supported-languages.nix * Bump head.hackage * Fix for GHC HEAD * Bump head.hackage * Disable static libraries for GHCJS * Update nixpkgs pins * Fix missing `pkgs` arg * nix flake update iserv-proxy * nix flake update iserv-proxy * Fix fatal error: 'rts/Types.h' file not found * Run CI for GHC 9.10.2 JS * Disable broken tests * Disable broken test * Bump head.hackage * Don't run CI for GHC 9.10.2 JS * Fix debug info check * Drop nixpkgs-2411 from CI * Fix for armv7a-android * Fix dynamic link check for darwin * nix flake update iserv-proxy * Add comment * nix flake update iserv-proxy * Disable broken tests * Skip broken android cross compile
1 parent ff3259c commit 9e552b1

File tree

17 files changed

+98
-40
lines changed

17 files changed

+98
-40
lines changed

builder/comp-builder.nix

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -447,6 +447,10 @@ let
447447
(lib.optionalString stdenv.hostPlatform.isGhcjs ''
448448
export HOME=$(mktemp -d)
449449
export EM_CACHE=$(mktemp -d)
450+
if [ -d ${pkgsBuildBuild.emscripten}/share/emscripten/cache ]; then
451+
cp -r ${pkgsBuildBuild.emscripten}/share/emscripten/cache/* $EM_CACHE/
452+
chmod +w -R $EM_CACHE
453+
fi
450454
'') +
451455
(lib.optionalString (!canCleanSource) ''
452456
echo "Cleaning component source not supported, leaving it un-cleaned"

ci.nix

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
# short names for nixpkgs versions
2020
nixpkgsVersions = {
21-
"R2411" = inputs.nixpkgs-2411;
21+
"R2505" = inputs.nixpkgs-2505;
2222
"unstable" = inputs.nixpkgs-unstable;
2323
};
2424

@@ -43,6 +43,14 @@
4343
"libdwarf-20181024"
4444
"dwarfdump-20181024"
4545
];
46+
allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [
47+
"android-sdk-ndk"
48+
"android-sdk-platform-tools"
49+
"aarch64-unknown-linux-android-ndk-toolchain-wrapper"
50+
"aarch64-unknown-linux-android-ndk-toolchain"
51+
"armv7a-unknown-linux-androideabi-ndk-toolchain-wrapper"
52+
"armv7a-unknown-linux-androideabi-ndk-toolchain"
53+
];
4654
};
4755
};
4856

@@ -57,7 +65,7 @@
5765
# cabal-install and nix-tools plans. When removing a ghc version
5866
# from here (so that is no longer cached) also remove ./materialized/ghcXXX.
5967
# Update supported-ghc-versions.md to reflect any changes made here.
60-
nixpkgs.lib.optionalAttrs (nixpkgsName == "R2411") {
68+
nixpkgs.lib.optionalAttrs (builtins.elem nixpkgsName ["R2411" "R2505"]) {
6169
ghc96 = true;
6270
ghc98 = true;
6371
ghc910 = true;
@@ -77,11 +85,7 @@
7785
let lib = nixpkgs.lib;
7886
in lib.optionalAttrs (nixpkgsName == "unstable"
7987
&& (__match ".*llvm" compiler-nix-name == null)
80-
&& ((system == "x86_64-linux" && !builtins.elem compiler-nix-name ["ghc902" "ghc928" "ghc948"])
81-
|| (system == "aarch64-linux" && !builtins.elem compiler-nix-name ["ghc902" "ghc928" "ghc948"])
82-
|| (system == "x86_64-darwin" && !builtins.elem compiler-nix-name ["ghc902" "ghc928" "ghc948" "ghc966" "ghc967" "ghc96720250227" "ghc982" "ghc983" "ghc984"])
83-
|| (system == "aarch64-darwin" && !builtins.elem compiler-nix-name ["ghc902" "ghc928" "ghc948" "ghc966" "ghc967" "ghc96720250227" "ghc982" "ghc983" "ghc984"])
84-
)) {
88+
&& !builtins.elem compiler-nix-name ["ghc9102"]) {
8589
inherit (lib.systems.examples) ghcjs;
8690
} // lib.optionalAttrs (nixpkgsName == "unstable"
8791
&& (__match ".*llvm" compiler-nix-name == null)
@@ -100,8 +104,10 @@
100104
} // lib.optionalAttrs (__match ".*llvm" compiler-nix-name == null && system == "x86_64-linux" && nixpkgsName == "unstable" && !builtins.elem compiler-nix-name ["ghc902" "ghc928" "ghc948"]) {
101105
# Out llvm versions of GHC seem to break for musl32
102106
inherit (lib.systems.examples) musl32;
103-
} // lib.optionalAttrs (system == "x86_64-linux" && nixpkgsName == "R2411" && !builtins.elem compiler-nix-name ["ghc902" "ghc928" "ghc948"]) {
104-
inherit (lib.systems.examples) aarch64-android-prebuilt armv7a-android-prebuilt;
107+
} // lib.optionalAttrs (system == "x86_64-linux" && !builtins.elem compiler-nix-name ["ghc902" "ghc928" "ghc948"]) {
108+
inherit (lib.systems.examples) aarch64-android-prebuilt;
109+
} // lib.optionalAttrs (system == "x86_64-linux" && !builtins.elem compiler-nix-name ["ghc902" "ghc928" "ghc948" "ghc91320250523"]) {
110+
inherit (lib.systems.examples) armv7a-android-prebuilt;
105111
} // lib.optionalAttrs (system == "x86_64-linux" && nixpkgsName == "unstable" && !builtins.elem compiler-nix-name ["ghc8107" "ghc902"]) {
106112
# TODO fix this for the compilers we build with hadrian (ghc >=9.4)
107113
inherit (lib.systems.examples) aarch64-multiplatform-musl;

compiler/ghc/default.nix

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -422,9 +422,9 @@ haskell-nix.haskellLib.makeCompilerDeps (stdenv.mkDerivation (rec {
422422
export CXX="${targetCC}/bin/em++"
423423
export LD="${targetCC}/bin/emcc"
424424
'' + (
425-
# Including AR and RANLIB here breaks tests.js-template-haskell for GHC 9.6
425+
# Including AR and RANLIB here breaks tests.js-template-haskell for GHC <9.12
426426
# `LLVM ERROR: malformed uleb128, extends past end`
427-
if builtins.compareVersions ghc-version "9.8" >= 0
427+
if builtins.compareVersions ghc-version "9.12" >= 0
428428
then ''
429429
export AR="${targetCC}/bin/emar"
430430
export NM="${targetCC}/share/emscripten/emnm"
@@ -435,6 +435,10 @@ haskell-nix.haskellLib.makeCompilerDeps (stdenv.mkDerivation (rec {
435435
''
436436
) + ''
437437
export EM_CACHE=$(mktemp -d)
438+
if [ -d ${targetCC}/share/emscripten/cache ]; then
439+
cp -r ${targetCC}/share/emscripten/cache/* $EM_CACHE/
440+
chmod +w -R $EM_CACHE
441+
fi
438442
mv config.sub.ghcjs config.sub
439443
'')
440444
# GHC is a bit confused on its cross terminology, as these would normally be

default.nix

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,9 @@ self // {
9797
pkgs-2411 = import self.inputs.nixpkgs-2411 (nixpkgsArgs // {
9898
localSystem = { inherit system; };
9999
});
100+
pkgs-2505 = import self.inputs.nixpkgs-2505 (nixpkgsArgs // {
101+
localSystem = { inherit system; };
102+
});
100103
pkgs-unstable = import self.inputs.nixpkgs-unstable (nixpkgsArgs // {
101104
localSystem = { inherit system; };
102105
});

flake.lock

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

flake.nix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
nixpkgs-2311 = { url = "github:NixOS/nixpkgs/nixpkgs-23.11-darwin"; };
88
nixpkgs-2405 = { url = "github:NixOS/nixpkgs/nixpkgs-24.05-darwin"; };
99
nixpkgs-2411 = { url = "github:NixOS/nixpkgs/nixpkgs-24.11-darwin"; };
10+
nixpkgs-2505 = { url = "github:NixOS/nixpkgs/nixpkgs-25.05-darwin"; };
1011
nixpkgs-unstable = { url = "github:NixOS/nixpkgs/nixpkgs-unstable"; };
1112
flake-compat = { url = "github:input-output-hk/flake-compat/hkm/gitlab-fix"; flake = false; };
1213
"hls-1.10" = { url = "github:haskell/haskell-language-server/1.10.0.0"; flake = false; };

lazy-inputs/ghc913/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/supported-languages.nix

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -312,5 +312,11 @@ evalPackages.writeTextFile {
312312
NoMultilineStrings
313313
NamedDefaults
314314
NoNamedDefaults
315+
''
316+
+ pkgs.lib.optionalString (builtins.compareVersions ghc.version "9.13" >=0) ''
317+
ExplicitLevelImports
318+
ImplicitStagePersistence
319+
NoExplicitLevelImports
320+
NoImplicitStagePersistence
315321
''}'';
316322
}

modules/component-options.nix

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{ lib, haskellLib, ... }:
1+
{ pkgs, lib, haskellLib, ... }:
22
{
33
options = {
44
buildable = lib.mkOption {
@@ -104,7 +104,8 @@
104104
enableStatic = lib.mkOption {
105105
description = "If set, enables building static libraries and executables.";
106106
type = lib.types.bool;
107-
default = true;
107+
# Disabled for ghcjs, see https://gitlab.haskell.org/ghc/ghc/-/issues/23235
108+
default = !pkgs.stdenv.hostPlatform.isGhcjs;
108109
};
109110

110111
enableShared = lib.mkOption {

modules/package.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ let
1010

1111
componentType = types.submodule [
1212
./component.nix
13-
{ _module.args = { inherit haskellLib; }; }
13+
{ _module.args = { inherit pkgs haskellLib; }; }
1414
# pass down common options as default values
1515
({ lib, options, ... }: lib.mkDefault (lib.filterAttrs (n: _v: builtins.hasAttr n options) config))
1616
];

overlays/bootstrap.nix

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -331,6 +331,9 @@ in {
331331

332332
++ onAndroid (from "9.6" ./patches/ghc/ghc-9.6-COMPAT_R_ARM_PREL31.patch)
333333
++ onAndroid (from "9.10" ./patches/ghc/ghc-9.10-ignore-libc.patch)
334+
335+
# Fix for `fatal error: 'rts/Types.h' file not found` when building `primitive`
336+
++ onGhcjs (from "9.13" ./patches/ghc/ghc-9.13-ghcjs-rts-types.patch)
334337
;
335338
in ({
336339
ghc8107 = traceWarnOld "8.10" (final.callPackage ../compiler/ghc {
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
diff --git a/rts/rts.cabal b/rts/rts.cabal
2+
index 899e65d712..84dac99f54 100644
3+
--- a/rts/rts.cabal
4+
+++ b/rts/rts.cabal
5+
@@ -160,6 +160,7 @@ library
6+
stg/MachRegs/x86.h
7+
stg/MachRegsForHost.h
8+
stg/Types.h
9+
+ rts/Types.h
10+
11+
else
12+
-- If we are using an in-tree libffi then we must declare it as a bundled

test/cabal-22/default.nix

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ in recurseIntoAttrs {
3737
'' +
3838
# Aarch is statically linked and does not produce a .so file.
3939
# Musl is also statically linked, but it does make a .so file so we should check that still.
40-
optionalString (!stdenv.hostPlatform.isAarch32 && !stdenv.hostPlatform.isAarch64) (''
40+
optionalString (!stdenv.hostPlatform.isAarch32 && !stdenv.hostPlatform.isAarch64 || stdenv.hostPlatform.isDarwin) (''
4141
printf "checking that executable is dynamically linked to system libraries... " >& 2
4242
'' + optionalString (stdenv.isLinux && !stdenv.hostPlatform.isMusl) ''
4343
${haskellLib.lddForTests} $exe | grep 'libc[.]so'
@@ -57,7 +57,7 @@ in recurseIntoAttrs {
5757
'' + optionalString stdenv.isLinux ''
5858
${haskellLib.lddForTests} $sofile | grep libHSghc-prim
5959
'' + optionalString stdenv.isDarwin ''
60-
otool -L $sofile | grep libHSghc-prim
60+
otool -L $sofile | grep libHSghc-
6161
'')) + ''
6262
touch $out
6363

test/cabal-simple-debug/default.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ in recurseIntoAttrs {
3939
else ''
4040
(${dwarfdump}/bin/dwarfdump $exe || true) | grep -c 'libraries/base/[A-Za-z0-9/]*\.hs'
4141
''}
42-
(${dwarfdump}/bin/dwarfdump $exe || true) | grep -c '/Main\.hs'
42+
(${dwarfdump}/bin/dwarfdump $exe || true) | grep -c 'Main\.hs'
4343
4444
touch $out
4545
'';

test/cabal.project.local

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@ if impl(ghc > 9.13)
99
allow-newer: *:containers, *:time, *:ghc-bignum
1010
constraints: base-compat >=0.14.0, aeson >=2.2.1.0
1111
-- From https://ghc.gitlab.haskell.org/head.hackage/cabal.constraints
12-
constraints: extra ==1.7.14
13-
constraints: base-orphans <0.9.3 || >0.9.3
12+
-- Nothing needed right now
1413

1514
-- This prevents hsc2hs from causing old versions of packages from being added to plan.json
1615
allow-newer: hsc2hs:*
@@ -23,7 +22,7 @@ repository head.hackage.ghc.haskell.org
2322
f76d08be13e9a61a377a85e2fb63f4c5435d40f8feb3e12eb05905edb8cdea89
2423
26021a13b401500c8eb2761ca95c61f2d625bfef951b939a8124ed12ecf07329
2524
7541f32a4ccca4f97aea3b22f5e593ba2c0267546016b992dfadcd2fe944e55d
26-
--sha256: sha256-ch17nc6wY2lr94j1+MULW7GuwtgQ8vz56yuPSADMmB8=
25+
--sha256: sha256-Zu+OsPXt+tUllxC2LVJ3jneYGUH5GvdemZZPnynWaN0=
2726

2827
repository ghcjs-overlay
2928
url: https://raw.githubusercontent.com/input-output-hk/hackage-overlay-ghcjs/ffb32dce467b9a4d27be759fdd2740a6edd09d0b

test/plugin/default.nix

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ in recurseIntoAttrs {
1919
};
2020

2121
# Not sure why this breaks for ghc 8.10.7
22-
meta.disabled = compiler-nix-name == "ghc8107"
23-
|| builtins.elem compiler-nix-name [ "ghc9121" "ghc912120241215" "ghc91320241230" ]
22+
meta.disabled =
23+
builtins.elem compiler-nix-name [ "ghc91320250523" ]
2424
|| stdenv.hostPlatform.isMusl
2525
|| stdenv.hostPlatform.isGhcjs
2626
|| stdenv.hostPlatform.isWindows

test/th-dlls/default.nix

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,16 @@ in recurseIntoAttrs {
2222
meta.disabled = stdenv.hostPlatform.isGhcjs
2323
# On aarch64 this test also breaks form musl builds (including cross compiles on x86_64-linux)
2424
|| (stdenv.hostPlatform.isAarch64 && stdenv.hostPlatform.isMusl)
25+
# Not sure why this is failing with a seg fault
26+
|| (builtins.elem compiler-nix-name ["ghc9102" "ghc9102llvm"] && stdenv.hostPlatform.isAndroid && stdenv.hostPlatform.isAarch32)
27+
# unhandled ELF relocation(Rel) type 10
28+
|| (stdenv.hostPlatform.isMusl && stdenv.hostPlatform.isx86_32)
29+
30+
## Old GHC versions (TODO remove)
2531
# Failed to lookup symbol: __aarch64_swp8_acq_rel
2632
|| (builtins.elem compiler-nix-name ["ghc947" "ghc948"] && haskellLib.isCrossHost && stdenv.hostPlatform.isAarch64)
27-
# Not sure why this is failing with a seg fault
28-
|| (builtins.elem compiler-nix-name ["ghc9102"] && stdenv.hostPlatform.isAndroid && stdenv.hostPlatform.isAarch32)
2933
# We have been unable to get windows cross compilation of th-orphans to work for GHC 8.10 using the latest nixpkgs
3034
|| (compiler-nix-name == "ghc8107" && stdenv.hostPlatform.isWindows)
31-
# unhandled ELF relocation(Rel) type 10
32-
|| (stdenv.hostPlatform.isMusl && stdenv.hostPlatform.isx86_32)
3335
;
3436

3537
ifdInputs = {
@@ -41,7 +43,7 @@ in recurseIntoAttrs {
4143
build-ei = packages-ei.th-dlls.components.library;
4244
just-template-haskell-ei = packages-ei.th-dlls.components.exes.just-template-haskell;
4345
} // optionalAttrs
44-
(!(builtins.elem compiler-nix-name ["ghc984" "ghc9121" "ghc912120241215" "ghc91320241230" "ghc912120250219"] && stdenv.buildPlatform.isx86_64 && stdenv.hostPlatform.isAarch64)) {
46+
(!(builtins.elem compiler-nix-name ["ghc984" "ghc9122" "ghc91320250523"] && stdenv.buildPlatform.isx86_64 && stdenv.hostPlatform.isAarch64)) {
4547
# On for aarch64 cross compile on GHC this test is fails sometimes for non profiled builds
4648
# (and always for the profiled builds).
4749
# This may be related to the memory allocation changes made in 9.8.4 that

0 commit comments

Comments
 (0)