Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
250 changes: 226 additions & 24 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,25 +13,25 @@ parameters:
default: "ghcr.io/argotorg/solidity-buildpack-deps@sha256:1f387a77be889f65a2a25986a5c5eccc88cec23fabe6aeaf351790751145c81e"
ubuntu-2404-docker-image:
type: string
# ghcr.io/argotorg/solidity-buildpack-deps:ubuntu2404-6
default: "ghcr.io/argotorg/solidity-buildpack-deps@sha256:c0412c53e59ce0c96bde4c08e7332ea12e4cadba9bbac829621947897fa21272"
# ghcr.io/argotorg/solidity-buildpack-deps:ubuntu2404-7
default: "ghcr.io/argotorg/solidity-buildpack-deps@sha256:e52bd8fbb38908f203c6866e39562548faf26e5b7a5174f9860b44aae2b8f0cd"
ubuntu-2404-arm-docker-image:
type: string
# ghcr.io/argotorg/solidity-buildpack-deps:ubuntu2404.arm-2
default: "ghcr.io/argotorg/solidity-buildpack-deps@sha256:27b03c1c4688e5d69b10e0539460346a3dee3b10b0e04fb406b9707c6f0dd95e"
# ghcr.io/argotorg/solidity-buildpack-deps:ubuntu2404.arm-3
default: "ghcr.io/argotorg/solidity-buildpack-deps@sha256:1e6dbf9a9173f2645449281a1e11918a95ca6dc04e59aa9d70824cffc44697ed"
ubuntu-2404-clang-docker-image:
type: string
# ghcr.io/argotorg/solidity-buildpack-deps:ubuntu2404.clang-7
default: "ghcr.io/argotorg/solidity-buildpack-deps@sha256:7466ed23590cf14e60da884894723bcdab064742f017dcfcce015999b4f9143b"
# ghcr.io/argotorg/solidity-buildpack-deps:ubuntu2404.clang-8
default: "ghcr.io/argotorg/solidity-buildpack-deps@sha256:e283c8ec6a59c76565c89b856d8019af2fa5beb96f27d3064fc4dda42bf3524d"
ubuntu-clang-ossfuzz-docker-image:
type: string
# ghcr.io/argotorg/solidity-buildpack-deps:ubuntu.clang.ossfuzz-12
default: "ghcr.io/argotorg/solidity-buildpack-deps@sha256:c7088af5082bf764244a6251ecf3dd29d280d2cd2cd071f011f7f32e0326f426"
# ghcr.io/argotorg/solidity-buildpack-deps:ubuntu.clang.ossfuzz-13
default: "ghcr.io/argotorg/solidity-buildpack-deps@sha256:2acb5d6f254ece25a96096f26960b5fe114eb86ceca92312cd20d59c096bf6e4"
emscripten-docker-image:
type: string
# NOTE: Please remember to update the `scripts/build_emscripten.sh` whenever the hash of this image changes.
# ghcr.io/argotorg/solidity-buildpack-deps:emscripten-21
default: "ghcr.io/argotorg/solidity-buildpack-deps@sha256:fc53d68a4680ffa7d5f70164e13a903478964f15bcc07434d74833a05f4fbc19"
# ghcr.io/argotorg/solidity-buildpack-deps:emscripten-22
default: "ghcr.io/argotorg/solidity-buildpack-deps@sha256:b9c953144d82cca5553f65626bc43b8af456dbc8966f8732ff9522f33ca8d722"
evm-version:
type: string
default: osaka
Expand Down Expand Up @@ -208,15 +208,118 @@ commands:

run_build:
steps:
- run:
name: Build
command: scripts/ci/build.sh
# TODO: remove the line below
# Before merging this PR we need to use an alternative develop branch to test the functionality, `ci-ccache`

