Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

echidna: fix build on aarch64-darwin #331080

Merged
merged 2 commits into from
Jul 31, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
190 changes: 101 additions & 89 deletions pkgs/tools/security/echidna/default.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
stdenv,
lib,
fetchpatch,
mkDerivation,
Expand All @@ -7,103 +8,114 @@
slither-analyzer,
}:

mkDerivation rec {
pname = "echidna";
version = "2.2.3";
mkDerivation (
rec {
pname = "echidna";
version = "2.2.3";

src = fetchFromGitHub {
owner = "crytic";
repo = "echidna";
rev = "v${version}";
sha256 = "sha256-NJ2G6EkexYE4P3GD7PZ+lLEs1dqnoqIB2zfAOD5SQ8M=";
};
src = fetchFromGitHub {
owner = "crytic";
repo = "echidna";
rev = "v${version}";
sha256 = "sha256-NJ2G6EkexYE4P3GD7PZ+lLEs1dqnoqIB2zfAOD5SQ8M=";
};

patches = [
# Support cross platform vty 6.x with vty-crossplatform
# https://github.com/crytic/echidna/pull/1290
(fetchpatch {
url = "https://github.com/crytic/echidna/commit/2913b027d7e793390ed489ef6a47d23ec9b3c800.patch";
hash = "sha256-5CGD9nDbDUTG869xUybWYSvGRsrm7JP7n0WMBNYfayw=";
})
];
patches = [
# Support cross platform vty 6.x with vty-crossplatform
# https://github.com/crytic/echidna/pull/1290
(fetchpatch {
url = "https://github.com/crytic/echidna/commit/2913b027d7e793390ed489ef6a47d23ec9b3c800.patch";
hash = "sha256-5CGD9nDbDUTG869xUybWYSvGRsrm7JP7n0WMBNYfayw=";
})
];

isExecutable = true;
isExecutable = true;

libraryToolDepends = with haskellPackages; [ haskellPackages.hpack ];
libraryToolDepends = with haskellPackages; [ haskellPackages.hpack ];

executableHaskellDepends = with haskellPackages; [
# package.yaml - dependencies
base
aeson
async
base16-bytestring
binary
bytestring
code-page
containers
data-bword
data-dword
deepseq
extra
directory
exceptions
filepath
hashable
hevm
html-entities
ListLike
MonadRandom
mtl
optparse-applicative
optics
optics-core
process
random
rosezipper
semver
split
text
transformers
time
unliftio
utf8-string
vector
with-utf8
word-wrap
yaml
http-conduit
html-conduit
warp
wai-extra
xml-conduit
strip-ansi-escape
# package.yaml - dependencies when "!os(windows)"
brick
unix
vty
];
executableHaskellDepends = with haskellPackages; [
# package.yaml - dependencies
base
aeson
async
base16-bytestring
binary
bytestring
code-page
containers
data-bword
data-dword
deepseq
extra
directory
exceptions
filepath
hashable
hevm
html-entities
ListLike
MonadRandom
mtl
optparse-applicative
optics
optics-core
process
random
rosezipper
semver
split
text
transformers
time
unliftio
utf8-string
vector
with-utf8
word-wrap
yaml
http-conduit
html-conduit
warp
wai-extra
xml-conduit
strip-ansi-escape
# package.yaml - dependencies when "!os(windows)"
brick
unix
vty
];

# Note: there is also a runtime dependency of slither-analyzer. So, let's include it.
executableSystemDepends = [ slither-analyzer ];
# Note: there is also a runtime dependency of slither-analyzer. So, let's include it.
executableSystemDepends = [ slither-analyzer ];

preConfigure = ''
hpack
'';
preConfigure = ''
hpack
'';

shellHook = "hpack";
shellHook = "hpack";

doHaddock = false;
doHaddock = false;

# tests depend on a specific version of solc
doCheck = false;
# tests depend on a specific version of solc
doCheck = false;

description = "Ethereum smart contract fuzzer";
homepage = "https://github.com/crytic/echidna";
license = lib.licenses.agpl3Plus;
maintainers = with lib.maintainers; [
arturcygan
hellwolf
];
platforms = lib.platforms.unix;
mainProgram = "echidna-test";
}
description = "Ethereum smart contract fuzzer";
homepage = "https://github.com/crytic/echidna";
license = lib.licenses.agpl3Plus;
maintainers = with lib.maintainers; [
arturcygan
hellwolf
];
platforms = lib.platforms.unix;
mainProgram = "echidna-test";

}
// lib.optionalAttrs (stdenv.isDarwin && stdenv.isAarch64) {

# https://github.com/NixOS/nixpkgs/pull/304352
postInstall = with haskellPackages; ''
remove-references-to -t ${warp.out} "$out/bin/echidna"
remove-references-to -t ${wreq.out} "$out/bin/echidna"
'';
}
)