Skip to content

Commit 78627e0

Browse files
authored
Merge pull request #16177 from argotorg/fix_rationa_comparison_bug
Bump boost, gcc, clang for non-windows builds and add CI job with these versions
2 parents d6ae112 + 8c1e489 commit 78627e0

File tree

5 files changed

+134
-54
lines changed

5 files changed

+134
-54
lines changed

.circleci/config.yml

Lines changed: 46 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,6 @@ parameters:
1111
type: string
1212
# solbuildpackpusher/solidity-buildpack-deps:ubuntu2004-26
1313
default: "solbuildpackpusher/solidity-buildpack-deps@sha256:1f387a77be889f65a2a25986a5c5eccc88cec23fabe6aeaf351790751145c81e"
14-
ubuntu-2204-docker-image:
15-
type: string
16-
# solbuildpackpusher/solidity-buildpack-deps:ubuntu2204-2
17-
default: "solbuildpackpusher/solidity-buildpack-deps@sha256:877fcc2589779f8245770711d10db92eda97d338dae76b6a9f27dde1a41b3aa0"
1814
ubuntu-2404-docker-image:
1915
type: string
2016
# solbuildpackpusher/solidity-buildpack-deps:ubuntu2404-3
@@ -30,8 +26,8 @@ parameters:
3026
emscripten-docker-image:
3127
type: string
3228
# NOTE: Please remember to update the `scripts/build_emscripten.sh` whenever the hash of this image changes.
33-
# solbuildpackpusher/solidity-buildpack-deps:emscripten-20
34-
default: "solbuildpackpusher/solidity-buildpack-deps@sha256:98f963ed799a0d206ef8e7b5475f847e0dea53b7fdea9618bbc6106a62730bd2"
29+
# solbuildpackpusher/solidity-buildpack-deps:emscripten-21
30+
default: "solbuildpackpusher/solidity-buildpack-deps@sha256:fc53d68a4680ffa7d5f70164e13a903478964f15bcc07434d74833a05f4fbc19"
3531
evm-version:
3632
type: string
3733
default: prague
@@ -198,6 +194,19 @@ commands:
198194
fi
199195
echo -n "$CIRCLE_SHA1" > commit_hash.txt
200196
197+
install_and_check_minimum_requirements:
198+
parameters:
199+
compiler:
200+
description: "Compiler to check: gcc or clang"
201+
type: enum
202+
enum:
203+
- gcc
204+
- clang
205+
steps:
206+
- run:
207+
name: Install and check minimum requirements
208+
command: scripts/ci/install_and_check_minimum_requirements.sh "--<< parameters.compiler >>"
209+
201210
run_build:
202211
steps:
203212
- run:
@@ -560,42 +569,6 @@ defaults:
560569
MAKEFLAGS: -j 10
561570
CPUs: 10
562571

563-
- base_ubuntu2204: &base_ubuntu2204
564-
docker:
565-
- image: << pipeline.parameters.ubuntu-2204-docker-image >>
566-
environment: &base_ubuntu2204_env
567-
TERM: xterm
568-
CC: gcc
569-
CXX: g++
570-
MAKEFLAGS: -j 3
571-
CPUs: 3
572-
573-
- base_ubuntu2204_large: &base_ubuntu2204_large
574-
<<: *base_ubuntu2204
575-
resource_class: large
576-
environment: &base_ubuntu2204_large_env
577-
<<: *base_ubuntu2204_env
578-
MAKEFLAGS: -j 5
579-
CPUs: 5
580-
581-
- base_ubuntu2204_clang: &base_ubuntu2204_clang
582-
docker:
583-
- image: << pipeline.parameters.ubuntu-2204-docker-image >>
584-
environment: &base_ubuntu2204_clang_env
585-
TERM: xterm
586-
CC: clang
587-
CXX: clang++
588-
MAKEFLAGS: -j 3
589-
CPUs: 3
590-
591-
- base_ubuntu2204_clang_large: &base_ubuntu2204_clang_large
592-
<<: *base_ubuntu2204_clang
593-
resource_class: large
594-
environment: &base_ubuntu2204_clang_large_env
595-
<<: *base_ubuntu2204_clang_env
596-
MAKEFLAGS: -j 5
597-
CPUs: 5
598-
599572
- base_ubuntu2404: &base_ubuntu2404
600573
docker:
601574
- image: << pipeline.parameters.ubuntu-2404-docker-image >>
@@ -1103,23 +1076,41 @@ jobs:
11031076
- solc/solc-static-linux
11041077
- matrix_notify_failure_unless_pr
11051078

