From 93fed047334330b32f030a7bc268f579f9a885b1 Mon Sep 17 00:00:00 2001 From: Viacheslav Lotsmanov Date: Thu, 28 Jul 2022 23:22:14 +0300 Subject: [PATCH] Update Stack build to work with newer versions of dependencies --- release.nix | 12 +++++++++++- stack.yaml | 21 +++++++++++++++++---- 2 files changed, 28 insertions(+), 5 deletions(-) diff --git a/release.nix b/release.nix index 2d2de13..a3c3bd6 100644 --- a/release.nix +++ b/release.nix @@ -248,6 +248,16 @@ let ]; }; + # Stack build using Nix requires also “gmp” and “zlib” + stack-env = + pkgs.haskellPackages.grpc-haskell.env.overrideAttrs (old: { + propagatedBuildInputs = (old.propagatedBuildInputs or [ ]) ++ [ + pkgs.gmp + pkgs.zlib + pkgs.grpc + ]; + }); + in { grpc-haskell-core-linux = linuxPkgs.haskellPackages.grpc-haskell-core; @@ -264,6 +274,6 @@ in grpc = pkgs.grpc; - inherit pkgs config overlay shell; + inherit pkgs config overlay shell stack-env; inherit (pkgs) test-grpc-haskell; } diff --git a/stack.yaml b/stack.yaml index 3511027..45ede7c 100644 --- a/stack.yaml +++ b/stack.yaml @@ -2,7 +2,7 @@ # For more information, see: http://docs.haskellstack.org/en/stable/yaml_configuration/ # Specifies the GHC version and set of packages available (e.g., lts-3.5, nightly-2015-09-21, ghc-7.10.2) -resolver: lts-14.1 +resolver: lts-19.16 # Local packages, usually specified by relative directory name packages: @@ -18,10 +18,23 @@ extra-package-dbs: [] extra-deps: + - git: git@github.com:awakesecurity/proto3-suite.git - commit: 3f6dd6f612cf2eba3c05798926ff924b0d5ab4fa + # “v0.5.0” tag, as in nixpkgs pin + commit: 54662fa765afc4a581edc29e12ea3c5bf45da158 + - git: git@github.com:awakesecurity/proto3-wire.git - commit: 4f355bbac895d577d8a28f567ab4380f042ccc24 + # Trying to take “v1.2.2”, as in nixpkgs, but in this repo there’s only + # “1.4.0” tag. Found a commit with title “Version 1.2.1 → 1.2.2” assuming it’s + # the one I’m looking for. + commit: 25b378b8e663a9f5305a648b826200e88e5d11b8 + + +# Fix dependency bounds for “proto3-suite” and “proto3-wire”. +# It seems there is no way with Stack to apply a patch for a dependency +# as it’s done in Nix. +allow-newer: true + # Control whether we use the GHC we find on the path # @@ -58,4 +71,4 @@ nix: enable: false pure: false shell-file: release.nix - nix-shell-options: ["-A", "grpc-haskell.env"] + nix-shell-options: ["-A", "stack-env"]