Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump to nixpkgs-21.11 #111

Closed
wants to merge 15 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[submodule "nixpkgs"]
path = nixpkgs
url = https://github.com/nh2/nixpkgs.git
url = https://github.com/NixOS/nixpkgs.git
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I changed the submodule here to point to NixOS/nixpkgs instead of nh2/nixpkgs.

I'm not very familiar with Git submodules, and I did this while trying to get everything working. If necessary I can change this back.

7 changes: 3 additions & 4 deletions default.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Note: This is just a minimal example. For proper usage, see the README.

{ nixpkgs ? (import ./nixpkgs.nix).pkgsMusl, compiler ? "ghc864", strip ? true }:
{ nixpkgs ? (import ./nixpkgs.nix).pkgsMusl, compiler ? "ghc8107", strip ? true }:


let
Expand All @@ -12,7 +12,7 @@ let
pname = "example-scotty-app";
version = "0.1.0.0";
src = pkgs.lib.sourceByRegex ./. [
".*\.cabal$"
".*\\.cabal$"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this extra escape is necessary.

"^Setup.hs$"
"^Main.hs$"
];
Expand All @@ -21,7 +21,7 @@ let
enableSharedExecutables = false;
enableSharedLibraries = false;
executableHaskellDepends = [ base scotty ];
license = stdenv.lib.licenses.bsd3;
license = pkgs.lib.licenses.bsd3;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

stdenv no longer contains lib in recent Nixpkgs.