1106-
b_ubu_2204:
1107-
<<: *base_ubuntu2204_large
1079+
b_ubu_min_req:
1080+
<<: *base_ubuntu2404_large
11081081
steps:
11091082
- checkout
1083+
- install_and_check_minimum_requirements:
1084+
compiler: gcc
11101085
- run_build
1086+
- store_artifacts_solc
1087+
- persist_executables_to_workspace
11111088
- matrix_notify_failure_unless_pr
1089+
- build
11121090

1113-
b_ubu_2204_clang:
1114-
<<: *base_ubuntu2204_clang_large
1091+
b_ubu_min_req_clang:
1092+
<<: *base_ubuntu2404_clang_large
11151093
environment:
1116-
<<: *base_ubuntu2204_clang_large_env
1094+
<<: *base_ubuntu2404_clang_large_env
11171095
MAKEFLAGS: -j 10
11181096
steps:
11191097
- checkout
1098+
- install_and_check_minimum_requirements:
1099+
compiler: clang
11201100
- run_build
11211101
- matrix_notify_failure_unless_pr
11221102

1103+
t_ubu_min_req_soltest:
1104+
<<: *base_ubuntu2404_large
1105+
parallelism: 20
1106+
environment:
1107+
<<: *base_ubuntu2404_large_env
1108+
EVM: << pipeline.parameters.evm-version >>
1109+
EOF_VERSION: 0
1110+
OPTIMIZE: 0
1111+
steps:
1112+
- soltest
1113+
11231114
b_ubu_ossfuzz: &b_ubu_ossfuzz
11241115
<<: *base_ubuntu_clang_large
11251116
steps:
@@ -1893,8 +1884,14 @@ workflows:
18931884
# build-only
18941885
- b_docs: *requires_nothing
18951886
- b_ubu_ossfuzz: *requires_nothing
1896-
- b_ubu_2204: *requires_nothing
1897-
- b_ubu_2204_clang: *requires_nothing
1887+
1888+
# build and test with minimum supported versions of dependencies
1889+
- b_ubu_min_req_clang: *requires_nothing
1890+
- b_ubu_min_req: *requires_nothing
1891+
- t_ubu_min_req_soltest:
1892+
<<: *on_all_tags_and_branches
1893+
requires:
1894+
- b_ubu_min_req
18981895

18991896
# OS/X build and tests
19001897
- b_osx: *requires_nothing

Changelog.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Bugfixes:
1010
* Yul Optimizer: Fix edge case in which invalid Yul code is produced by ExpressionSimplifier due to expressions being substituted that contain out-of-scope variables.
1111

1212
Build System:
13-
* Update to boost 1.70.0 for non-windows builds.
13+
* Update minimum version requirements of Boost to 1.83.0 for non-windows builds and of GCC and Clang to 13.3 and 18.1.3, respectively. Fixes infinite recursion on `boost::rational` comparison affecting compiler binaries built with GCC<14.0 and Boost<1.75.
1414

1515
### 0.8.30 (2025-05-07)
1616

cmake/EthDependencies.cmake

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,9 @@ else()
4444
# Boost 1.67 moved container_hash into is own module.
4545
# Boost 1.69 boost::system is header-only and no longer needs to be fetched as component
4646
# Boost 1.70 comes with its own BoostConfig.cmake and is the new (non-deprecated) behavior
47-
find_package(Boost 1.70.0 QUIET REQUIRED COMPONENTS ${BOOST_COMPONENTS})
47+
# Boost 1.75 fixes infinite recursion on `boost::rational` comparison with GCC<14.0 under C++20
48+
# Boost 1.83 is the version that comes with Ubuntu 24.04.
49+
find_package(Boost 1.83.0 QUIET REQUIRED COMPONENTS ${BOOST_COMPONENTS})
4850
endif()
4951

5052
# If cmake is older than boost and boost is older than 1.70,

docs/installing-solidity.rst

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -320,14 +320,16 @@ Prerequisites - All Operating Systems
320320

321321
The following are dependencies for all builds of Solidity:
322322

323+
.. Note: This has to be kept in sync with `scripts/ci/install_and_check_minimum_requirements.sh`.
324+
323325
+-----------------------------------+-------------------------------------------------------+
324326
| Software | Notes |
325327
+===================================+=======================================================+
326328
| `CMake`_ (version 3.21.3+ on | Cross-platform build file generator. |
327329
| Windows, 3.13+ otherwise) | |
328330
+-----------------------------------+-------------------------------------------------------+
329331
| `Boost`_ (version 1.77+ on | C++ libraries. |
330-
| Windows, 1.70+ otherwise) | |
332+
| Windows, 1.83+ otherwise) | |
331333
+-----------------------------------+-------------------------------------------------------+
332334
| `Git`_ | Command-line tool for retrieving source code. |
333335
+-----------------------------------+-------------------------------------------------------+
@@ -372,8 +374,10 @@ Minimum Compiler Versions
372374

