about summary refs log tree commit diff
path: root/pkgs/development/compilers/solc
diff options
context:
space:
mode:
authorFrançois-René Rideau <fare@tunes.org>2023-04-04 13:17:56 -0400
committerGitHub <noreply@github.com>2023-04-04 19:17:56 +0200
commita3cff1f0527ba7a5be7ac7a802002c3dab267a94 (patch)
tree862213d3ec373013a09207062a8f1ae904fd17b7 /pkgs/development/compilers/solc
parentbce7f53b8faacc809a30f1e7d7231f156b913954 (diff)
solc: 0.8.13 -> 0.8.19 (#219240)
Diffstat (limited to 'pkgs/development/compilers/solc')
-rw-r--r--pkgs/development/compilers/solc/default.nix25
-rw-r--r--pkgs/development/compilers/solc/tests.patch14
2 files changed, 30 insertions, 9 deletions
diff --git a/pkgs/development/compilers/solc/default.nix b/pkgs/development/compilers/solc/default.nix
index 9a3e68a1b73b3..cd75f3d6c3941 100644
--- a/pkgs/development/compilers/solc/default.nix
+++ b/pkgs/development/compilers/solc/default.nix
@@ -4,10 +4,11 @@
 , cmake
 , coreutils
 , fetchpatch
+, jq
 , ncurses
 , python3
 , z3Support ? true
-, z3 ? null
+, z3_4_11 ? null
 , cvc4Support ? gccStdenv.isLinux
 , cvc4 ? null
 , cln ? null
@@ -16,8 +17,9 @@
 
 # compiling source/libsmtutil/CVC4Interface.cpp breaks on clang on Darwin,
 # general commandline tests fail at abiencoderv2_no_warning/ on clang on NixOS
+let z3 = z3_4_11; in
 
-assert z3Support -> z3 != null && lib.versionAtLeast z3.version "4.6.0";
+assert z3Support -> z3 != null && lib.versionAtLeast z3.version "4.11.0";
 assert cvc4Support -> cvc4 != null && cln != null && gmp != null;
 
 let
@@ -28,11 +30,11 @@ let
     sha256 = "1vbhi503rgwarf275ajfdb8vpdcbn1f7917wjkf8jghqwb1c24lq";
   };
 
-  range3Version = "0.11.0";
+  range3Version = "0.12.0";
   range3Url = "https://github.com/ericniebler/range-v3/archive/${range3Version}.tar.gz";
   range3 = fetchzip {
     url = range3Url;
-    sha256 = "18230bg4rq9pmm5f8f65j444jpq56rld4fhmpham8q3vr1c1bdjh";
+    sha256 = "sha256-bRSX91+ROqG1C3nB9HSQaKgLzOHEFy9mrD2WW3PRBWU=";
   };
 
   fmtlibVersion = "8.0.1";
@@ -43,7 +45,7 @@ let
   };
 
   pname = "solc";
-  version = "0.8.13";
+  version = "0.8.19";
   meta = with lib; {
     description = "Compiler for Ethereum smart contract language Solidity";
     homepage = "https://github.com/ethereum/solidity";
@@ -57,9 +59,13 @@ let
     # upstream suggests avoid using archive generated by github
     src = fetchzip {
       url = "https://github.com/ethereum/solidity/releases/download/v${version}/solidity_${version}.tar.gz";
-      hash = "sha256-cFC9M65kSYgYq9rhBXZKEdfvIMbMaDiDwdPmU8v9s7k=";
+      sha256 = "sha256-xh/QPYNEWxPtDaVmBeIE/Ch98g0ox9gJ/lR6ziOu+bg=";
     };
 
+    patches = [
+      ./tests.patch
+    ];
+
     postPatch = ''
       substituteInPlace cmake/jsoncpp.cmake \
         --replace "${jsoncppUrl}" ${jsoncpp}
@@ -84,7 +90,7 @@ let
     buildInputs = [ boost ]
       ++ lib.optionals z3Support [ z3 ]
       ++ lib.optionals cvc4Support [ cvc4 cln gmp ];
-    nativeCheckInputs = [ ncurses python3 ];
+    nativeCheckInputs = [ jq ncurses (python3.withPackages (ps: with ps; [ colorama deepdiff devtools docopt docutils requests sphinx tabulate z3 ])) ]; # contextlib2 glob2 textwrap3 traceback2 urllib3
 
     # tests take 60+ minutes to complete, only run as part of passthru tests
     doCheck = false;
@@ -96,7 +102,8 @@ let
       for i in ./scripts/*.sh ./scripts/*.py ./test/*.sh ./test/*.py; do
         patchShebangs "$i"
       done
-      TERM=xterm ./scripts/tests.sh ${lib.optionalString z3Support "--no-smt"}
+      ## TODO: reenable tests below after adding evmone and hera and their dependencies to nixpkgs
+      #TERM=xterm ./scripts/tests.sh ${lib.optionalString z3Support "--no-smt"}
       popd
     '';
 
@@ -113,7 +120,7 @@ let
 
     src = pkgs.fetchurl {
       url = "https://github.com/ethereum/solidity/releases/download/v${version}/solc-macos";
-      sha256 = "sha256-FNTvAT6oKtlekf2Um3+nt4JxpIP/GnnEPWzFi4JvW+o=";
+      sha256 = "sha256-OMhSOrZ+Cz4hxIGJ1r+5mtaHm5zgLg2ALsi+WYuyYi0=";
     };
     dontUnpack = true;
 
diff --git a/pkgs/development/compilers/solc/tests.patch b/pkgs/development/compilers/solc/tests.patch
new file mode 100644
index 0000000000000..45e3c7581474a
--- /dev/null
+++ b/pkgs/development/compilers/solc/tests.patch
@@ -0,0 +1,14 @@
+diff --git a/test/lsp.py b/test/lsp.py
+index 669951ca4..11007ae82 100755
+--- a/test/lsp.py
++++ b/test/lsp.py
+@@ -28,7 +28,8 @@ else:
+     import tty
+     # Turn off user input buffering so we get the input immediately,
+     # not only after a line break
+-    tty.setcbreak(sys.stdin.fileno())
++    if os.isatty(sys.stdin.fileno()):
++        tty.setcbreak(sys.stdin.fileno())
+ 
+ 
+ # Type for the pure test name without .sol suffix or sub directory