Skip to content

Commit 002842d

Browse files
author
Jaap van der Plas
committed
revert solc version
1 parent 4ddead8 commit 002842d

File tree

5 files changed

+182
-13
lines changed

5 files changed

+182
-13
lines changed

Diff for: flake.lock

+10-10
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: flake.nix

+4-3
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
inputs.flake-utils.url = "github:numtide/flake-utils";
55
inputs.nixpkgs.url =
6-
"github:nixos/nixpkgs?rev=a98302aa9b9628915878a6ea9776c40a0bb02950";
6+
"github:nixos/nixpkgs?rev=98747f27ecfee70c8c97b195cbb94df80a074dda";
77
inputs.sbt-derivation.url = "github:zaninime/sbt-derivation";
88

99
outputs = { self, nixpkgs, flake-utils, sbt-derivation
@@ -49,10 +49,11 @@
4949
defaultApp = apps.mantis;
5050
}) // (collectHydraSets
5151
(map (name: mkHydraSet [ name ] [ "x86_64-linux" ]) [
52+
"jre_minimal"
5253
"jdk8"
53-
"lllc"
54+
# "lllc"
5455
"mantis"
55-
"mantis-entrypoint"
56+
# "mantis-entrypoint"
5657
"netcat-gnu"
5758
"retesteth"
5859
"sbt"

Diff for: nix/overlay.nix

+1
Original file line numberDiff line numberDiff line change
@@ -42,4 +42,5 @@ rev: final: prev: {
4242

4343
retesteth = final.callPackage ./retesteth.nix { };
4444
lllc = final.callPackage ./lllc.nix { };
45+
solc = final.callPackage ./solc.nix { };
4546
}

Diff for: nix/patches/shared-libs-install.patch

+71
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
diff --git a/CMakeLists.txt b/CMakeLists.txt
2+
index 0c05208f..8893648e 100644
3+
--- a/CMakeLists.txt
4+
+++ b/CMakeLists.txt
5+
@@ -48,6 +48,22 @@ add_subdirectory(libevmasm)
6+
add_subdirectory(libsolidity)
7+
add_subdirectory(libsolc)
8+
9+
+install(DIRECTORY libdevcore/
10+
+ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/libdevcore
11+
+ FILES_MATCHING PATTERN "*.h")
12+
+install(DIRECTORY libevmasm/
13+
+ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/libevmasm
14+
+ FILES_MATCHING PATTERN "*.h")
15+
+install(DIRECTORY libsolidity/
16+
+ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/libsolidity
17+
+ FILES_MATCHING PATTERN "*.h")
18+
+install(DIRECTORY libyul/
19+
+ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/libyul
20+
+ FILES_MATCHING PATTERN "*.h")
21+
+install(DIRECTORY liblangutil/
22+
+ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/liblangutil
23+
+ FILES_MATCHING PATTERN "*.h")
24+
+
25+
if (NOT EMSCRIPTEN)
26+
add_subdirectory(solc)
27+
add_subdirectory(liblll)
28+
diff --git a/libdevcore/CMakeLists.txt b/libdevcore/CMakeLists.txt
29+
index fa7e3f48..1f9f52b4 100644
30+
--- a/libdevcore/CMakeLists.txt
31+
+++ b/libdevcore/CMakeLists.txt
32+
@@ -6,3 +6,4 @@ target_link_libraries(devcore PRIVATE jsoncpp ${Boost_FILESYSTEM_LIBRARIES} ${Bo
33+
target_include_directories(devcore PUBLIC "${CMAKE_SOURCE_DIR}")
34+
target_include_directories(devcore SYSTEM PUBLIC ${Boost_INCLUDE_DIRS})
35+
add_dependencies(devcore solidity_BuildInfo.h)
36+
+install(TARGETS devcore LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
37+
diff --git a/libevmasm/CMakeLists.txt b/libevmasm/CMakeLists.txt
38+
index 86192c1b..e7f15e93 100644
39+
--- a/libevmasm/CMakeLists.txt
40+
+++ b/libevmasm/CMakeLists.txt
41+
@@ -3,3 +3,4 @@ file(GLOB headers "*.h")
42+
43+
add_library(evmasm ${sources} ${headers})
44+
target_link_libraries(evmasm PUBLIC devcore)
45+
+install(TARGETS evmasm LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
46+
diff --git a/libsolidity/CMakeLists.txt b/libsolidity/CMakeLists.txt
47+
index 0bdec4b4..e876177e 100644
48+
--- a/libsolidity/CMakeLists.txt
49+
+++ b/libsolidity/CMakeLists.txt
50+
@@ -29,6 +29,7 @@ endif()
51+
52+
add_library(solidity ${sources} ${z3_SRCS} ${cvc4_SRCS})
53+
target_link_libraries(solidity PUBLIC yul evmasm langutil devcore Boost::boost Boost::filesystem Boost::system)
54+
+install(TARGETS solidity LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
55+
56+
if (${Z3_FOUND})
57+
target_link_libraries(solidity PUBLIC ${Z3_LIBRARY})
58+
--- a/libyul/CMakeLists.txt
59+
+++ b/libyul/CMakeLists.txt
60+
@@ -43,3 +43,4 @@ endif()
61+
optimiser/VarDeclPropagator.cpp
62+
)
63+
target_link_libraries(yul PUBLIC evmasm devcore langutil)
64+
+install(TARGETS yul LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
65+
--- a/liblangutil/CMakeLists.txt
66+
+++ b/liblangutil/CMakeLists.txt
67+
@@ -11,3 +11,4 @@ endif()
68+
69+
add_library(langutil ${sources})
70+
target_link_libraries(langutil PUBLIC devcore)
71+
+install(TARGETS langutil LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})

Diff for: nix/solc.nix

+96
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
{ stdenv
2+
, lib
3+
, fetchzip
4+
, boost
5+
, cmake
6+
, ncurses
7+
, python2
8+
, z3Support ? true
9+
, z3 ? null
10+
, cvc4Support ? true
11+
, cvc4 ? null
12+
, cln ? null
13+
, gmp ? null
14+
}:
15+
16+
assert z3Support -> z3 != null && lib.versionAtLeast z3.version "4.6.0";
17+
assert cvc4Support -> cvc4 != null && cln != null && gmp != null;
18+
let
19+
jsoncppURL = https://github.com/open-source-parsers/jsoncpp/archive/1.8.4.tar.gz;
20+
jsoncpp = fetchzip {
21+
url = jsoncppURL;
22+
sha256 = "1z0gj7a6jypkijmpknis04qybs1hkd04d1arr3gy89lnxmp6qzlm";
23+
};
24+
buildSharedLibs = stdenv.hostPlatform.isLinux;
25+
in
26+
stdenv.mkDerivation rec {
27+
28+
pname = "solc";
29+
version = "0.5.11";
30+
31+
# upstream suggests avoid using archive generated by github
32+
src = fetchzip {
33+
url = "https://github.com/ethereum/solidity/releases/download/v${version}/solidity_${version}.tar.gz";
34+
sha256 = "0679s5pqbfy7fgpb4f3ppgj8iafxb64g046v8vhp29mf3dsdcnyl";
35+
};
36+
37+
patches = lib.optionals buildSharedLibs [ ./patches/shared-libs-install.patch ];
38+
39+
postPatch = ''
40+
substituteInPlace cmake/jsoncpp.cmake \
41+
--replace "${jsoncppURL}" ${jsoncpp}
42+
'';
43+
44+
cmakeFlags = [
45+
"-DBoost_USE_STATIC_LIBS=OFF"
46+
] ++ lib.optionals buildSharedLibs [
47+
"-DBUILD_SHARED_LIBS=ON"
48+
] ++ lib.optionals (!z3Support) [
49+
"-DUSE_Z3=OFF"
50+
] ++ lib.optionals (!cvc4Support) [
51+
"-DUSE_CVC4=OFF"
52+
];
53+
54+
nativeBuildInputs = [ cmake ];
55+
buildInputs = [ boost ]
56+
++ lib.optionals z3Support [ z3 ]
57+
++ lib.optionals cvc4Support [ cvc4 cln gmp ];
58+
checkInputs = [ ncurses python2 ];
59+
60+
# Test fails on darwin for unclear reason
61+
doCheck = stdenv.hostPlatform.isLinux;
62+
63+
checkPhase = ''
64+
while IFS= read -r -d ''' dir
65+
do
66+
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$(pwd)/$dir
67+
export LD_LIBRARY_PATH
68+
done < <(find . -type d -print0)
69+
70+
pushd ..
71+
# IPC tests need aleth avaliable, so we disable it
72+
sed -i "s/IPC_ENABLED=true/IPC_ENABLED=false\nIPC_FLAGS=\"--no-ipc\"/" ./scripts/tests.sh
73+
for i in ./scripts/*.sh; do
74+
patchShebangs "$i"
75+
done
76+
for i in ./scripts/*.py; do
77+
patchShebangs "$i"
78+
done
79+
for i in ./test/*.sh; do
80+
patchShebangs "$i"
81+
done
82+
TERM=xterm ./scripts/tests.sh
83+
popd
84+
'';
85+
86+
outputs = [ "out" "dev" ];
87+
88+
meta = with lib; {
89+
description = "Compiler for Ethereum smart contract language Solidity";
90+
homepage = https://github.com/ethereum/solidity;
91+
license = licenses.gpl3;
92+
platforms = with platforms; linux ++ darwin;
93+
maintainers = with maintainers; [ dbrock akru lionello sifmelcara ];
94+
inherit version;
95+
};
96+
}

0 commit comments

Comments
 (0)