From 43149cb40a6d5e4810f1cbc4418721f157fc0ddb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Drtina?= Date: Fri, 25 Oct 2024 19:42:19 +0200 Subject: [PATCH] Build against nixpkgs 24.05 (#74) * Bump nixpkgs to 24.05 + `nix flake update` * grpc: unpin * net-mqtt: unpin * `connection` -> `crypton-connection` * large-records: unmark broken * proto3-wire: update to 1.4.3 * proto3-suite: update to 0.8.1 * Increase upper bounds on vector and network-conduit-tls * `x509-store` -> `crypton-x509-store` --- flake.lock | 38 ++++++++---- flake.nix | 6 +- grpc-mqtt.cabal | 12 ++-- nix/overlays/grpc.nix | 10 ---- nix/overlays/haskell.nix | 5 +- nix/packages/grpc.nix | 106 ---------------------------------- nix/packages/net-mqtt.nix | 32 ---------- nix/packages/proto3-suite.nix | 14 ++--- nix/packages/proto3-wire.nix | 17 ++---- 9 files changed, 51 insertions(+), 189 deletions(-) delete mode 100644 nix/overlays/grpc.nix delete mode 100644 nix/packages/grpc.nix delete mode 100644 nix/packages/net-mqtt.nix diff --git a/flake.lock b/flake.lock index 34dd4dd..efe5186 100644 --- a/flake.lock +++ b/flake.lock @@ -1,12 +1,15 @@ { "nodes": { "flake-utils": { + "inputs": { + "systems": "systems" + }, "locked": { - "lastModified": 1659877975, - "narHash": "sha256-zllb8aq3YO3h8B/U0/J1WBgAL8EX5yWf5pMj3G0NAmc=", + "lastModified": 1726560853, + "narHash": "sha256-X6rJYSESBVr3hBoH0WbKE5KvhPU5bloyZ2L4K60/fPQ=", "owner": "numtide", "repo": "flake-utils", - "rev": "c0e246b9b83f637f4681389ecabcb2681b4f3af0", + "rev": "c1dfcf08411b08f6b8615f7d8971a2bfa81d5e8a", "type": "github" }, "original": { @@ -22,11 +25,11 @@ ] }, "locked": { - "lastModified": 1660459072, - "narHash": "sha256-8DFJjXG8zqoONA1vXtgeKXy68KdJL5UaXR8NtVMUbx8=", + "lastModified": 1709087332, + "narHash": "sha256-HG2cCnktfHsKV0s4XW83gU3F57gaTljL9KNSuG6bnQs=", "owner": "hercules-ci", "repo": "gitignore.nix", - "rev": "a20de23b925fd8264fd7fad6454652e142fd7f73", + "rev": "637db329424fd7e46cf4185293b9cc8c88c95394", "type": "github" }, "original": { @@ -37,16 +40,16 @@ }, "nixpkgs": { "locked": { - "lastModified": 1685566663, - "narHash": "sha256-btHN1czJ6rzteeCuE/PNrdssqYD2nIA4w48miQAFloM=", + "lastModified": 1717179513, + "narHash": "sha256-vboIEwIQojofItm2xGCdZCzW96U85l9nDW3ifMuAIdM=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "4ecab3273592f27479a583fb6d975d4aba3486fe", + "rev": "63dacb46bf939521bdc93981b4cbb7ecb58427a0", "type": "github" }, "original": { "owner": "NixOS", - "ref": "23.05", + "ref": "24.05", "repo": "nixpkgs", "type": "github" } @@ -57,6 +60,21 @@ "gitignore": "gitignore", "nixpkgs": "nixpkgs" } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } } }, "root": "root", diff --git a/flake.nix b/flake.nix index 081ca14..eb39c4c 100644 --- a/flake.nix +++ b/flake.nix @@ -1,6 +1,6 @@ { inputs = { - nixpkgs.url = "github:NixOS/nixpkgs/23.05"; + nixpkgs.url = "github:NixOS/nixpkgs/24.05"; flake-utils.url = "github:numtide/flake-utils"; gitignore = { url = "github:hercules-ci/gitignore.nix"; @@ -13,15 +13,13 @@ let ghc = "ghc94"; - grpcOverlay = import nix/overlays/grpc.nix { }; - haskellOverlay = import nix/overlays/haskell.nix { inherit gitignore ghc; }; pkgs = import nixpkgs { inherit system; - overlays = [ grpcOverlay haskellOverlay ]; + overlays = [ haskellOverlay ]; }; in { packages.default = pkgs.haskell.packages.${ghc}.grpc-mqtt; diff --git a/grpc-mqtt.cabal b/grpc-mqtt.cabal index 0ff4a7d..a8e7d9e 100644 --- a/grpc-mqtt.cabal +++ b/grpc-mqtt.cabal @@ -57,14 +57,14 @@ common common , grpc-haskell-core >= 0.5.0 && < 0.6 , mtl >= 2.2.2 && < 2.3 , net-mqtt >= 0.8.3 && < 0.9 - , proto3-suite >= 0.5.2 && < 0.8 + , proto3-suite >= 0.5.2 && < 0.9 , proto3-wire >= 1.2.2 && < 1.5 , relude >= 0.7.0 && < 1.3 , stm >= 2.5.0 && < 2.6 , text >= 0.2 && < 2.2 , time >= 1.9.3 && < 1.13 , turtle >= 1.6.1 && < 1.7.0 - , vector >= 0.11 && < 0.13 + , vector >= 0.11 && < 0.14 library import: common @@ -126,8 +126,8 @@ library build-depends: , conduit-extra >= 1.3.5 && < 1.4 - , connection >= 0.3.1 && < 0.4 - , network-conduit-tls >= 1.3.2 && < 1.4 + , crypton-connection >= 0.3.1 && < 0.5 + , network-conduit-tls >= 1.3.2 && < 1.5 , nonce >= 1.0.7 && < 1.1 , pqueue >= 1.4.1.3 && < 1.6 , safe-exceptions >= 0.1.7 && < 0.2 @@ -189,7 +189,8 @@ test-suite test -- proto3-suite:compile-proto-file build-depends: - , connection + , crypton-connection + , crypton-x509-store , containers , data-default , grpc-mqtt @@ -199,4 +200,3 @@ test-suite test , tasty-hunit , tls , uuid - , x509-store diff --git a/nix/overlays/grpc.nix b/nix/overlays/grpc.nix deleted file mode 100644 index e8039b7..0000000 --- a/nix/overlays/grpc.nix +++ /dev/null @@ -1,10 +0,0 @@ -{ }: - -final: prev: { - grpc = final.callPackage (import ../packages/grpc.nix) { - # grpc builds with c++14 so abseil must also be built that way - abseil-cpp = final.abseil-cpp_202111.override { - cxxStandard = "14"; - }; - }; -} diff --git a/nix/overlays/haskell.nix b/nix/overlays/haskell.nix index 0d0515e..b1d518e 100644 --- a/nix/overlays/haskell.nix +++ b/nix/overlays/haskell.nix @@ -23,9 +23,8 @@ final: prev: { record-dot-preprocessor = hfinal.callPackage ../packages/record-dot-preprocessor.nix { }; turtle = hfinal.callPackage ../packages/turtle.nix { }; - }) - (hfinal: hprev: { - net-mqtt = final.haskell.lib.dontCheck (hfinal.callPackage ../packages/net-mqtt.nix { }); + + large-records = final.haskell.lib.unmarkBroken hprev.large-records; }) (hfinal: hprev: { proto3-wire = final.haskell.lib.dontCheck (hfinal.callPackage ../packages/proto3-wire.nix { }); diff --git a/nix/packages/grpc.nix b/nix/packages/grpc.nix deleted file mode 100644 index 8540192..0000000 --- a/nix/packages/grpc.nix +++ /dev/null @@ -1,106 +0,0 @@ -{ lib -, stdenv -, fetchFromGitHub -, fetchpatch -, buildPackages -, cmake -, zlib -, c-ares -, pkg-config -, re2 -, openssl -, protobuf -, grpc -, abseil-cpp -, libnsl - -# tests -, python3 -}: - -stdenv.mkDerivation rec { - pname = "grpc"; - version = "1.46.3"; # N.B: if you change this, please update: - # pythonPackages.grpcio-tools - # pythonPackages.grpcio-status - - src = fetchFromGitHub { - owner = "grpc"; - repo = "grpc"; - rev = "v${version}"; - sha256 = "sha256-RiXtKlRtlbqwrSxI904dgSu3da0A6Fwk+/hWHIG7A5E="; - fetchSubmodules = true; - }; - - patches = [ - # Fix build on armv6l (https://github.com/grpc/grpc/pull/21341) - (fetchpatch { - url = "https://github.com/grpc/grpc/commit/2f4cf1d9265c8e10fb834f0794d0e4f3ec5ae10e.patch"; - sha256 = "0ams3jmgh9yzwmxcg4ifb34znamr7pb4qm0609kvil9xqvkqz963"; - }) - - # Revert gRPC C++ Mutex to be an alias of Abseil, because it breaks dependent packages - (fetchpatch { - url = "https://github.com/grpc/grpc/commit/931f91b745cd5b2864a0d1787815871d0bd844ae.patch"; - sha256 = "0vc93g2i4982ys4gzyaxdv9ni25yk10sxq3n7fkz8dypy8sylck7"; - revert = true; - }) - ]; - - nativeBuildInputs = [ cmake pkg-config ] - ++ lib.optional (stdenv.hostPlatform != stdenv.buildPlatform) grpc; - propagatedBuildInputs = [ c-ares re2 zlib abseil-cpp ]; - buildInputs = [ openssl protobuf ] - ++ lib.optionals stdenv.isLinux [ libnsl ]; - - cmakeFlags = [ - "-DgRPC_ZLIB_PROVIDER=package" - "-DgRPC_CARES_PROVIDER=package" - "-DgRPC_RE2_PROVIDER=package" - "-DgRPC_SSL_PROVIDER=package" - "-DgRPC_PROTOBUF_PROVIDER=package" - "-DgRPC_ABSL_PROVIDER=package" - "-DBUILD_SHARED_LIBS=ON" - "-DCMAKE_SKIP_BUILD_RPATH=OFF" - ] ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ - "-D_gRPC_PROTOBUF_PROTOC_EXECUTABLE=${buildPackages.protobuf}/bin/protoc" - ] ++ lib.optionals ((stdenv.hostPlatform.useLLVM or false) && lib.versionOlder stdenv.cc.cc.version "11.0") [ - # Needs to be compiled with -std=c++11 for clang < 11. Interestingly this is - # only an issue with the useLLVM stdenv, not the darwin stdenvā€¦ - # https://github.com/grpc/grpc/issues/26473#issuecomment-860885484 - "-DCMAKE_CXX_STANDARD=11" - ]; - - # CMake creates a build directory by default, this conflicts with the - # basel BUILD file on case-insensitive filesystems. - preConfigure = '' - rm -vf BUILD - ''; - - # When natively compiling, grpc_cpp_plugin is executed from the build directory, - # needing to load dynamic libraries from the build directory, so we set - # LD_LIBRARY_PATH to enable this. When cross compiling we need to avoid this, - # since it can cause the grpc_cpp_plugin executable from buildPackages to - # crash if build and host architecture are compatible (e. g. pkgsLLVM). - preBuild = lib.optionalString (stdenv.hostPlatform == stdenv.buildPlatform) '' - export LD_LIBRARY_PATH=$(pwd)''${LD_LIBRARY_PATH:+:}$LD_LIBRARY_PATH - ''; - - NIX_CFLAGS_COMPILE = lib.optionalString stdenv.cc.isClang "-Wno-error=unknown-warning-option" - + lib.optionalString stdenv.isAarch64 "-Wno-error=format-security"; - - enableParallelBuilds = true; - - passthru.tests = { - inherit (python3.pkgs) grpcio-status grpcio-tools; - }; - - meta = with lib; { - description = "The C based gRPC (C++, Python, Ruby, Objective-C, PHP, C#)"; - license = licenses.asl20; - maintainers = with maintainers; [ lnl7 marsam ]; - homepage = "https://grpc.io/"; - platforms = platforms.all; - changelog = "https://github.com/grpc/grpc/releases/tag/v${version}"; - }; -} diff --git a/nix/packages/net-mqtt.nix b/nix/packages/net-mqtt.nix deleted file mode 100644 index 4b61bb5..0000000 --- a/nix/packages/net-mqtt.nix +++ /dev/null @@ -1,32 +0,0 @@ -{ mkDerivation, async, attoparsec, attoparsec-binary, base, binary -, bytestring, checkers, conduit, conduit-extra, connection -, containers, deepseq, HUnit, lib, network-conduit-tls, network-uri -, optparse-applicative, QuickCheck, stm, tasty, tasty-hunit -, tasty-quickcheck, text, websockets -}: -mkDerivation { - pname = "net-mqtt"; - version = "0.8.3.0"; - sha256 = "d421593781a7360a50f3864eec9ffe67f8dbc2af4429703b7a730f91bb5ec20b"; - isLibrary = true; - isExecutable = true; - libraryHaskellDepends = [ - async attoparsec attoparsec-binary base binary bytestring conduit - conduit-extra connection containers deepseq network-conduit-tls - network-uri QuickCheck stm text websockets - ]; - executableHaskellDepends = [ - async attoparsec attoparsec-binary base binary bytestring conduit - conduit-extra connection containers deepseq network-conduit-tls - network-uri optparse-applicative QuickCheck stm text websockets - ]; - testHaskellDepends = [ - async attoparsec attoparsec-binary base binary bytestring checkers - conduit conduit-extra connection containers deepseq HUnit - network-conduit-tls network-uri QuickCheck stm tasty tasty-hunit - tasty-quickcheck text websockets - ]; - homepage = "https://github.com/dustin/mqtt-hs#readme"; - description = "An MQTT Protocol Implementation"; - license = lib.licenses.bsd3; -} diff --git a/nix/packages/proto3-suite.nix b/nix/packages/proto3-suite.nix index c84c313..07ea14e 100644 --- a/nix/packages/proto3-suite.nix +++ b/nix/packages/proto3-suite.nix @@ -1,7 +1,7 @@ { mkDerivation, aeson, aeson-pretty, attoparsec, base , base64-bytestring, binary, bytestring, cereal, containers , contravariant, deepseq, dhall, doctest, fetchgit, filepath, foldl -, generic-arbitrary, hashable, haskell-src, hedgehog +, generic-arbitrary, ghc, hashable, hedgehog , insert-ordered-containers, large-generics, large-records, lens , lib, mtl, neat-interpolation, optparse-applicative , optparse-generic, parsec, parsers, pretty, pretty-show @@ -12,11 +12,11 @@ }: mkDerivation { pname = "proto3-suite"; - version = "0.7.0"; + version = "0.8.1"; src = fetchgit { url = "https://github.com/awakesecurity/proto3-suite.git"; - sha256 = "16x6acbcd4sqscjqdwmp0j6rlfn7lczp3vsyqv6v8r8zxwm244dk"; - rev = "30599c127cc53838576992a33c8c9d91fd57b429"; + sha256 = "1msy068045zbcw1wr99qf2cqjcd5065bn2qcipsc9hdqz6v35s65"; + rev = "800bfa8ddd6e9a32eedca1005560648ba97084cf"; fetchSubmodules = true; }; isLibrary = true; @@ -25,19 +25,19 @@ mkDerivation { libraryHaskellDepends = [ aeson aeson-pretty attoparsec base base64-bytestring binary bytestring cereal containers contravariant deepseq dhall filepath - foldl hashable haskell-src insert-ordered-containers large-generics + foldl ghc hashable insert-ordered-containers large-generics large-records lens mtl neat-interpolation parsec parsers pretty pretty-show proto3-wire QuickCheck quickcheck-instances safe split swagger2 system-filepath text text-short time transformers turtle vector ]; executableHaskellDepends = [ - base containers mtl optparse-applicative optparse-generic + base containers ghc mtl optparse-applicative optparse-generic proto3-wire range-set-list system-filepath text turtle ]; testHaskellDepends = [ aeson attoparsec base base64-bytestring bytestring cereal - containers deepseq doctest generic-arbitrary hedgehog + containers deepseq doctest generic-arbitrary ghc hedgehog large-generics large-records mtl parsec pretty pretty-show proto3-wire QuickCheck record-hasfield swagger2 tasty tasty-hedgehog tasty-hunit tasty-quickcheck text text-short diff --git a/nix/packages/proto3-wire.nix b/nix/packages/proto3-wire.nix index 0be4dca..2e3a305 100644 --- a/nix/packages/proto3-wire.nix +++ b/nix/packages/proto3-wire.nix @@ -1,18 +1,13 @@ { mkDerivation, base, bytestring, cereal, containers, criterion -, deepseq, doctest, fetchgit, hashable, lib, parameterized -, primitive, QuickCheck, random, safe, tasty, tasty-hunit -, tasty-quickcheck, template-haskell, text, text-short -, transformers, unordered-containers, vector, word-compat +, deepseq, doctest, hashable, lib, parameterized, primitive +, QuickCheck, random, safe, tasty, tasty-hunit, tasty-quickcheck +, template-haskell, text, text-short, transformers +, unordered-containers, vector, word-compat }: mkDerivation { pname = "proto3-wire"; - version = "1.4.1"; - src = fetchgit { - url = "https://github.com/awakesecurity/proto3-wire.git"; - sha256 = "1mq5qp778g5zjj17lj9d0db7b7j6bhv94lf68xlla5dba8vzfl8r"; - rev = "938523213d5de2d0ad9ece051d1a03002ee539cc"; - fetchSubmodules = true; - }; + version = "1.4.3"; + sha256 = "7fa316e7d309bd298ce6f28b85b5bb3d7ec9ce5ada895e2531febedb3f064b3f"; libraryHaskellDepends = [ base bytestring cereal containers deepseq hashable parameterized primitive QuickCheck safe template-haskell text text-short