Merge #1100

1100: use IOHK fork for ‘zip’ to disable system dependency on bzlib2 r=rvl a=KtorZ

Issue Number

N/A

Overview

  • [x] I have forked the zip library waiting for @rvl ‘s PR to be merged
  • [x] I have used our fork in our stack.yaml
  • [x] I have used the flag introduced by the PR

Comments

Let’s see if this fixes Hydra as expected :pray:

Co-authored-by: KtorZ [email protected] Co-authored-by: Rodney Lorrimar [email protected]

View on GitHub
File Changes
        text-class = ./text-class.nix;
        cardano-wallet-test-utils = ./cardano-wallet-test-utils.nix;
        cardano-wallet-jormungandr = ./cardano-wallet-jormungandr.nix;
+
        zip = ./zip.nix;
        persistent = ./persistent.nix;
        persistent-sqlite = ./persistent-sqlite.nix;
        persistent-template = ./persistent-template.nix;
              "disable-graylog" = lib.mkOverride 900 true;
              };
            };
+
          "zip" = { flags = { "disable-bzip2" = lib.mkOverride 900 true; }; };
          };
        })
    { packages = {}; }
+
let
+
  buildDepError = pkg:
+
    builtins.throw ''
+
      The Haskell package set does not contain the package: ${pkg} (build dependency).
+
      
+
      If you are using Stackage, make sure that you are using a snapshot that contains the package. Otherwise you may need to update the Hackage snapshot you are using, usually by updating haskell.nix.
+
      '';
+
  sysDepError = pkg:
+
    builtins.throw ''
+
      The Nixpkgs package set does not contain the package: ${pkg} (system dependency).
+
      
+
      You may need to augment the system package mapping in haskell.nix so that it can be found.
+
      '';
+
  pkgConfDepError = pkg:
+
    builtins.throw ''
+
      The pkg-conf packages does not contain the package: ${pkg} (pkg-conf dependency).
+
      
+
      You may need to augment the pkg-conf package mapping in haskell.nix so that it can be found.
+
      '';
+
  exeDepError = pkg:
+
    builtins.throw ''
+
      The local executable components do not include the component: ${pkg} (executable dependency).
+
      '';
+
  legacyExeDepError = pkg:
+
    builtins.throw ''
+
      The Haskell package set does not contain the package: ${pkg} (executable dependency).
+
      
+
      If you are using Stackage, make sure that you are using a snapshot that contains the package. Otherwise you may need to update the Hackage snapshot you are using, usually by updating haskell.nix.
+
      '';
+
  buildToolDepError = pkg:
+
    builtins.throw ''
+
      Neither the Haskell package set or the Nixpkgs package set contain the package: ${pkg} (build tool dependency).
+
      
+
      If this is a system dependency:
+
      You may need to augment the system package mapping in haskell.nix so that it can be found.
+
      
+
      If this is a Haskell dependency:
+
      If you are using Stackage, make sure that you are using a snapshot that contains the package. Otherwise you may need to update the Hackage snapshot you are using, usually by updating haskell.nix.
+
      '';
