Skip to content

Commit

Permalink
solidity: update to version 0.8.28 (#27727)
Browse files Browse the repository at this point in the history
  • Loading branch information
kaimingguo authored Feb 22, 2025
1 parent fa0a335 commit 92a5489
Show file tree
Hide file tree
Showing 8 changed files with 83 additions and 89 deletions.
63 changes: 31 additions & 32 deletions lang/solidity/Portfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ PortGroup github 1.0
PortGroup cmake 1.1
PortGroup boost 1.0

github.setup ethereum solidity 0.8.19 v
github.setup ethereum solidity 0.8.28 v
revision 0

categories lang
Expand All @@ -24,64 +24,63 @@ homepage https://soliditylang.org
github.tarball_from releases
distname ${github.project}_${github.version}

checksums rmd160 df322fa402d7fc3d1c6643c0136a44251189ce28 \
sha256 9bc195e1695f271b65326c73a12223377d52ae4b4fee10589c5e7bde6fa44194 \
size 3239230
checksums rmd160 67927b1fb9f042deb6d71790b5c51543e571c69e \
sha256 ec756e30f26a5a38d028fd6f401ef0a7f5cfbf4a1ce71f76c2e3e1ffb8730672 \
size 12640527

set port_libfmt libfmt9

compiler.cxx_standard 2017

depends_build-append \
port:${port_libfmt} \
port:range-v3
depends_lib port:jsoncpp
port:range-v3 \
port:nlohmann-json

cmake.module_path-append \
${prefix}/lib/${port_libfmt}/cmake

compiler.cxx_standard \
2017
configure.cxxflags-append \
-std=c++17

configure.args -DTESTS:BOOL=OFF \
-DBoost_USE_STATIC_LIBS:BOOL=OFF \
-DWITH_Z3:BOOL=OFF \
-DWITH_CVC4:BOOL=OFF \
-DUSE_LD_GOLD:BOOL=OFF \
-DRANGE_V3_INCLUDE_DIR:PATH="${prefix}/include" \
-DJSONCPP_INCLUDE_DIR:PATH="${prefix}/include/jsoncpp" \
-DJSONCPP_LIB_DIR:PATH="${prefix}/lib"
configure.args -DBoost_USE_STATIC_LIBS=OFF \
-DTESTS=OFF \
-DIGNORE_VENDORED_DEPENDENCIES=ON \
-DRANGE_V3_INCLUDE_DIR=${prefix}/include \
-DSTRICT_NLOHMANN_JSON_VERSION=OFF \
-DWITH_Z3=OFF \
-DWITH_CVC4=OFF

patchfiles-append patch-cmake_range-v3.cmake.diff \
patch-libsolutil_JSON.cpp.diff
patchfiles-append patch-CMakeLists.txt.diff \
patch-libyul_ObjectOptimizer.cpp.diff

default_variants +z3

variant z3 description {SMT Checker via Z3} {
depends_lib-append \
port:z3
configure.args-append \
-DSTRICT_Z3_VERSION:BOOL=OFF
-DSTRICT_Z3_VERSION=OFF
configure.args-replace \
-DWITH_Z3:BOOL=OFF \
-DWITH_Z3:BOOL=ON
-DWITH_Z3=OFF \
-DWITH_Z3=ON
}

variant cvc4 description {SMT Checker via CVC4} {
depends_lib-append \
port:cvc4
configure.args-replace \
-DWITH_CVC4:BOOL=OFF \
-DWITH_CVC4:BOOL=ON
-DWITH_CVC4=OFF \
-DWITH_CVC4=ON
}

pre-test {
variant tests description {Enable testing} {
configure.args-replace \
-DTESTS:BOOL=OFF
-DTESTS:BOOL=ON
-DTESTS=OFF \
-DTESTS=ON
}

post-patch {
file copy -force ${filespath}/fmtlib.cmake ${worksrcpath}/cmake/
file copy -force ${filespath}/jsoncpp.cmake ${worksrcpath}/cmake/

reinplace "/EthCcache/ d" ${worksrcpath}/CMakeLists.txt
}
test.run yes
test.cmd ${destroot}${prefix}/bin/solc
test.target
test.args --bin ${filespath}/test.sol
1 change: 0 additions & 1 deletion lang/solidity/files/fmtlib.cmake

This file was deleted.

2 changes: 0 additions & 2 deletions lang/solidity/files/jsoncpp.cmake

This file was deleted.

27 changes: 27 additions & 0 deletions lang/solidity/files/patch-CMakeLists.txt.diff
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
--- CMakeLists.txt.orig 2024-09-04 09:02:02 UTC
+++ CMakeLists.txt
@@ -52,15 +52,21 @@ mark_as_advanced(ONLY_BUILD_SOLIDITY_LIBRARIES)
mark_as_advanced(IGNORE_VENDORED_DEPENDENCIES)
mark_as_advanced(ONLY_BUILD_SOLIDITY_LIBRARIES)

-# Setup cccache.
-include(EthCcache)
-
# Let's find our dependencies
include(EthDependencies)
if (NOT IGNORE_VENDORED_DEPENDENCIES)
include(fmtlib)
include(nlohmann-json)
include(range-v3)
+else()
+ # fmtlib
+ find_package(fmt REQUIRED)
+ # nlohmann-json
+ find_package(nlohmann_json REQUIRED)
+ # range-v3
+ add_library(range-v3 INTERFACE IMPORTED)
+ set_target_properties(range-v3 PROPERTIES
+ INTERFACE_INCLUDE_DIRECTORIES ${RANGE_V3_INCLUDE_DIR})
endif()

find_package(Threads)
39 changes: 0 additions & 39 deletions lang/solidity/files/patch-cmake_range-v3.cmake.diff

This file was deleted.

15 changes: 0 additions & 15 deletions lang/solidity/files/patch-libsolutil_JSON.cpp.diff

This file was deleted.

11 changes: 11 additions & 0 deletions lang/solidity/files/patch-libyul_ObjectOptimizer.cpp.diff
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
--- libyul/ObjectOptimizer.cpp.orig 2025-02-18 15:37:12
+++ libyul/ObjectOptimizer.cpp 2025-02-18 15:38:24
@@ -153,7 +153,7 @@
// we just regenerate them by reparsing the object.
rawKey += keccak256(asmPrinter(_ast)).asBytes();
rawKey += keccak256(_debugData.formatUseSrcComment()).asBytes();
- rawKey += h256(u256(_settings.language)).asBytes();
+ rawKey += h256(u256(static_cast<uint8_t>(_settings.language))).asBytes();
rawKey += FixedHash<1>(uint8_t(_settings.optimizeStackAllocation ? 0 : 1)).asBytes();
rawKey += h256(u256(_settings.expectedExecutionsPerDeployment)).asBytes();
rawKey += FixedHash<1>(uint8_t(_isCreation ? 0 : 1)).asBytes();
14 changes: 14 additions & 0 deletions lang/solidity/files/test.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.4.16 <0.9.0;

contract SimpleStorage {
uint storedData;

function set(uint x) public {
storedData = x;
}

function get() public view returns (uint) {
return storedData;
}
}

0 comments on commit 92a5489

Please sign in to comment.