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

Upgrade nixpkgs #3155

Merged
merged 2 commits into from
Jan 18, 2024
Merged
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
4 changes: 2 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ jobs:
Build-Cabal:
strategy:
matrix:
ghc: ['9.0.2', '9.2.4']
ghc: ['9.4.8']
fail-fast: false
name: Build Linux (Cabal, GHC ${{ matrix.ghc }})
runs-on: ubuntu-latest
Expand Down Expand Up @@ -284,7 +284,7 @@ jobs:
Build-Cabal-Arm:
strategy:
matrix:
ghc: ['9.2.4']
ghc: ['9.4.8']
fail-fast: false
name: Build aarch64 (Cabal, GHC ${{ matrix.ghc }})
if: ${{ github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v') || startsWith(github.ref, 'refs/heads/rel-') }}
Expand Down
2 changes: 2 additions & 0 deletions cabal.project
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
packages: postgrest.cabal
tests: true
wolfgangwalther marked this conversation as resolved.
Show resolved Hide resolved
2 changes: 1 addition & 1 deletion cabal.project.freeze
Original file line number Diff line number Diff line change
@@ -1 +1 @@
index-state: hackage.haskell.org 2023-10-13T13:54:33Z
index-state: hackage.haskell.org 2024-01-06T00:00:00Z
18 changes: 3 additions & 15 deletions default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ let
"postgrest";

compiler =
"ghc924";
"ghc948";

# 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 Expand Up @@ -36,10 +36,10 @@ let
allOverlays.build-toolbox
allOverlays.checked-shell-script
allOverlays.gitignore
allOverlays.postgis
(allOverlays.postgresql-default { inherit patches; })
allOverlays.postgresql-legacy
allOverlays.postgresql-future
allOverlays.postgis
(allOverlays.haskell-packages { inherit compiler; })
allOverlays.slocat
];
Expand All @@ -50,19 +50,7 @@ let

postgresqlVersions =
[
{
name = "postgresql-16";
postgresql = pkgs.postgresql_16.withPackages (p: [
p.postgis
(p.pg_safeupdate.overrideAttrs (old: {
installPhase = ''
mkdir -p $out/bin
cp safeupdate.dylib safeupdate.so || true
install -D safeupdate.so -t $out/lib
'';
}))
]);
}
{ name = "postgresql-16"; postgresql = pkgs.postgresql_16.withPackages (p: [ p.postgis p.pg_safeupdate ]); }
{ name = "postgresql-15"; postgresql = pkgs.postgresql_15.withPackages (p: [ p.postgis p.pg_safeupdate ]); }
{ name = "postgresql-14"; postgresql = pkgs.postgresql_14.withPackages (p: [ p.postgis p.pg_safeupdate ]); }
{ name = "postgresql-13"; postgresql = pkgs.postgresql_13.withPackages (p: [ p.postgis p.pg_safeupdate ]); }
Expand Down
9 changes: 4 additions & 5 deletions nix/hsie/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ module Main (main) where
import qualified Data.Aeson as JSON
import qualified Data.ByteString.Lazy.Char8 as LBS8
import qualified Data.Csv as Csv
import qualified Data.List as List
import qualified Data.Map as Map
import qualified Data.Set as Set
import qualified Data.Text as T
Expand All @@ -34,12 +33,13 @@ import Data.Function ((&))
import Data.List (intercalate)
import Data.Maybe (catMaybes, mapMaybe)
import Data.Text (Text)
import GHC.Data.Bag (bagToList)
import GHC.Generics (Generic)
import GHC.Hs.Extension (GhcPs)
import GHC.Types.Error (getMessages)
import GHC.Types.Name.Occurrence (occNameString)
import GHC.Types.Name.Reader (rdrNameOcc)
import GHC.Unit.Module.Name (moduleNameString)
import GHC.Utils.Error (pprMsgEnvelopeBagWithLoc)
import System.Directory.Recursive (getFilesRecursive)
import System.Exit (exitFailure)

Expand Down Expand Up @@ -206,7 +206,7 @@ parseModule filepath = do
return $ GHC.unLoc hsmod
Left errs ->
fail $ "Errors with " <> show filepath <> ":\n "
<> List.intercalate "\n " (show <$> bagToList errs)
<> show (pprMsgEnvelopeBagWithLoc $ getMessages errs)

-- | Symbols imported in an import declaration.
--
Expand Down Expand Up @@ -250,8 +250,7 @@ dump OutputJson = encodePretty
-- | Find modules that are imported under different aliases
inconsistentAliases :: [ImportedSymbol] -> ModuleAliases
inconsistentAliases symbols =
fmap moduleAlias symbols
& foldr insertSetMapMap Map.empty
foldr (insertSetMapMap . moduleAlias) Map.empty symbols
& Map.map (aliases . Map.toList)
& Map.filter ((<) 1 . length)
& Map.toList
Expand Down
1 change: 1 addition & 0 deletions nix/hsie/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ let
ps.dir-traverse
ps.dot
ps.ghc-exactprint
ps.ghc-paths
ps.optparse-applicative
];
ghc = ghcWithPackages modules;
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 postgrest-nixpkgs-upgrade.
{
date = "2023-03-25";
rev = "dbf5322e93bcc6cfc52268367a8ad21c09d76fea";
tarballHash = "0lwk4v9dkvd28xpqch0b0jrac4xl9lwm6snrnzx8k5lby72kmkng";
date = "2024-01-06";
rev = "4bbf5a2eb6046c54f7a29a0964c642ebfe912cbc";
tarballHash = "03p45qdcxqxc41mmzmmyzbkff29vv95vv643z0kd3mf1s2nnsy5b";
}
29 changes: 13 additions & 16 deletions nix/overlays/haskell-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,18 @@ let
# To fill in the sha256:
# update-nix-fetchgit nix/overlays/haskell-packages.nix

configurator-pg =
prev.callHackageDirect
{
pkg = "configurator-pg";
ver = "0.2.9";
sha256 = "sha256-UqFiOgPlksbIdHBVO0wYhCnboB+mxKJcXVhY9C1V7Hg=";
}
{ };

# Marked as broken (?)
fuzzyset = lib.markUnbroken prev.fuzzyset;

postgresql-libpq = lib.dontCheck
(prev.callCabal2nix "postgresql-libpq"
(super.fetchFromGitHub {
Expand All @@ -39,23 +51,8 @@ let
})
{ });

hasql-notifications = lib.dontCheck
(prev.callHackageDirect
{
pkg = "hasql-notifications";
ver = "0.2.0.6";
sha256 = "sha256-7PyFlB2B70njudOjaX6tk1m77ol9vnF5fI0LF86kVAI=";
}
{ });
hasql-pool = lib.dontCheck prev.hasql-pool_0_10;

hasql-pool = lib.dontCheck
(prev.callHackageDirect
{
pkg = "hasql-pool";
ver = "0.10";
sha256 = "sha256-kHzoqtNV9BFWnn1h560JRqMooQRwxokVKgDRBexamNI=";
}
{ });
} // extraOverrides final prev;
in
{
Expand Down
1 change: 1 addition & 0 deletions nix/overlays/postgis.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ let
url = "https://download.osgeo.org/postgis/source/postgis-${version}.tar.gz";
sha256 = "sha256-G02LXHVuWrpZ77wYM7Iu/k1lYneO7KVvpJf+susTZow=";
};
meta.broken = false;
};
in
{
Expand Down
24 changes: 12 additions & 12 deletions nix/overlays/postgresql-future.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@ self: super:
{
## Example for including a postgresql version from a specific nixpks commit:
##
postgresql_16 =
let
rev = "5148520bfab61f99fd25fb9ff7bfbb50dad3c9db";
tarballHash = "1dfjmz65h8z4lk845724vypzmf3dbgsdndjpj8ydlhx6c7rpcq3p";

pinnedPkgs =
builtins.fetchTarball {
url = "https://github.com/nixos/nixpkgs/archive/${rev}.tar.gz";
sha256 = tarballHash;
};
in
(import pinnedPkgs { }).pkgs.postgresql_16;
# postgresql_16 =
# let
# rev = "5148520bfab61f99fd25fb9ff7bfbb50dad3c9db";
# tarballHash = "1dfjmz65h8z4lk845724vypzmf3dbgsdndjpj8ydlhx6c7rpcq3p";
#
# pinnedPkgs =
# builtins.fetchTarball {
# url = "https://github.com/nixos/nixpkgs/archive/${rev}.tar.gz";
# sha256 = tarballHash;
# };
# in
# (import pinnedPkgs { }).pkgs.postgresql_16;
}
15 changes: 15 additions & 0 deletions nix/overlays/postgresql-legacy.nix
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,19 @@ self: super:
};
in
(import pinnedPkgs { }).pkgs.postgresql_10;

