Skip to content

Commit 4880162

Browse files
Update flake.lock (#161)
Fixes: - bump [email protected] - python build failures for the -env. - use unsafeDiscardOutputDependency: Querying the .drvPath causes nix to try and build arp-util, python3.11-setuptools, setuptools-build-hook, scons, serf, llvm, clang, libredirect, subversion, and openssh. - Windows cross builds - Static ruby - refactor: Explicitly exclude curl options - postgresql static Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 parent 02057eb commit 4880162

File tree

4 files changed

+97
-77
lines changed

4 files changed

+97
-77
lines changed

cross-windows.nix

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,12 @@ let tool-version-map = import ./tool-map.nix;
44
cabal-install = pkgs.pkgsBuildBuild.haskell-nix.nix-tools-unchecked.exes.cabal;
55
# add a trace helper. This will trace a message about disabling a component despite requesting it, if it's not supported in that compiler.
66
compiler-not-in = compiler-list: name: (if __elem compiler-nix-name compiler-list then __trace "No ${name}. Not yet compatible with ${compiler-nix-name}" false else true);
7-
7+
# Exclude zstd support for now, since it's currently broken on mingw32W64:
8+
# https://github.com/NixOS/nixpkgs/issues/333338
9+
curl = pkgs.curl.override ({
10+
zstdSupport = false;
11+
pslSupport = false;
12+
});
813
inherit (pkgs.haskell-nix.iserv-proxy-exes.${compiler-nix-name}) iserv-proxy iserv-proxy-interpreter;
914

1015
dllPkgs = [
@@ -56,7 +61,7 @@ let tool-version-map = import ./tool-map.nix;
5661
# A cabal-install wrapper that sets the appropriate static flags
5762
wrapped-cabal = pkgs.pkgsBuildBuild.writeShellApplication {
5863
name = "cabal";
59-
runtimeInputs = [ cabal-install pkgs.curl ];
64+
runtimeInputs = [ cabal-install curl ];
6065
text = ''
6166
# We do not want to quote NIX_CABAL_FLAGS
6267
# it will leave an empty argument, if they are empty.

flake.lock

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

flake.nix

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,30 @@
3838
cbor-diag = final.callPackage ./pkgs/cbor-diag { };
3939
cddl = final.callPackage ./pkgs/cddl { };
4040
});
41+
42+
musl = (final: prev: prev.lib.optionalAttrs prev.stdenv.hostPlatform.isMusl {
43+
# Fix the following Ruby cross build error:
44+
#
45+
# error: output '/nix/store/6hyyk9wnnxpd5rsr6ivc0s8l1lgvsjrb-ruby-x86_64-unknown-linux-musl-3.3.4'
46+
# is not allowed to refer to the following paths:
47+
# /nix/store/c77wdd4fb0llq37bpmfr73m7s7r1j068-ruby-3.3.4
48+
#
49+
# See https://github.com/NixOS/nixpkgs/issues/347758
50+
ruby = prev.ruby.overrideAttrs (old: {
51+
postInstall = old.postInstall + ''
52+
find $out/${old.passthru.gemPath} -name exts.mk -delete
53+
'';
54+
});
55+
56+
# Tests on static postgresql are failing with:
57+
#
58+
# FATAL: could not load library "/build/postgresql-16.4/.../lib/dict_snowball.so":
59+
# Error relocating /build/postgresql-16.4/tmp_install/nix/store/.../lib/dict_snowball.so:
60+
# pg_any_to_server: symbol not found
61+
postgresql = prev.postgresql.overrideAttrs (_: {
62+
doCheck = false;
63+
});
64+
});
4165
};
4266
supportedSystems = [
4367
"x86_64-linux"
@@ -187,12 +211,15 @@
187211
} "touch $out";
188212
} // (pkgs.lib.mapAttrs' (name: drv:
189213
pkgs.lib.nameValuePair "${name}-env" (
214+
# We need to use unsafeDiscardOutputDependency here, as it will otherwise
215+
# pull in a bunch of dependenceis we don't care about at all from the .drvPath
216+
# query.
190217
let env = pkgs.runCommand "${name}-env.sh" {
191218
requiredSystemFeatures = [ "recursive-nix" ];
192219
nativeBuildInputs = [ pkgs.nix ];
193220
} ''
194221
nix --offline --extra-experimental-features "nix-command flakes" \
195-
print-dev-env ${drv.drvPath} >> $out
222+
print-dev-env '${builtins.unsafeDiscardOutputDependency drv.drvPath}^*' >> $out
196223
'';
197224
# this needs to be linux. It would be great if we could have this
198225
# eval platform agnostic, but flakes don't permit this. A the
@@ -221,7 +248,7 @@
221248
license = pkgs.lib.licenses.asl20;
222249
platforms = pkgs.lib.platforms.unix;
223250
};
224-
})) devShellsWithEvalOnLinux) // {
251+
})) devShells) // {
225252
};
226253
packages.cabalProjectLocal.static = (import ./quirks.nix { pkgs = static-pkgs; static = true; }).template;
227254
packages.cabalProjectLocal.cross-js = (import ./quirks.nix { pkgs = js-pkgs; }).template;

tool-map.nix

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -37,19 +37,11 @@ compiler-nix-name: tool: {
3737
# Use the github source of HLS that is tested with haskell.nix CI
3838
src = { "ghc8107" = pkgs.haskell-nix.sources."hls-2.2";
3939
"ghc902" = pkgs.haskell-nix.sources."hls-2.4";
40-
}.${compiler-nix-name} or pkgs.haskell-nix.sources."hls-2.6";
40+
}.${compiler-nix-name} or pkgs.haskell-nix.sources."hls-2.9";
4141
# `tool` normally ignores the `cabal.project` (if there is one in the hackage source).
4242
# We need to use the github one (since it has settings to make hls build).
4343
cabalProject = __readFile (src + "/cabal.project");
4444
configureArgs = "--disable-benchmarks --disable-tests";
45-
modules = [{
46-
packages.ghcide.patches =
47-
(if compiler-nix-name != "ghc8107" && compiler-nix-name != "ghc902" then [
48-
# The following patch only works with hls-2.6 ...
49-
# https://github.com/haskell/haskell-language-server/issues/4046#issuecomment-1926242056
50-
./extra/ghcide-workaround.diff
51-
] else []);
52-
}];
5345
};
5446
happy = { version = "1.20.1.1"; inherit cabalProjectLocal; };
5547
alex = { version = "3.2.7.3"; inherit cabalProjectLocal; };

0 commit comments

Comments
 (0)