+
in { system, compiler, flags, pkgs, hsPkgs, pkgconfPkgs, ... }:
+
  {
+
    flags = { dev = false; disable-bzip2 = false; };
+
    package = {
+
      specVersion = "1.18";
+
      identifier = { name = "zip"; version = "1.2.0"; };
+
      license = "BSD-3-Clause";
+
      copyright = "";
+
      maintainer = "Mark Karpov <[email protected]>";
+
      author = "Mark Karpov <[email protected]>";
+
      homepage = "https://github.com/mrkkrp/zip";
+
      url = "";
+
      synopsis = "Operations on zip archives";
+
      description = "Operations on zip archives.";
+
      buildType = "Simple";
+
      isLocal = true;
+
      };
+
    components = {
+
      "library" = {
+
        depends = [
+
          (hsPkgs."base" or (buildDepError "base"))
+
          (hsPkgs."bytestring" or (buildDepError "bytestring"))
+
          (hsPkgs."case-insensitive" or (buildDepError "case-insensitive"))
+
          (hsPkgs."cereal" or (buildDepError "cereal"))
+
          (hsPkgs."conduit" or (buildDepError "conduit"))
+
          (hsPkgs."conduit-extra" or (buildDepError "conduit-extra"))
+
          (hsPkgs."containers" or (buildDepError "containers"))
+
          (hsPkgs."digest" or (buildDepError "digest"))
+
          (hsPkgs."directory" or (buildDepError "directory"))
+
          (hsPkgs."dlist" or (buildDepError "dlist"))
+
          (hsPkgs."exceptions" or (buildDepError "exceptions"))
+
          (hsPkgs."filepath" or (buildDepError "filepath"))
+
          (hsPkgs."monad-control" or (buildDepError "monad-control"))
+
          (hsPkgs."mtl" or (buildDepError "mtl"))
+
          (hsPkgs."resourcet" or (buildDepError "resourcet"))
+
          (hsPkgs."text" or (buildDepError "text"))
+
          (hsPkgs."time" or (buildDepError "time"))
+
          (hsPkgs."transformers" or (buildDepError "transformers"))
+
          (hsPkgs."transformers-base" or (buildDepError "transformers-base"))
+
          ] ++ (pkgs.lib).optional (!flags.disable-bzip2) (hsPkgs."bzlib-conduit" or (buildDepError "bzlib-conduit"));
+
        buildable = true;
+
        };
+
      exes = {
+
        "haskell-zip-app" = {
+
          depends = [
+
            (hsPkgs."base" or (buildDepError "base"))
+
            (hsPkgs."filepath" or (buildDepError "filepath"))
+
            (hsPkgs."zip" or (buildDepError "zip"))
+
            ];
+
          buildable = true;
+
          };
+
        };
+
      tests = {
+
        "tests" = {
+
          depends = [
+
            (hsPkgs."base" or (buildDepError "base"))
+
            (hsPkgs."QuickCheck" or (buildDepError "QuickCheck"))
+
            (hsPkgs."bytestring" or (buildDepError "bytestring"))
+
            (hsPkgs."conduit" or (buildDepError "conduit"))
+
            (hsPkgs."containers" or (buildDepError "containers"))
+
            (hsPkgs."directory" or (buildDepError "directory"))
+
            (hsPkgs."dlist" or (buildDepError "dlist"))
+
            (hsPkgs."exceptions" or (buildDepError "exceptions"))
+
            (hsPkgs."filepath" or (buildDepError "filepath"))
+
            (hsPkgs."hspec" or (buildDepError "hspec"))
+
            (hsPkgs."temporary" or (buildDepError "temporary"))
+
            (hsPkgs."text" or (buildDepError "text"))
+
            (hsPkgs."time" or (buildDepError "time"))
+
            (hsPkgs."transformers" or (buildDepError "transformers"))
+
            (hsPkgs."zip" or (buildDepError "zip"))
+
            ];
+
          buildable = true;
+
          };
+
        };
+
      };
+
    } // {
+
    src = (pkgs.lib).mkDefault (pkgs.fetchgit {
+
      url = "https://github.com/mrkkrp/zip";
+
      rev = "5a39029cebc9ad5b16ed6a5f2f495714b34b02f8";
+
      sha256 = "1h5cl5vr6ipmc719sjkhnw6jdzkidwra3jilvlz5g6wm8jri1fdm";
+
      });
+
    }
\ No newline at end of file

                      
  buildInputs =
    (with walletPackages; [ jormungandr jormungandr-cli ]) ++
-
    [ zlib bzip2.dev gmp ncurses lzma openssl git systemd.dev nodejs ] ++
+
    [ zlib gmp ncurses lzma openssl git systemd.dev nodejs ] ++
    (lib.optionals stdenv.isDarwin (with darwin.apple_sdk.frameworks; [ Cocoa CoreServices libcxx libiconv ]));

                      
  phases = ["nobuildPhase"];
      ${testData.jormungandr}/jormungandr/config.yaml > config.yaml

                      
  ${pkgs.lib.concatMapStringsSep "\n" (test: ''
-
    pkg=`ls -1 ${test}`
+
    pkg=`ls -1 ${test} | head -1`
    exe=`cd ${test}/$pkg; ls -1 *.exe`
    name=$pkg-test-$exe
    cp ${test}/$pkg/$exe $name
  '') tests}

                      
  ${pkgs.lib.concatMapStringsSep "\n" (bench: ''
-
    pkg=`ls -1 ${bench}`
+
    pkg=`ls -1 ${bench} | head -1`
    exe=`cd ${bench}/$pkg; ls -1 *.exe`
    name=$pkg-bench-$exe
    cp ${bench}/$pkg/$exe $name
m
+1/-0
        jobs.native.shell.x86_64-darwin
        jobs.cardano-wallet-jormungandr-win64
        jobs.cardano-wallet-jormungandr-macos64
+
        jobs.cardano-wallet-jormungandr-tests-win64
      ]
    );

                      
m
+8/-0
- quickcheck-state-machine-0.6.0
- command-0.1.1

                      
+
# 'zip' with an extra flag to disable bzlib2 library
+
- git: https://github.com/mrkkrp/zip
+
  commit: 5a39029cebc9ad5b16ed6a5f2f495714b34b02f8
+

                      
# persistent-2.10.2 with CASCADE DELETE support for SQLite.
#
# See: https://github.com/input-output-hk/persistent/tree/cardano-wallet
    disable-prometheus: true
    disable-systemd: true

                      
+
  # Avoid a system library which causes difficulty with cross-compilation
+
  zip:
+
    disable-bzip2: true
+

                      
nix:
  shell-file: nix/stack-shell.nix