# PostgreSQL 11 was removed from Nixpkgs with
# https://github.com/NixOS/nixpkgs/commit/1220a4d4dd1a4590780a5e1c18d1333a121be366
# We pin its parent commit to get the last version that was available.
postgresql_11 =
let
rev = "f5458516e42cc5cb4123cc2d93f45c240548aa18";
tarballHash = "1h03621sxfhw4z6ya74k6c2lyx3z7pvf2jcg4vs7i01yz2m6w3cv";
pinnedPkgs =
builtins.fetchTarball {
url = "https://github.com/nixos/nixpkgs/archive/${rev}.tar.gz";
sha256 = tarballHash;
};
in
(import pinnedPkgs { }).pkgs.postgresql_11;
}
2 changes: 1 addition & 1 deletion nix/overlays/slocat.nix
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ final: prev:
rev = "52e7512c6029fd00483e41ccce260a3b4b9b3b64";
sha256 = "sha256-qn6luuh5wqREu3s8RfuMCP5PKdS2WdwPrujRYTpfzQ8=";
};
vendorSha256 = "sha256-pQpattmS9VmO3ZIQUFn66az8GSmB4IvYhTTCFn6SUmo=";
vendorHash = "sha256-pQpattmS9VmO3ZIQUFn66az8GSmB4IvYhTTCFn6SUmo=";
};
}
2 changes: 1 addition & 1 deletion nix/static-haskell-package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ let