373375
The following C++ compilers and their minimum versions can build the Solidity codebase:
374376

375-
- `GCC <https://gcc.gnu.org>`_, version 11+
376-
- `Clang <https://clang.llvm.org/>`_, version 14+
377+
.. Note: Minimum versions for GCC and Clang are based on availability in Ubuntu 24.04.
378+
379+
- `GCC <https://gcc.gnu.org>`_, version 13.3+
380+
- `Clang <https://clang.llvm.org/>`_, version 18.1.3+
377381
- `MSVC <https://visualstudio.microsoft.com/vs/>`_, version 2019+
378382

379383
Prerequisites - macOS
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
#!/usr/bin/env bash
2+
set -euo pipefail
3+
4+
# These versions must be kept in sync with the docs in `docs/installing-solidity.rst#building-from-source`.
5+
6+
# minimum boost version
7+
BOOST_VERSION=1.83
8+
9+
# minimum cmake version
10+
CMAKE_MAJOR=3
11+
CMAKE_MINOR=13
12+
CMAKE_PATCH=0
13+
CMAKE_FULL_VERSION="${CMAKE_MAJOR}.${CMAKE_MINOR}.${CMAKE_PATCH}"
14+
15+
# minimum gcc/clang versions
16+
GCC_VERSION=13.3.0
17+
CLANG_VERSION=18.1.3
18+
19+
# which compiler version to check in this script
20+
check_gcc=false
21+
check_clang=false
22+
23+
while (( $# > 0 )); do
24+
case "$1" in
25+
--gcc)
26+
check_gcc=true
27+
shift
28+
;;
29+
--clang)
30+
check_clang=true
31+
shift
32+
;;
33+
*)
34+
echo "Unknown option: $1"
35+
echo "Usage: $0 [--gcc] [--clang]"
36+
exit 1
37+
;;
38+
esac
39+
done
40+
41+
echo "-- Removing boost and CMake from the system"
42+
sudo apt-get --quiet=2 remove --purge 'libboost*'
43+
sudo apt-get --quiet=2 remove --purge cmake
44+
45+
echo "-- Installing Boost ${BOOST_VERSION}"
46+
sudo apt-get --quiet=2 update
47+
sudo apt-get --quiet=2 install libboost${BOOST_VERSION}-all-dev
48+
installed_boost_version=$(dpkg-query --showformat='${Version}' --show libboost${BOOST_VERSION}-all-dev 2>/dev/null || echo "none")
49+
if [[ $installed_boost_version != ${BOOST_VERSION}* ]]; then
50+
echo "Error: installed version of boost is $installed_boost_version, expected $BOOST_VERSION"
51+
exit 1
52+
fi
53+
54+
echo "-- Installing CMake ${CMAKE_FULL_VERSION}"
55+
wget "https://cmake.org/files/v${CMAKE_MAJOR}.${CMAKE_MINOR}/cmake-${CMAKE_FULL_VERSION}-Linux-x86_64.tar.gz"
56+
tar --extract --gzip --file "cmake-${CMAKE_FULL_VERSION}-Linux-x86_64.tar.gz"
57+
sudo mv "cmake-${CMAKE_FULL_VERSION}-Linux-x86_64" "/opt/cmake-${CMAKE_FULL_VERSION}"
58+
sudo ln --symbolic "/opt/cmake-${CMAKE_FULL_VERSION}/bin/"* /usr/local/bin/
59+
echo "-- Installed $(cmake --version)"
60+
61+
if [[ "$check_gcc" == true ]]; then
62+
installed_gcc_version=$(gcc -dumpfullversion -dumpversion || echo "none")
63+
if [[ "$installed_gcc_version" != "$GCC_VERSION" ]]; then
64+
echo "Error: installed version of gcc is $installed_gcc_version, expected $GCC_VERSION"
65+
exit 1
66+
fi
67+
echo "-- gcc version check passed: $installed_gcc_version"
68+
fi
69+
70+
if [[ "$check_clang" == true ]]; then
71+
installed_clang_version=$(clang -dumpfullversion -dumpversion || echo "none")
72+
if [[ "$installed_clang_version" != "$CLANG_VERSION" ]]; then
73+
echo "Error: installed version of clang is $installed_clang_version, expected $CLANG_VERSION"
74+
exit 1
75+
fi
76+
echo "-- clang version check passed: $installed_clang_version"
77+
fi

0 commit comments

Comments
 (0)