# On `ci-ccache` and `breaking` we intentionally do NOT restore any ccache, so every run starts from scratch.
# Tags always skip ccache. Other branches restore the most recent cache produced on `ci-ccache`.
- when:
condition:
and:
- equal: ["", << pipeline.git.tag >>]
- not:
or:
- equal: ["ci-ccache", << pipeline.git.branch >>]
- equal: ["breaking", << pipeline.git.branch >>]
steps:
- restore_cache:
keys:
# Reuse cache produced on ci-ccache (prefix match; restores the most recent).
- v1-{{ .Environment.CCACHE_KEY }}-ccache-{{ .Environment.CIRCLE_JOB }}-ci-ccache-
# WARNING! If you edit anything between here and save_cache, remember to bump version or invalidate the cache manually.
- when:
condition:
and:
- equal: ["", << pipeline.git.tag >>]
steps:
- run:
name: Build (ccache)
command: |
export CCACHE_DIR="$HOME/.ccache"
export CCACHE_BASEDIR="$(pwd)"
export CCACHE_NOHASHDIR=1
mkdir -p "$CCACHE_DIR"
export CMAKE_OPTIONS="${CMAKE_OPTIONS:-} -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache"
ccache -z

scripts/ci/build.sh

ccache -s
- when:
condition:
or:
- not:
equal: ["", << pipeline.git.tag >>]
steps:
- run:
name: Build (no ccache)
command: scripts/ci/build.sh

# On `ci-ccache` we always generate a fresh cache by never restoring and by saving under a unique key.
- when:
condition:
equal: ["ci-ccache", << pipeline.git.branch >>]
steps:
- save_cache:
key: v1-{{ .Environment.CCACHE_KEY }}-ccache-{{ .Environment.CIRCLE_JOB }}-ci-ccache-{{ .Revision }}
paths:
- ~/.ccache

run_build_ossfuzz:
steps:
- run:
name: Build_ossfuzz
command: scripts/ci/build_ossfuzz.sh
# On `ci-ccache` and `breaking` we intentionally do NOT restore any ccache, so every run starts from scratch.
# Tags always skip ccache. Other branches restore the most recent cache produced on `ci-ccache`.
- when:
condition:
and:
- equal: ["", << pipeline.git.tag >>]
- not:
or:
- equal: ["ci-ccache", << pipeline.git.branch >>]
- equal: ["breaking", << pipeline.git.branch >>]
steps:
- restore_cache:
keys:
# Reuse cache produced on ci-ccache (prefix match; restores the most recent).
- v1-{{ .Environment.CCACHE_KEY }}-ccache-{{ .Environment.CIRCLE_JOB }}-ci-ccache-
# WARNING! If you edit anything between here and save_cache, remember to bump version or invalidate the cache manually.
- when:
condition:
and:
- equal: ["", << pipeline.git.tag >>]
steps:
- run:
name: Build_ossfuzz (ccache)
command: |
export CCACHE_DIR="$HOME/.ccache"
export CCACHE_BASEDIR="$(pwd)"
export CCACHE_NOHASHDIR=1
mkdir -p "$CCACHE_DIR"
export CMAKE_OPTIONS="${CMAKE_OPTIONS:-} -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache"
ccache -z

scripts/ci/build_ossfuzz.sh

ccache -s
- when:
condition:
or:
- not:
equal: ["", << pipeline.git.tag >>]
steps:
- run:
name: Build_ossfuzz (no ccache)
command: scripts/ci/build_ossfuzz.sh

# On `ci-ccache` we always generate a fresh cache by never restoring and by saving under a unique key.
- when:
condition:
equal: ["ci-ccache", << pipeline.git.branch >>]
steps:
- save_cache:
key: v1-{{ .Environment.CCACHE_KEY }}-ccache-{{ .Environment.CIRCLE_JOB }}-ci-ccache-{{ .Revision }}
paths:
- ~/.ccache

