Skip to content

Commit e3a3829

Browse files
committed
Increase minimum Boost version to 1.77 on Windows
1 parent d4d778d commit e3a3829

File tree

3 files changed

+17
-7
lines changed

3 files changed

+17
-7
lines changed

cmake/EthDependencies.cmake

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,20 @@ set(ETH_SCRIPTS_DIR ${ETH_CMAKE_DIR}/scripts)
2525
## use multithreaded boost libraries, with -mt suffix
2626
set(Boost_USE_MULTITHREADED ON)
2727
option(Boost_USE_STATIC_LIBS "Link Boost statically" ON)
28-
if(WIN32)
28+
if (WIN32)
2929
option(Boost_USE_STATIC_RUNTIME "Link Boost against static C++ runtime libraries" ON)
3030
endif()
3131

3232
set(BOOST_COMPONENTS "filesystem;unit_test_framework;program_options;system")
3333

34-
find_package(Boost 1.65.0 QUIET REQUIRED COMPONENTS ${BOOST_COMPONENTS})
34+
if (WIN32)
35+
# Boost 1.77 fixes a bug that causes crashes on Windows for some relative paths in --allow-paths.
36+
# See https://github.com/boostorg/filesystem/issues/201
37+
find_package(Boost 1.77.0 QUIET REQUIRED COMPONENTS ${BOOST_COMPONENTS})
38+
else()
39+
# Boost 1.65 is the first to also provide boost::get for rvalue-references (#5787).
40+
find_package(Boost 1.65.0 QUIET REQUIRED COMPONENTS ${BOOST_COMPONENTS})
41+
endif()
3542

3643
# If cmake is older than boost and boost is older than 1.70,
3744
# find_package does not define imported targets, so we have to
@@ -51,7 +58,7 @@ foreach (BOOST_COMPONENT IN LISTS BOOST_COMPONENTS)
5158
set_property(TARGET Boost::${BOOST_COMPONENT} PROPERTY IMPORTED_LOCATION ${Boost_${BOOST_COMPONENT_UPPER}_LIBRARY})
5259
set_property(TARGET Boost::${BOOST_COMPONENT} PROPERTY INTERFACE_LINK_LIBRARIES ${Boost_${BOOST_COMPONENT_UPPER}_LIBRARIES})
5360
set_property(TARGET Boost::${BOOST_COMPONENT} PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${Boost_INCLUDE_DIRS})
54-
endif()
61+
endif()
5562
get_property(LOCATION TARGET Boost::${BOOST_COMPONENT} PROPERTY IMPORTED_LOCATION)
5663
message(STATUS "Found Boost::${BOOST_COMPONENT} at ${LOCATION}")
5764
endforeach()

docs/installing-solidity.rst

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,8 @@ The following are dependencies for all builds of Solidity:
313313
+===================================+=======================================================+
314314
| `CMake`_ (version 3.13+) | Cross-platform build file generator. |
315315
+-----------------------------------+-------------------------------------------------------+
316-
| `Boost`_ (version 1.65+) | C++ libraries. |
316+
| `Boost`_ (version 1.77+ on | C++ libraries. |
317+
| Windows, 1.65+ otherwise) | |
317318
+-----------------------------------+-------------------------------------------------------+
318319
| `Git`_ | Command-line tool for retrieving source code. |
319320
+-----------------------------------+-------------------------------------------------------+
@@ -378,6 +379,8 @@ You need to install the following dependencies for Windows builds of Solidity:
378379
+-----------------------------------+-------------------------------------------------------+
379380
| `Visual Studio 2019`_ (Optional) | C++ compiler and dev environment. |
380381
+-----------------------------------+-------------------------------------------------------+
382+
| `Boost`_ (version 1.77+) | C++ libraries. |
383+
+-----------------------------------+-------------------------------------------------------+
381384

382385
If you already have one IDE and only need the compiler and libraries,
383386
you could install Visual Studio 2019 Build Tools.

scripts/install_deps.ps1

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@ if ( -not (Test-Path "$PSScriptRoot\..\deps\boost") ) {
1515

1616
# FIXME: The default user agent results in Artifactory treating Invoke-WebRequest as a browser
1717
# and serving it a page that requires JavaScript.
18-
Invoke-WebRequest -URI "https://boostorg.jfrog.io/artifactory/main/release/1.74.0/source/boost_1_74_0.zip" -OutFile boost.zip -UserAgent ""
19-
if ((Get-FileHash boost.zip).Hash -ne "a0e7ce67c52d816708fdeccdd8c9725626ba61254c13c18770498cacd514710a") {
18+
Invoke-WebRequest -URI "https://boostorg.jfrog.io/artifactory/main/release/1.77.0/source/boost_1_77_0.zip" -OutFile boost.zip -UserAgent ""
19+
if ((Get-FileHash boost.zip).Hash -ne "d2886ceff60c35fc6dc9120e8faa960c1e9535f2d7ce447469eae9836110ea77") {
2020
throw 'Downloaded Boost source package has wrong checksum.'
2121
}
2222
tar -xf boost.zip
23-
cd boost_1_74_0
23+
cd boost_1_77_0
2424
.\bootstrap.bat
2525
.\b2 -j4 -d0 link=static runtime-link=static variant=release threading=multi address-model=64 --with-filesystem --with-system --with-program_options --with-test --prefix="$PSScriptRoot\..\deps\boost" install
2626
if ( -not $? ) { throw "Error building boost." }

0 commit comments

Comments
 (0)