defaultCabalPackageVersionComingWithGhc =
{
ghc924 = "Cabal_3_6_3_0";
ghc948 = "Cabal_3_8_1_0";
}."${compiler}";

# The static-haskell-nix 'survey' derives a full static set of Haskell
Expand Down
2 changes: 1 addition & 1 deletion nix/tools/loadtest.nix
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ let
}
''
find loadtest -type f -iname '*.bin' -exec ${reporter} {} \; \
| ${jq}/bin/jq '[leaf_paths as $path | {param: $path | join("."), (.branch): getpath($path)}]' \
| ${jq}/bin/jq '[paths(scalars) as $path | {param: $path | join("."), (.branch): getpath($path)}]' \
| ${jq}/bin/jq --slurp 'flatten | group_by(.param) | map(add)' \
| ${toMarkdown}
'';
Expand Down
9 changes: 5 additions & 4 deletions nix/tools/nixpkgsTools.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
, jq
, nix
}:
# Utility script for pinning the latest unstable version of Nixpkgs.
# Utility script for pinning the latest stable version of Nixpkgs.

# Instead of pinning Nixpkgs based on the huge Git repository, we reference a
# specific tarball that only contains the source of the revision that we want
Expand All @@ -15,7 +15,7 @@ let
"postgrest-nixpkgs-upgrade";

refUrl =
"https://api.github.com/repos/nixos/nixpkgs/git/ref/heads/nixpkgs-unstable";
"https://api.github.com/repos/nixos/nixpkgs/git/matching-refs/heads/nixpkgs-";

githubV3Header =
"Accept: application/vnd.github.v3+json";
Expand All @@ -27,11 +27,12 @@ let
checkedShellScript
{
inherit name;
docs = "Pin the newest unstable version of Nixpkgs.";
docs = "Pin the newest stable version of Nixpkgs.";
inRootDir = true;
}
''
commitHash="$(${curl}/bin/curl "${refUrl}" -H "${githubV3Header}" | ${jq}/bin/jq -r .object.sha)"
# The list of refs is sorted. The first result will be nixpkgs-unstable, the second the latest stable branch.
commitHash="$(${curl}/bin/curl "${refUrl}" -H "${githubV3Header}" | ${jq}/bin/jq -r 'sort_by(.ref) | reverse | .[1].object.sha')"
tarballUrl="${tarballUrlBase}$commitHash.tar.gz"
tarballHash="$(${nix}/bin/nix-prefetch-url --unpack "$tarballUrl")"
currentDate="$(${coreutils}/bin/date --iso)"
Expand Down
2 changes: 1 addition & 1 deletion nix/tools/tests.nix
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ let