run_proofs:
steps:
Expand Down Expand Up @@ -1197,7 +1300,7 @@ jobs:
- run:
name: Install build dependencies
command: |
pacman --noconfirm -Syu --noprogressbar --needed base-devel boost cmake git openssh tar
pacman --noconfirm -Syu --noprogressbar --needed base-devel boost cmake ccache git openssh tar
- checkout
- run_build
- store_artifacts_solc
Expand Down Expand Up @@ -1257,10 +1360,59 @@ jobs:
MAKEFLAGS: -j 10
steps:
- checkout
- run:
name: Build
command: |
scripts/ci/build_emscripten.sh
# On `ci-ccache` and `breaking` we intentionally do NOT restore any ccache, so every run starts from scratch.
# Tags always skip ccache. Other branches restore the most recent cache produced on `ci-ccache`.
- when:
condition:
and:
- equal: ["", << pipeline.git.tag >>]
- not:
or:
- equal: ["ci-ccache", << pipeline.git.branch >>]
- equal: ["breaking", << pipeline.git.branch >>]
steps:
- restore_cache:
keys:
# Reuse cache produced on ci-ccache (prefix match; restores the most recent).
- v1-{{ .Environment.CCACHE_KEY }}-ccache-{{ .Environment.CIRCLE_JOB }}-ci-ccache-
# WARNING! If you edit anything between here and save_cache, remember to bump version or invalidate the cache manually.
- when:
condition:
and:
- equal: ["", << pipeline.git.tag >>]
steps:
- run:
name: Build (ccache)
command: |
export CCACHE_DIR="$HOME/.ccache"
export CCACHE_BASEDIR="$(pwd)"
export CCACHE_NOHASHDIR=1
mkdir -p "$CCACHE_DIR"
ccache -z

scripts/ci/build_emscripten.sh

ccache -s
- when:
condition:
or:
- not:
equal: ["", << pipeline.git.tag >>]
steps:
- run:
name: Build (no ccache)
command: |
scripts/ci/build_emscripten.sh

# On `ci-ccache` we always generate a fresh cache by never restoring and by saving under a unique key.
- when:
condition:
equal: ["ci-ccache", << pipeline.git.branch >>]
steps:
- save_cache:
key: v1-{{ .Environment.CCACHE_KEY }}-ccache-{{ .Environment.CIRCLE_JOB }}-ci-ccache-{{ .Revision }}
paths:
- ~/.ccache
- store_artifacts:
path: upload/soljson.js
destination: soljson.js
Expand Down Expand Up @@ -1737,9 +1889,59 @@ jobs:
key: dependencies-win-{{ arch }}-{{ checksum "scripts/install_deps.ps1" }}
paths:
- .\deps
- run:
name: "Building solidity"
command: scripts/ci/build_win.sh
# On `ci-ccache` and `breaking` we intentionally do NOT restore any ccache, so every run starts from scratch.
# Tags always skip ccache. Other branches restore the most recent cache produced on `ci-ccache`.
- when:
condition:
and:
- equal: ["", << pipeline.git.tag >>]
- not:
or:
- equal: ["ci-ccache", << pipeline.git.branch >>]
- equal: ["breaking", << pipeline.git.branch >>]
steps:
- restore_cache:
keys:
# Reuse cache produced on ci-ccache (prefix match; restores the most recent).
- v1-{{ .Environment.CCACHE_KEY }}-ccache-{{ .Environment.CIRCLE_JOB }}-ci-ccache-
# WARNING! If you edit anything between here and save_cache, remember to bump version or invalidate the cache manually.
- when:
condition:
and:
- equal: ["", << pipeline.git.tag >>]
steps:
- run:
name: "Building solidity (ccache)"
command: |
export CCACHE_DIR="$HOME/.ccache"
export CCACHE_BASEDIR="$(pwd)"
export CCACHE_NOHASHDIR=1
export PATH="$(pwd)/deps/ccache:$PATH"
mkdir -p "$CCACHE_DIR"
export CMAKE_OPTIONS="${CMAKE_OPTIONS:-} -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache"
ccache -z

scripts/ci/build_win.sh

