Skip to content

Commit

Permalink
Update nixpkgs for Echidna 2.0 (#717)
Browse files Browse the repository at this point in the history
* Bump echidna version to 2.0.0

* Upgrade hevm to 0.49

* Fix bundling by using matching nixpkgs

* Re-enable nix build on CI
  • Loading branch information
elopez authored Feb 12, 2022
1 parent b3071ad commit 65ecb1c
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/nix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ jobs:
- uses: cachix/install-nix-action@v16
with:
nix_path: nixpkgs=channel:nixos-unstable
- run: true #nix-build
- run: nix-build
23 changes: 20 additions & 3 deletions default.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
{ pkgs ? import nix/pkgs.nix,
{ pkgs ? import (builtins.fetchTarball {
name = "nixpkgs-unstable-2022-02-10";
url = "https://github.com/nixos/nixpkgs/archive/1882c6b7368fd284ad01b0a5b5601ef136321292.tar.gz";
sha256 = "sha256:0zg7ak2mcmwzi2kg29g4v9fvbvs0viykjsg2pwaphm1fi13s7s0i";
}) {},
profiling ? false,
tests ? true
}:
Expand All @@ -25,7 +29,7 @@ let
'';
};

v = "1.7.3";
v = "2.0.0";

testInputs = [ pkgs.slither-analyzer solc ];

Expand Down Expand Up @@ -66,7 +70,20 @@ let
doCheck = tests;
};

echidna = pkgs.haskellPackages.callPackage f { };
dapptools = pkgs.fetchFromGitHub {
owner = "dapphub";
repo = "dapptools";
rev = "hevm/0.49.0";
sha256 = "sha256-giBcHTlFV1zJVgdbzWmezPdtPRdJQbocBEmuenBFVqk";
};

hevm = pkgs.haskell.lib.dontCheck (
pkgs.haskell.lib.doJailbreak (
pkgs.haskellPackages.callCabal2nix "hevm" "${dapptools}/src/hevm"
{ secp256k1 = pkgs.secp256k1; }
));

echidna = pkgs.haskellPackages.callPackage f { hevm = hevm; };
echidnaShell = pkgs.haskellPackages.shellFor {
packages = p: [ echidna ];
shellHook = "hpack";
Expand Down
15 changes: 5 additions & 10 deletions macos-release.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
{ tests ? false }:
let
pkgs = import nix/pkgs.nix;
pkgs = import (builtins.fetchTarball {
name = "nixpkgs-unstable-2022-02-10";
url = "https://github.com/nixos/nixpkgs/archive/1882c6b7368fd284ad01b0a5b5601ef136321292.tar.gz";
sha256 = "sha256:0zg7ak2mcmwzi2kg29g4v9fvbvs0viykjsg2pwaphm1fi13s7s0i";
}) {};
echidna = import ./. { inherit tests; };
in
with pkgs; runCommand "echidna-${echidna.version}-bundled-dylibs" {
Expand All @@ -18,15 +22,6 @@ in
-d $out/bin \
-p '@executable_path'
# Manually fix iconv dylib ignored by dylibbundler
cp ${pkgs.libiconv.outPath}/lib/libiconv-nocharset.dylib $out/bin/
cp ${pkgs.libiconv.outPath}/lib/libcharset.1.0.0.dylib $out/bin/libcharset.1.dylib
chmod 755 $out/bin/libiconv-nocharset.dylib $out/bin/libcharset.1.dylib
install_name_tool -id "@rpath/libiconv-nocharset.dylib" $out/bin/libiconv-nocharset.dylib
install_name_tool -id "@rpath/libcharset.1.dylib" $out/bin/libcharset.1.dylib
install_name_tool -change ${pkgs.libiconv.outPath}/lib/libiconv-nocharset.dylib "@executable_path/libiconv-nocharset.dylib" $out/bin/libiconv.dylib
install_name_tool -change ${pkgs.libiconv.outPath}/lib/libcharset.1.dylib "@executable_path/libcharset.1.dylib" $out/bin/libiconv.dylib
# re-sign the binaries since the load paths were modified
codesign -s - -f $out/bin/*
tar -czvf $out/echidna-${echidna.version}-${stdenv.system}.tar.gz -C $out/bin .
Expand Down

0 comments on commit 65ecb1c

Please sign in to comment.