configureFlags = [
"--ghc-option=-optl=-static"
"--extra-lib-dirs=${pkgs.gmp6.override { withStatic = true; }}/lib"
Expand All @@ -37,7 +37,6 @@ let
haskellPackages = with pkgs.haskell.lib; normalHaskellPackages.override {
overrides = self: super: {
# Dependencies we need to patch
hpc-coveralls = appendPatch super.hpc-coveralls (builtins.fetchurl https://github.com/guillaume-nargeot/hpc-coveralls/pull/73/commits/344217f513b7adfb9037f73026f5d928be98d07f.patch);
};
};

Expand Down
2 changes: 1 addition & 1 deletion nixpkgs
Submodule nixpkgs updated 13163 files
3 changes: 2 additions & 1 deletion nixpkgs.nix
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,5 @@ if builtins.getEnv "STATIC_HASKELL_NIX_CI_NIXPKGS_UNSTABLE_BUILD" == "1"
if builtins.pathExists ./nixpkgs/pkgs
then import ./nixpkgs {}
# Pinned nixpkgs version; should be kept up-to-date with our submodule.
else import (fetchTarball https://github.com/NixOS/nixpkgs/archive/d00b5a5fa6fe8bdf7005abb06c46ae0245aec8b5.tar.gz) {}
# This is nixos-21.11 as of 2021-12-15.
else import (fetchTarball https://github.com/NixOS/nixpkgs/archive/573095944e7c1d58d30fc679c81af63668b54056.tar.gz) {}
50 changes: 47 additions & 3 deletions survey/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,13 @@ in
])."${approach}",

# When changing this, also change the default version of Cabal declared below
compiler ? "ghc8104",
compiler ? "ghc8107",

# See:
# * https://www.snoyman.com/base/
# * https://www.haskell.org/cabal/download.html
# section "Older Releases"
# * https://gitlab.haskell.org/ghc/ghc/-/wikis/commentary/libraries/version-history
defaultCabalPackageVersionComingWithGhc ?
({
ghc822 = "Cabal_2_2_0_1"; # TODO this is technically incorrect for ghc 8.2.2, should be 2.0.1.0, but nixpkgs doesn't have that
Expand All @@ -38,6 +39,7 @@ in
ghc881 = "Cabal_3_0_0_0";
ghc8104 = "Cabal_3_2_1_0";
ghc8105 = "Cabal_3_2_1_0";
ghc8107 = "Cabal_3_2_1_0";
ghc901 = "Cabal_3_4_0_0";
}."${compiler}"),

Expand Down Expand Up @@ -505,6 +507,7 @@ let
# `archiveFilesOverlay` below where `statify_curl_including_exe` is used.
gssSupport = false;
zlib = zlib_both;
brotliSupport = false;
})).overrideAttrs (old: {
dontDisableStatic = true;

Expand Down Expand Up @@ -653,7 +656,12 @@ let
#patchelf = issue_61682_throw "patchelf" previous.patchelf;
#xz = issue_61682_throw "xz" previous.xz;

postgresql = (previous.postgresql.overrideAttrs (old: { dontDisableStatic = true; })).override {
# The test-suite for PostgreSQL 13 fails:
# https://github.com/NixOS/nixpkgs/issues/150930
#
# Even if you disable the test-suite, there are various linking issues.
# PostgreSQL 12 has similar issues, so we drop to PostgreSQL 11.
postgresql = (previous.postgresql_11.overrideAttrs (old: { dontDisableStatic = true; })).override {
# We need libpq, which does not need systemd,
# and systemd doesn't currently build with musl.
enableSystemd = false;
Expand Down Expand Up @@ -731,7 +739,17 @@ let
libjpeg = previous.libjpeg.override (old: { enableStatic = true; });
libjpeg_turbo = previous.libjpeg_turbo.override (old: { enableStatic = true; });

openblas = previous.openblas.override { enableStatic = true; };
openblas = (previous.openblas.override { enableStatic = true; }).overrideAttrs (old: {
# openblas doesn't create symlinks for static archives like libblas.a and
# liblapack.a. The following lines fixes this.
# https://github.com/NixOS/nixpkgs/pull/151049
postInstall = old.postInstall + ''
ln -s $out/lib/libopenblas.a $out/lib/libblas.a
ln -s $out/lib/libopenblas.a $out/lib/libcblas.a
ln -s $out/lib/libopenblas.a $out/lib/liblapack.a
ln -s $out/lib/libopenblas.a $out/lib/liblapacke.a
'';
});

openssl = previous.openssl.override { static = true; };

Expand Down Expand Up @@ -763,6 +781,9 @@ let
# so that `curl` can use it.
curl = statify_curl_including_exe previous.curl final.zlib_both;

# curlMinimal also needs to be statified.
curlMinimal = statify_curl_including_exe previous.curlMinimal final.zlib_both;

# `fetchurl` uses our overridden `curl` above, but `fetchurl` overrides
# `zlib` in `curl`, see
# https://github.com/NixOS/nixpkgs/blob/4a5c0e029ddbe89aa4eb4da7949219fe4e3f8472/pkgs/top-level/all-packages.nix#L296-L299
Expand Down Expand Up @@ -832,6 +853,21 @@ let
};
};

# I'm not sure why this is needed. As far as I can tell, libdevil doesn't
# directly link to libdeflate. But libdevil does link to libtiff, which
# uses libdeflate.
#
# However, if libdevil doesn't have libdeflate as a buildInput, building
# libdevil fails with linking errors.
#
# I wasn't able to report this upstream, because in nixpkgs libdevil and
# pkgsMusl.libdevil build correctly. Some transitive dependencies for
# pkgsStatic.libdevil fail to build, so it is hard to say whether this is a
# static-haskell-nix problem, or just a static-linking problem.
libdevil = previous.libdevil.overrideAttrs (oldAttrs: {
buildInputs = oldAttrs.buildInputs ++ [ final.libdeflate ];
});

};


Expand Down Expand Up @@ -1186,6 +1222,13 @@ let
# Tests fail with: doctests: <command line>: Dynamic loading not supported
headroom = dontCheck super.headroom;

# We need to explicitly get blas from openblasCompat, since
# otherwise openblas is used and Haskell programs like `resistor-cube`
# won't be able to find libblas.
blas-ffi = super.blas-ffi.override {
blas = final.openblasCompat;
};

hmatrix =
# musl does not have `random_r()`.
(enableCabalFlag super.hmatrix "no-random_r")
Expand Down Expand Up @@ -1624,6 +1667,7 @@ in
"LambdaHack" # fails `systemd` dependency erroring on `#include <printf.h>`
"language-puppet" # `base >=4.6 && <4.14, ghc-prim >=0.3 && <0.6` for dependency `protolude`
"learn-physics" # needs opengl: `cannot find -lGLU` `-lGL`
"magico" # undefined reference to `_gfortran_concat_string'
"odbc" # `odbcss.h: No such file or directory`
"qchas" # `_gfortran_concat_string` linker error via openblas
"rhine-gloss" # needs opengl: `cannot find -lGLU` `-lGL`
Expand Down