Skip to content

Commit ed64663

Browse files
authored
Unbreak busted linking. (#2128)
* Unbreak busted linking. We need to pass c++abi as well as c++, however double-conversion does not specify those. * Fix unstable to the last building rev * Restrict the allow-newer to shipped only packages. * Only selectively allow newer in tests * Bump head.hackage hash (apparenlty some packages changed :-/) * hls-2.4.0.1 does _not_ build with ghc 9.8 * HLS cabal test does not work on 9.8
1 parent 751c328 commit ed64663

File tree

7 files changed

+35
-34
lines changed

7 files changed

+35
-34
lines changed

build.nix

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -68,28 +68,11 @@ in rec {
6868
};
6969
} // pkgs.lib.optionalAttrs (
7070
__compareVersions haskell.compiler.${compiler-nix-name}.version "9.0" >= 0 &&
71-
__compareVersions haskell.compiler.${compiler-nix-name}.version "9.9" < 0
71+
__compareVersions haskell.compiler.${compiler-nix-name}.version "9.8" < 0
7272
) {
7373
"hls-24" = tool compiler-nix-name "haskell-language-server" {
7474
inherit evalPackages;
7575
src = pkgs.haskell-nix.sources."hls-2.4";
76-
# Even though this is in the cabal.project it is inside a condional
77-
# and so haskell.nix cannot parse it properly. Luckily adding it
78-
# again seems to work fine.
79-
cabalProjectLocal = ''
80-
repository head.hackage.ghc.haskell.org
81-
url: https://ghc.gitlab.haskell.org/head.hackage/
82-
secure: True
83-
key-threshold: 3
84-
root-keys:
85-
f76d08be13e9a61a377a85e2fb63f4c5435d40f8feb3e12eb05905edb8cdea89
86-
26021a13b401500c8eb2761ca95c61f2d625bfef951b939a8124ed12ecf07329
87-
7541f32a4ccca4f97aea3b22f5e593ba2c0267546016b992dfadcd2fe944e55d
88-
--sha256: sha256-aVI93DtHziicNn2mGli0YE+bC5BeT7mOQQETp2Thi68=
89-
90-
if impl(ghc < 9.7)
91-
active-repositories: hackage.haskell.org
92-
'';
9376
};
9477
})
9578
);

flake.lock

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

flake.nix

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,10 @@
1010
nixpkgs-2211 = { url = "github:NixOS/nixpkgs/nixpkgs-22.11-darwin"; };
1111
nixpkgs-2305 = { url = "github:NixOS/nixpkgs/nixpkgs-23.05-darwin"; };
1212
nixpkgs-2311 = { url = "github:NixOS/nixpkgs/nixpkgs-23.11-darwin"; };
13-
nixpkgs-unstable = { url = "github:NixOS/nixpkgs/nixpkgs-unstable"; };
13+
# The libsodium bump in 85c6e70b555fe892a049fa3d9dce000dc23a9562 breaks th-dll tests.
14+
# And later it breaks in th-dll due to some change in the windows libs. We should probably
15+
# drop unsable.
16+
nixpkgs-unstable = { url = "github:NixOS/nixpkgs?rev=47585496bcb13fb72e4a90daeea2f434e2501998"; }; # nixpkgs-unstable };
1417
ghc98X = {
1518
flake = false;
1619
url = "git+https://gitlab.haskell.org/ghc/ghc?ref=ghc-9.8&submodules=1";
@@ -24,7 +27,7 @@
2427
"hls-2.0" = { url = "github:haskell/haskell-language-server/2.0.0.1"; flake = false; };
2528
"hls-2.2" = { url = "github:haskell/haskell-language-server/2.2.0.0"; flake = false; };
2629
"hls-2.3" = { url = "github:haskell/haskell-language-server/2.3.0.0"; flake = false; };
27-
"hls-2.4" = { url = "github:haskell/haskell-language-server/2.4.0.0"; flake = false; };
30+
"hls-2.4" = { url = "github:haskell/haskell-language-server/2.4.0.1"; flake = false; };
2831
hydra.url = "hydra";
2932
hackage = {
3033
url = "github:input-output-hk/hackage.nix";

overlays/bootstrap.nix

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1272,7 +1272,11 @@ in {
12721272
# version of nix-tools (on platforms where we cannot use the
12731273
# static nix-tools).
12741274
cabalProjectLocal = ''
1275-
allow-newer: *:*
1275+
-- allow newer packages, that are bound to be newer due to
1276+
-- being shipped with a newer compiler. If you extend this
1277+
-- be very careful to only extend it for absolutely necessary packages
1278+
-- otherwise we risk running into broken build-plans down the line.
1279+
allow-newer: *:base, *:template-haskell, *:bytestring, *:text
12761280
12771281
repository head.hackage.ghc.haskell.org
12781282
url: https://ghc.gitlab.haskell.org/head.hackage/
@@ -1282,7 +1286,7 @@ in {
12821286
f76d08be13e9a61a377a85e2fb63f4c5435d40f8feb3e12eb05905edb8cdea89
12831287
26021a13b401500c8eb2761ca95c61f2d625bfef951b939a8124ed12ecf07329
12841288
7541f32a4ccca4f97aea3b22f5e593ba2c0267546016b992dfadcd2fe944e55d
1285-
--sha256: sha256-aVI93DtHziicNn2mGli0YE+bC5BeT7mOQQETp2Thi68=
1289+
--sha256: sha256-Bkn2Etb0JVmb7tM7jxuIoYLFnSp7acqraEYVq0I5oUM=
12861290
12871291
active-repositories: hackage.haskell.org, head.hackage.ghc.haskell.org:override
12881292
'';

overlays/darwin.nix

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,13 @@ _final: prev:
1414
# https://github.com/NixOS/nixpkgs/pull/47676
1515
# https://github.com/NixOS/nixpkgs/issues/45042
1616
x509-system.components.library.preBuild = "substituteInPlace System/X509/MacOS.hs --replace security /usr/bin/security";
17+
} // pkgs.lib.optionalAttrs (pkgs.stdenv.hostPlatform.isDarwin)
18+
{
19+
# fix broken c++ library selection for GHC < 9.4
20+
# for GHC >= 9.4 the system-cxx-std-lib pseudo-package does this.
21+
double-conversion.components.library.preConfigure = ''
22+
substituteInPlace double-conversion.cabal --replace 'extra-libraries: c++' 'extra-libraries: c++ c++abi'
23+
'';
1724
};
1825
})
1926
];

