Skip to content

Commit

Permalink
upgrade nixpkgs and apply related fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
monacoremo authored and steve-chavez committed Dec 23, 2020
1 parent bf141ca commit 9cfc66a
Show file tree
Hide file tree
Showing 9 changed files with 51 additions and 171 deletions.
2 changes: 1 addition & 1 deletion default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ let
"postgrest";

compiler =
"ghc883";
"ghc884";

# PostgREST source files, filtered based on the rules in the .gitignore files
# and file extensions. We want to include as litte as possible, as the files
Expand Down
2 changes: 1 addition & 1 deletion nix/UPGRADE.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ To push all new artifacts to Cachix, run:
nix-store -qR --include-outputs $$(nix-instantiate) | cachix push postgrest
# Or, equivalently
make cachix-push-all
nix-shell --run postgrest-push-cachix
```

Expand Down
6 changes: 3 additions & 3 deletions nix/nixpkgs-version.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Pinned version of Nixpkgs, generated with nixpkgs-upgrade.
{
date = "2020-10-04";
rev = "d191ee22f0b0c91070f9f4c79210d4e398df0b93";
tarballHash = "13fb4cgxxc47shmzbm0rawfxjnilf7r4zq1vwc0z6s3lxijl9wl9";
date = "2020-12-22";
rev = "2a058487cb7a50e7650f1657ee0151a19c59ec3b";
tarballHash = "1h8c0mk6jlxdmjqch6ckj30pax3hqh6kwjlvp2021x3z4pdzrn9p";
}
6 changes: 1 addition & 5 deletions nix/overlays/checked-shell-script/checked-shell-script.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@
}:
name: text:
let
writeBin =
name: text:
bin =
writeTextFile {
inherit name;
executable = true;
Expand All @@ -34,9 +33,6 @@ let
'';
};

bin =
writeBin name text;

script =
runCommand name { inherit bin name; } "ln -s $bin/bin/$name $out";
in
Expand Down
32 changes: 8 additions & 24 deletions nix/overlays/haskell-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

self: super:
let
lib =
self.haskell.lib;

overrides =
final: prev:
rec {
Expand All @@ -18,33 +21,14 @@ let
# To get the sha256:
# nix-prefetch-url --unpack https://hackage.haskell.org/package/protolude-0.3.0/protolude-0.3.0.tar.gz

# TODO: We need to patch upstream for unbreaking hasql-dynamic-statements, hasql-implicits, ptr
hasql-dynamic-statements =
self.haskell.lib.dontCheck (prev.callHackageDirect
{
pkg = "hasql-dynamic-statements";
ver = "0.3.1";
sha256 = "1zjv91xlfkyxwq6mhzj7rsfm4kjvs9ygkgbl6jbbg19jihcn2kiy";
}
{ }
);
lib.dontCheck (lib.unmarkBroken prev.hasql-dynamic-statements);

hasql-implicits =
prev.callHackageDirect
{
pkg = "hasql-implicits";
ver = "0.1.0.2";
sha256 = "1z05amiy5zmf8fmr3dqp8b4svb0sj037gdjc5b9va5d5kdi95bv7";
}
{ };
lib.dontCheck (lib.unmarkBroken prev.hasql-implicits);

ptr =
prev.callHackageDirect
{
pkg = "ptr";
ver = "0.16.7.2";
sha256 = "1njb05jc1bdyxk7qh7s1y4ivn5nrpy3rhlkf4jlfamvlg8idkavc";
}
{ };
protolude = prev.protolude_0_3_0;
lib.dontCheck (lib.unmarkBroken prev.ptr);
} // extraOverrides final prev;
in
{
Expand Down
9 changes: 4 additions & 5 deletions nix/patches/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,14 @@
done
'';

# Patch is required for static builds on GHC 8.8.3, see:
# https://github.com/NixOS/nixpkgs/issues/85924
nixpkgs-revert-ghc-bootstrap =
./nixpkgs-revert-ghc-bootstrap.patch;

# See: https://github.com/NixOS/nixpkgs/pull/87879
nixpkgs-openssl-split-runtime-dependencies-of-static-builds =
./nixpkgs-openssl-split-runtime-dependencies-of-static-builds.patch;

# See: https://github.com/NixOS/nixpkgs/issues/104133
nixpkgs-gdb-fix-libintl =
./nixpkgs-gdb-fix-libintl.patch;

# Fix how openssl is linked on static builds, see:
# https://github.com/nh2/static-haskell-nix/pull/91
static-haskell-nix-postgrest-openssl-linking-fix =
Expand Down
31 changes: 31 additions & 0 deletions nix/patches/nixpkgs-gdb-fix-libintl.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
From 37cafab49907880838f777b068e9634d5206f61f Mon Sep 17 00:00:00 2001
From: monacoremo <59358383+monacoremo@users.noreply.github.com>
Date: Tue, 22 Dec 2020 14:43:41 +0100
Subject: [PATCH] Revert "gdb: 9.2 -> 10.1"

This reverts commit 6d2cad8a4ed76e42407546bc6b4c717fd9e1a535.
---
pkgs/development/tools/misc/gdb/default.nix | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/pkgs/development/tools/misc/gdb/default.nix b/pkgs/development/tools/misc/gdb/default.nix
index d9bac6e3c83..a4806634432 100644
--- a/pkgs/development/tools/misc/gdb/default.nix
+++ b/pkgs/development/tools/misc/gdb/default.nix
@@ -26,11 +26,11 @@ assert pythonSupport -> python3 != null;

stdenv.mkDerivation rec {
pname = targetPrefix + basename;
- version = "10.1";
+ version = "9.2";

src = fetchurl {
url = "mirror://gnu/gdb/${basename}-${version}.tar.xz";
- sha256 = "1h32dckz1y8fnyxh22iyw8h3hnhxr79v1ng85px3ljn1xv71wbzq";
+ sha256 = "0mf5fn8v937qwnal4ykn3ji1y2sxk0fa1yfqi679hxmpg6pdf31n";
};

postPatch = if stdenv.isDarwin then ''
--
2.28.0

130 changes: 0 additions & 130 deletions nix/patches/nixpkgs-revert-ghc-bootstrap.patch

This file was deleted.

4 changes: 2 additions & 2 deletions nix/static-haskell-package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ let
patches.applyPatches "patched-nixpkgs"
nixpkgs
[
patches.nixpkgs-revert-ghc-bootstrap
patches.nixpkgs-openssl-split-runtime-dependencies-of-static-builds
patches.nixpkgs-gdb-fix-libintl
];

extraOverrides =
Expand All @@ -52,7 +52,7 @@ let
# Each version of GHC needs a specific version of Cabal.
defaultCabalPackageVersionComingWithGhc =
{
ghc883 = "Cabal_3_2_0_0";
ghc884 = "Cabal_3_2_1_0";
}."${compiler}";

# The static-haskell-nix 'survey' derives a full static set of Haskell
Expand Down

0 comments on commit 9cfc66a

Please sign in to comment.