(
trap 'echo Found dead code: Check file list above.' ERR ;
${weeder}/bin/weeder --config=./test/weeder.dhall
${weeder}/bin/weeder --config=./test/weeder.toml
)

# collect all tests
Expand Down
20 changes: 10 additions & 10 deletions postgrest.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ library
PostgREST.Response.Performance
PostgREST.Version
other-modules: Paths_postgrest
build-depends: base >= 4.9 && < 4.17
build-depends: base >= 4.9 && < 4.18
, HTTP >= 4000.3.7 && < 4000.5
, Ranged-sets >= 0.3 && < 0.5
, aeson >= 2.0.3 && < 2.2
Expand All @@ -93,7 +93,7 @@ library
, directory >= 1.2.6 && < 1.4
, either >= 4.4.1 && < 5.1
, extra >= 1.7.0 && < 2.0
, fuzzyset >= 0.2.3
, fuzzyset >= 0.3.0
, gitrev >= 1.2 && < 1.4
, hasql >= 1.6.1.1 && < 1.7
, hasql-dynamic-statements >= 0.3.1 && < 0.4
Expand All @@ -118,11 +118,11 @@ library
, scientific >= 0.3.4 && < 0.4
, streaming-commons >= 0.1.1 && < 0.3
, swagger2 >= 2.4 && < 2.9
, text >= 1.2.2 && < 1.3
, time >= 1.6 && < 1.12
, text >= 1.2.2 && < 2.1
, time >= 1.6 && < 1.13
, timeit >= 2.0 && < 2.1
, unordered-containers >= 0.2.8 && < 0.3
, unix-compat >= 0.5.4 && < 0.6
, unix-compat >= 0.5.4 && < 0.8
, vault >= 0.3.1.5 && < 0.4
, vector >= 0.11 && < 0.14
, wai >= 3.2.1 && < 3.3
Expand Down Expand Up @@ -159,7 +159,7 @@ executable postgrest
NoImplicitPrelude
hs-source-dirs: main
main-is: Main.hs
build-depends: base >= 4.9 && < 4.17
build-depends: base >= 4.9 && < 4.18
, containers >= 0.5.7 && < 0.7
, postgrest
, protolude >= 0.3.1 && < 0.4
Expand Down Expand Up @@ -233,7 +233,7 @@ test-suite spec
Feature.RollbackSpec
Feature.RpcPreRequestGucsSpec
SpecHelper
build-depends: base >= 4.9 && < 4.17
build-depends: base >= 4.9 && < 4.18
, aeson >= 2.0.3 && < 2.2
, aeson-qq >= 0.8.1 && < 0.9
, async >= 2.1.1 && < 2.3
Expand All @@ -245,7 +245,7 @@ test-suite spec
, hasql-pool >= 0.10 && < 0.11
, hasql-transaction >= 1.0.1 && < 1.1
, heredoc >= 0.2 && < 0.3
, hspec >= 2.3 && < 2.10
, hspec >= 2.3 && < 2.11
, hspec-wai >= 0.10 && < 0.12
, hspec-wai-json >= 0.10 && < 0.12
, http-types >= 0.12.3 && < 0.13
Expand All @@ -257,7 +257,7 @@ test-suite spec
, protolude >= 0.3.1 && < 0.4
, regex-tdfa >= 1.2.2 && < 1.4
, scientific >= 0.3.4 && < 0.4
, text >= 1.2.2 && < 1.3
, text >= 1.2.2 && < 2.1
, transformers-base >= 0.4.4 && < 0.5
, wai >= 3.2.1 && < 3.3
, wai-extra >= 3.0.19 && < 3.2
Expand All @@ -275,7 +275,7 @@ test-suite doctests
NoImplicitPrelude
hs-source-dirs: test/doc
main-is: Main.hs
build-depends: base >= 4.9 && < 4.17
build-depends: base >= 4.9 && < 4.18
, doctest >= 0.8
, postgrest
, pretty-simple
Expand Down
Loading
Loading