ccache -s
- when:
condition:
or:
- not:
equal: ["", << pipeline.git.tag >>]
steps:
- run:
name: "Building solidity (no ccache)"
command: scripts/ci/build_win.sh
# On `ci-ccache` we always generate a fresh cache by never restoring and by saving under a unique key.
- when:
condition:
equal: ["ci-ccache", << pipeline.git.branch >>]
steps:
- save_cache:
key: v1-{{ .Environment.CCACHE_KEY }}-ccache-{{ .Environment.CIRCLE_JOB }}-ci-ccache-{{ .Revision }}
paths:
- ~/.ccache
- run:
name: "Run solc.exe to make sure build was successful."
command: .\build\solc\Release\solc.exe --version
Expand Down
1 change: 1 addition & 0 deletions .circleci/osx_install_dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ then
brew update
brew upgrade
brew install cmake
brew install ccache
brew install wget
brew install coreutils
brew install diffutils
Expand Down
6 changes: 4 additions & 2 deletions scripts/ci/build_ossfuzz.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,10 @@ function generate_protobuf_bindings
function build_fuzzers
{
cd "${BUILDDIR}"
cmake .. -DCMAKE_BUILD_TYPE="${CMAKE_BUILD_TYPE:-Release}" -DCCACHE=OFF \
-DCMAKE_TOOLCHAIN_FILE="${ROOTDIR}"/cmake/toolchains/libfuzzer.cmake
# shellcheck disable=SC2086
cmake .. -DCMAKE_BUILD_TYPE="${CMAKE_BUILD_TYPE:-Release}" \
-DCMAKE_TOOLCHAIN_FILE="${ROOTDIR}"/cmake/toolchains/libfuzzer.cmake \
$CMAKE_OPTIONS
make ossfuzz ossfuzz_proto ossfuzz_abiv2 -j 4
}

Expand Down
4 changes: 3 additions & 1 deletion scripts/ci/build_win.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,13 @@ cd build/
# NOTE: Using an array to force Bash to do wildcard expansion
boost_dir=("${ROOTDIR}/deps/boost/lib/cmake/Boost-"*)

"${ROOTDIR}/deps/cmake/bin/cmake" \
# shellcheck disable=SC2086
"${ROOTDIR}/deps/cmake/bin/cmake" \
-G "Visual Studio 16 2019" \
-DBoost_DIR="${boost_dir[*]}" \
-DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded \
-DCMAKE_INSTALL_PREFIX="${ROOTDIR}/uploads/" \
${CMAKE_OPTIONS:-} \
..
MSBuild.exe solidity.sln \
-property:Configuration=Release \
Expand Down
8 changes: 8 additions & 0 deletions scripts/install_deps.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,14 @@ if ( -not (Test-Path "$PSScriptRoot\..\deps\boost") ) {
mv cmake-3.27.4-windows-x86_64 "$PSScriptRoot\..\deps\cmake"
Remove-Item cmake.zip

Invoke-WebRequest -URI "https://github.com/ccache/ccache/releases/download/v4.12.2/ccache-4.12.2-windows-x86_64.zip" -OutFile ccache.zip
if ((Get-FileHash ccache.zip).Hash -ne "82c1b130b25cc162531dc7a062dc5ea99349cd536bc9eba8a66d976802d66516") {
throw 'Downloaded ccache package has wrong checksum.'
}
tar -xf ccache.zip
mv ccache-4.12.2-windows-x86_64 "$PSScriptRoot\..\deps\ccache"
Remove-Item ccache.zip

# FIXME: The default user agent results in Artifactory treating Invoke-WebRequest as a browser
# and serving it a page that requires JavaScript.
Invoke-WebRequest -URI "https://archives.boost.io/release/1.83.0/source/boost_1_83_0.zip" -OutFile boost.zip -UserAgent ""
Expand Down
1 change: 1 addition & 0 deletions test/libsolidity/SolidityParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ BOOST_AUTO_TEST_CASE(function_natspec_documentation)
}
)";
BOOST_CHECK(successParse(text));
BOOST_CHECK(successParse(text));
ErrorList errors;
ASTPointer<ContractDefinition> contract = parseText(text, errors);
FunctionDefinition const* function = nullptr;
Expand Down