diff --git a/README.md b/README.md index 07e0dedda..cdfe50da0 100644 --- a/README.md +++ b/README.md @@ -106,8 +106,8 @@ installed on your machine to use it. ##### Dependencies -- `ghc >= 8.4` (Haskell compiler) and `cabal >= 2.2` (Haskell build-tool) - - The easiest way to get this is to install it using (Linux/Mac) [ghcup](https://www.haskell.org/ghcup/) and issue `ghcup install 8.6.5`, followed by `ghcup install-cabal`. +- `ghc >= 9.6` (Haskell compiler) and `cabal >= 2.2` (Haskell build-tool) + - The easiest way to get this is to install it using (Linux/Mac) [ghcup](https://www.haskell.org/ghcup/) and issue `ghcup install 9.6.2`, followed by `ghcup install-cabal`. - ghc may also be installed via brew, issuing `brew install ghc` and `brew install cabal-install`. (You may also need to install `zlib`, `z3`, and `sqlite`) @@ -125,7 +125,7 @@ cabal v2-build On some systems the default build might fail with linker errors complaining about cryptonite and ed25519, try: ```bash -# configure cabal +# configure cabal cabal v2-configure -f cryptonite-ed25519 # Build the project. @@ -146,13 +146,15 @@ you may need to add to your path. Then, you can call `pact` as-is. The fastest way to build and run Pact is to use the Nix package manager which has binary caching capabilities that allow you to download pre-built -binaries for everything needed by Pact. For detailed instructions see [our -wiki](https://github.com/kadena-io/pact/wiki/Building-Kadena-Projects). - +binaries for everything needed by Pact. +We use nix flakes to build pact and its dependencies. To build the Pact executable: +```bash +nix build +``` When the build is finished, you can run Pact with the following command: ```bash -./result/ghc/pact/bin/pact +./result/bin/pact ``` ### Verifying Installation diff --git a/default.nix b/default.nix deleted file mode 100644 index 5998d64de..000000000 --- a/default.nix +++ /dev/null @@ -1,10 +0,0 @@ -let - pactProj = import ./project.nix {}; - inherit (pactProj) kpkgs proj; - z3 = proj.passthru.z3; - pactExe = proj.ghc.pact; -in kpkgs.pkgs.writeScriptBin "pact" '' - #!/usr/bin/env bash - export PATH=${z3}/bin:$PATH - exec ${pactExe}/bin/pact "$@" -'' diff --git a/project.nix b/project.nix deleted file mode 100644 index 9642450fb..000000000 --- a/project.nix +++ /dev/null @@ -1,124 +0,0 @@ -{ rpRef ? "dfac4599b37bbfdb754afa32d25ba4832623277a" -, rpSha ? "03hicg0x77nz4wmwaxnlwf9y0xbypjjdzg3hak756m1qq8vpgc17" -, system ? builtins.currentSystem -}: - -let kpkgs = import ./dep/kpkgs { inherit system; }; -in { - inherit kpkgs; - proj = - kpkgs.rp.project ({ pkgs, hackGet, ... }: with pkgs.haskell.lib; { - name = "pact"; - overrides = self: super: { - direct-sqlite = dontCheck (self.callHackageDirect { - pkg = "direct-sqlite"; - ver = "2.3.27"; - sha256 = "0w8wj3210h08qlws40qhidkscgsil3635zk83kdlj929rbd8khip"; - } {}); - - # The z3 dependency needs to be conditional so pact can be a - # dependency of ghcjs apps. - pact = dontCheck (if self.ghc.isGhcjs or false - then super.pact - else addBuildDepend super.pact pkgs.z3); - - pact-time = dontCheck (self.callHackageDirect { - pkg = "pact-time"; - ver = "0.2.0.0"; - sha256 = "1cfn74j6dr4279bil9k0n1wff074sdlz6g1haqyyy38wm5mdd7mr"; - } {}); - - # sbv requires this even though it is not used in the build (and the hash is invalid) - tasty-bench = dontCheck (self.callHackageDirect { - pkg = "tasty-bench"; - ver = "0.3.1"; - sha256 = "0000000000000000000000000000000000000000000000000000"; - } {}); - - libBF = doJailbreak (dontCheck (self.callHackageDirect { - pkg = "libBF"; - ver = "0.6.3"; - sha256 = "0j0i39jb389rnrkkw2xqz10471afxys79nf31hhlqr4fk6ddhjf7"; - } {})); - - sbv = dontCheck (self.callHackageDirect { - pkg = "sbv"; - ver = "9.0"; - sha256 = "14g2qax1vc7q4g78fa562dviqvcd0l52kd5jmgv90g3g3ci15bnl"; - } {}); - - mod = self.callHackageDirect { - pkg = "mod"; - ver = "0.1.2.2"; - sha256 = "09x2i8crbpyvfzs478r5xky4vrfg6xjv11g3vaj3kb16pbd1raqn"; - } {}; - - poly = dontCheck (self.callHackageDirect { - pkg = "poly"; - ver = "0.5.1.0"; - sha256 = "1c65qcgvvbx3hlfgd5pzx2g5aam806w89x9nl7nhwx069mnixvn1"; - } {}); - - quickcheck-classes = self.callHackageDirect { - pkg = "quickcheck-classes"; - ver = "0.6.5.0"; - sha256 = "12sksx6sxv6h0bnd5q71d5fm6f6mf40vigncg04sqqry90x5gfdg"; - } {}; - - quickcheck-classes-base = self.callHackageDirect { - pkg = "quickcheck-classes-base"; - ver = "0.6.2.0"; - sha256 = "1kzw9kx9ab1apdyka8r63pkd35jpmdb21ds4x0s0hlyv2rka3f8w"; - } {}; - - semirings = self.callHackageDirect { - pkg = "semirings"; - ver = "0.6"; - sha256 = "0nzj3fpdyvmx3z6hd1zbxyfmz2w6f95s01yr5cwgq0bp86vqpnfa"; - } {}; - - vector-algorithms = self.callHackageDirect { - pkg = "vector-algorithms"; - ver = "0.8.0.4"; - sha256 = "15zwgdi80ihy6cypqm3g24418kshlydxjk5c2dvdd534wylyw8pp"; - } {}; - - vector-sized = self.callHackageDirect { - pkg = "vector-sized"; - ver = "1.4.2"; - sha256 = "0ijazq59892zpjjfxqa8c6jmv8llrjdr9ypjwz5yrkhvxc8mqld3"; - } {}; - - pact-do-benchmark = overrideCabal (doBenchmark (dontCheck super.pact)) (oldDrv: { - benchmarkSystemDepends = [ pkgs.z3 ]; - postBuild = '' - mkdir -p log # needed or else bench can't create a sqlitedb at log/sqlite.db - ./Setup bench - ''; - doHaddock = false; - doCheck = false; - }); - }; - packages = { - pact = kpkgs.gitignoreSource ./.; - - # Example of how to override kpkgs using callHackageDirect - # foo = dontCheck (kpkgs.callHackageDirect { - # pkg = "foo"; - # ver = "0.1"; - # sha256 = "0000000000000000000000000000000000000000000000000000"; - # } {}); - - }; - shellToolOverrides = ghc: super: { - z3 = pkgs.z3; - stack = pkgs.stack; - }; - shells = { - ghc = ["pact"]; - ghcjs = ["pact"]; - }; - - passthru = { inherit (pkgs) z3;}; - }); -} diff --git a/shell.nix b/shell.nix deleted file mode 100644 index b56a47478..000000000 --- a/shell.nix +++ /dev/null @@ -1 +0,0 @@ -(import ./project.nix {}).proj.shells.ghc diff --git a/static.nix b/static.nix deleted file mode 100644 index 01d55f02d..000000000 --- a/static.nix +++ /dev/null @@ -1,92 +0,0 @@ -{ system ? builtins.currentSystem }: - -let - rp = import (builtins.fetchTarball { - url = "https://github.com/vaibhavsagar/reflex-platform/archive/ae542c3e7ed4fb1b4552f447b1205982e261cd68.tar.gz"; - sha256 = "0p14b4kdjkykkcql8xdp2x8qvw7cla8imikl940a8qcsc49vkwpf"; - }) { inherit system; }; - pact-src = builtins.filterSource - (path: type: !(builtins.elem (baseNameOf path) - ["result" "dist" "dist-ghcjs" ".git" ".stack-work"])) - ./.; -in (rp.ghcMusl64.override { - overrides = self: super: (import ./overrides.nix pkgs self super) // { - }; - #overrides = self: super: - # let guardGhcjs = p: if self.ghc.isGhcjs or false then null else p; - # callHackageDirect = {pkg, ver, sha256}@args: - # let pkgver = "${pkg}-${ver}"; - # in self.callCabal2nix pkg (rp.nixpkgs.fetchzip { - # url = "http://hackage.haskell.org/package/${pkgver}/${pkgver}.tar.gz"; - # inherit sha256; - # }) {}; - # in with rp.nixpkgs.haskell.lib; { - # clock = overrideCabal super.clock (drv: { - # postPatch = '' - # substituteInPlace System/Clock.hsc --replace '#let alignment t = "%lu", (unsigned long)offsetof(struct {char x__; t (y__); }, y__)' "" - # ''; - # }); - # generics-sop = dontHaddock super.generics-sop; - # math-functions = dontCheck (dontHaddock (self.callHackage "math-functions" "0.3.1.0" {})); - # optparse-applicative = dontHaddock super.optparse-applicative; - # scientific = dontCheck super.scientific; - # servant-client = dontCheck super.servant-client; - # wai-app-static = dontHaddock super.wai-app-static; - # cryptonite = dontCheck super.cryptonite; - # parsers = dontHaddock super.parsers; - # statistics = dontHaddock super.statistics; - - # # tests for extra were failing due to an import clash (`isWindows`) - # extra = rp.nixpkgs.haskell.lib.dontCheck super.extra; - # # these want to use doctest, which doesn't work on ghcjs - # bytes = rp.nixpkgs.haskell.lib.dontCheck super.bytes; - # intervals = rp.nixpkgs.haskell.lib.dontCheck super.intervals; - # bound = rp.nixpkgs.haskell.lib.dontCheck super.bound; - # trifecta = dontHaddock (dontCheck (self.callCabal2nix "trifecta" (rp.nixpkgs.fetchFromGitHub { - # owner = "vaibhavsagar"; - # repo = "trifecta"; - # rev = "8b8630eb66740683a3502bf52a12cb6084b3979a"; - # sha256 = "1kb0dnzs0q5ahn4xp2w1fb05v4jahr6rm5c1l4f3nbylsh0gf7ar"; - # }) {})); - # lens-aeson = rp.nixpkgs.haskell.lib.dontCheck super.lens-aeson; - # # test suite for this is failing on ghcjs: - # hw-hspec-hedgehog = rp.nixpkgs.haskell.lib.dontCheck super.hw-hspec-hedgehog; - - # algebraic-graphs = rp.nixpkgs.haskell.lib.dontCheck super.algebraic-graphs; - - # # Needed to get around a requirement on `hspec-discover`. - # megaparsec = rp.nixpkgs.haskell.lib.dontCheck super.megaparsec; - - # hedgehog = self.callCabal2nix "hedgehog" (rp.nixpkgs.fetchFromGitHub { - # owner = "hedgehogqa"; - # repo = "haskell-hedgehog"; - # rev = "38146de29c97c867cff52fb36367ff9a65306d76"; - # sha256 = "1z8d3hqrgld1z1fvjd0czksga9lma83caa2fycw0a5gfbs8sh4zh"; - # } + "/hedgehog") {}; - # hlint = self.callHackage "hlint" "2.0.14" {}; - # # hoogle = self.callHackage "hoogle" "5.0.15" {}; - - sbv = dontHaddock (dontCheck (callHackageDirect { - pkg = "sbv"; - ver = "8.6"; - sha256 = "1isa8p9dnahkljwj0kz10119dwiycf11jvzdc934lnjv1spxkc9k"; - })); - - # # Our own custom fork - # thyme = dontHaddock (dontCheck (self.callCabal2nix "thyme" (rp.nixpkgs.fetchFromGitHub { - # owner = "kadena-io"; - # repo = "thyme"; - # rev = "6ee9fcb026ebdb49b810802a981d166680d867c9"; - # sha256 = "09fcf896bs6i71qhj5w6qbwllkv3gywnn5wfsdrcm0w1y6h8i88f"; - # }) {})); - - # # aeson 1.4.2 - # aeson = dontHaddock (self.callCabal2nix "aeson" (rp.nixpkgs.fetchFromGitHub { - # owner = "bos"; - # repo = "aeson"; - # rev = "c3d04181eb64393d449a68084ffea3a94c3d8064"; - # sha256 = "1l8lks6plj0naj9ghasmkqglshxym3f29gyybvjvkrkm770p2gl4"; - # }) {}); - # pact = dontHaddock (dontCheck (self.callCabal2nix "pact" pact-src {})); - # }; -}).pact