test/cabal.project.local

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
if impl(ghc>=9.8)
2-
allow-newer: *:*
2+
-- allow newer packages, that are bound to be newer due to
3+
-- being shipped with a newer compiler. If you extend this
4+
-- be very careful to only extend it for absolutely necessary packages
5+
-- otherwise we risk running into broken build-plans down the line.
6+
allow-newer: *:base, *:template-haskell, *:bytestring, *:text, *:ghc-prim, *:deepseq
37

48
repository head.hackage.ghc.haskell.org
59
url: https://ghc.gitlab.haskell.org/head.hackage/
@@ -9,7 +13,7 @@ repository head.hackage.ghc.haskell.org
913
f76d08be13e9a61a377a85e2fb63f4c5435d40f8feb3e12eb05905edb8cdea89
1014
26021a13b401500c8eb2761ca95c61f2d625bfef951b939a8124ed12ecf07329
1115
7541f32a4ccca4f97aea3b22f5e593ba2c0267546016b992dfadcd2fe944e55d
12-
--sha256: sha256-aVI93DtHziicNn2mGli0YE+bC5BeT7mOQQETp2Thi68=
16+
--sha256: sha256-Bkn2Etb0JVmb7tM7jxuIoYLFnSp7acqraEYVq0I5oUM=
1317

1418
repository ghcjs-overlay
1519
url: https://raw.githubusercontent.com/input-output-hk/hackage-overlay-ghcjs/91f4ce9bea0e7f739b7495647c3f72a308ed1c6f

test/haskell-language-server/cabal.nix

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ let
1616
f76d08be13e9a61a377a85e2fb63f4c5435d40f8feb3e12eb05905edb8cdea89
1717
26021a13b401500c8eb2761ca95c61f2d625bfef951b939a8124ed12ecf07329
1818
7541f32a4ccca4f97aea3b22f5e593ba2c0267546016b992dfadcd2fe944e55d
19-
--sha256: sha256-aVI93DtHziicNn2mGli0YE+bC5BeT7mOQQETp2Thi68=
19+
--sha256: sha256-Bkn2Etb0JVmb7tM7jxuIoYLFnSp7acqraEYVq0I5oUM=
2020
2121
if impl(ghc < 9.7)
2222
active-repositories: hackage.haskell.org
@@ -33,5 +33,5 @@ in recurseIntoAttrs {
3333
meta.disabled =
3434
stdenv.hostPlatform != stdenv.buildPlatform
3535
|| __compareVersions buildPackages.haskell-nix.compiler.${compiler-nix-name}.version "9.0.1" < 0
36-
|| __compareVersions buildPackages.haskell-nix.compiler.${compiler-nix-name}.version "9.9.0" >= 0;
36+
|| __compareVersions buildPackages.haskell-nix.compiler.${compiler-nix-name}.version "9.8.0" >= 0;
3737
}

0 commit comments

Comments
 (0)