Skip to content

Commit d6ada68

Browse files
author
neo hong
committed
merge 0.8.6
2 parents 17f8f81 + 11564f7 commit d6ada68

File tree

3,975 files changed

+62834
-18646
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

3,975 files changed

+62834
-18646
lines changed

.circleci/build_win.ps1

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,14 @@ if ("$Env:FORCE_RELEASE" -Or "$Env:CIRCLE_TAG") {
66
New-Item prerelease.txt -type file
77
Write-Host "Building release version."
88
}
9+
else {
10+
# Use last commit date rather than build date to avoid ending up with builds for
11+
# different platforms having different version strings (and therefore producing different bytecode)
12+
# if the CI is triggered just before midnight.
13+
$last_commit_timestamp = git log -1 --date=unix --format=%cd HEAD
14+
$last_commit_date = (Get-Date -Date "1970-01-01 00:00:00Z").toUniversalTime().addSeconds($last_commit_timestamp).ToString("yyyy.M.d")
15+
-join("ci.", $last_commit_date) | out-file -encoding ascii prerelease.txt
16+
}
917

1018
mkdir build
1119
cd build

.circleci/config.yml

Lines changed: 112 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -9,20 +9,20 @@ version: 2.1
99
parameters:
1010
ubuntu-2004-docker-image:
1111
type: string
12-
# solbuildpackpusher/solidity-buildpack-deps:ubuntu2004-4
13-
default: "solbuildpackpusher/solidity-buildpack-deps@sha256:aca1372dcc5edadd3db13ff1aa6807727d79e08082a48eb7cc05444c1b516ace"
12+
# solbuildpackpusher/solidity-buildpack-deps:ubuntu2004-6
13+
default: "solbuildpackpusher/solidity-buildpack-deps@sha256:da44d7f78e093f7f0415abf07f7c1fd1c2ed4fa65fefea428821a05186c42ec9"
1414
ubuntu-2004-clang-docker-image:
1515
type: string
16-
# solbuildpackpusher/solidity-buildpack-deps:ubuntu2004.clang-4
17-
default: "solbuildpackpusher/solidity-buildpack-deps@sha256:0954edfb48a7efa6922b4d6adf536a2fc483ca34ad62f95ec54c33a616a66974"
16+
# solbuildpackpusher/solidity-buildpack-deps:ubuntu2004.clang-6
17+
default: "solbuildpackpusher/solidity-buildpack-deps@sha256:c78dd9c48d393b57afe053aeb2d0d358a9f31ac85039a181724c2f8408d0bcf8"
1818
ubuntu-1604-clang-ossfuzz-docker-image:
1919
type: string
20-
# solbuildpackpusher/solidity-buildpack-deps:ubuntu1604.clang.ossfuzz-6
21-
default: "solbuildpackpusher/solidity-buildpack-deps@sha256:990ed3aaac3fcb87ca9b63a021a91ed89dfd165b341aa7b5c6457cdbe132dfb3"
20+
# solbuildpackpusher/solidity-buildpack-deps:ubuntu1604.clang.ossfuzz-9
21+
default: "solbuildpackpusher/solidity-buildpack-deps@sha256:5078e1d74ab6f4329e9218c2d8c0ebe2d42817a3d4c3c62ce887100cbe9bc739"
2222
emscripten-docker-image:
2323
type: string
24-
# solbuildpackpusher/solidity-buildpack-deps:emscripten-2
25-
default: "solbuildpackpusher/solidity-buildpack-deps@sha256:23dad3b34deae8107c8551804ef299f6a89c23ed506e8118fac151e2bdc9018c"
24+
# solbuildpackpusher/solidity-buildpack-deps:emscripten-5
25+
default: "solbuildpackpusher/solidity-buildpack-deps@sha256:d28afb9624c2352ea40f157d1a321ffac77f54a21e33a8e8744f9126b780ded4"
2626

2727
orbs:
2828
win: circleci/[email protected]
@@ -88,10 +88,9 @@ defaults:
8888
- test/tools/ossfuzz/abiv2_proto_ossfuzz
8989
- test/tools/ossfuzz/abiv2_isabelle_ossfuzz
9090
- test/tools/ossfuzz/const_opt_ossfuzz
91-
- test/tools/ossfuzz/solc_noopt_mutator_ossfuzz
92-
- test/tools/ossfuzz/solc_noopt_ossfuzz
93-
- test/tools/ossfuzz/solc_opt_mutator_ossfuzz
94-
- test/tools/ossfuzz/solc_opt_ossfuzz
91+
- test/tools/ossfuzz/solc_mutator_ossfuzz
92+
- test/tools/ossfuzz/solc_ossfuzz
93+
- test/tools/ossfuzz/stack_reuse_codegen_ossfuzz
9594
- test/tools/ossfuzz/strictasm_assembly_ossfuzz
9695
- test/tools/ossfuzz/strictasm_diff_ossfuzz
9796
- test/tools/ossfuzz/strictasm_opt_ossfuzz
@@ -355,8 +354,8 @@ jobs:
355354
command: apt -q update && apt install -y python3-pip
356355
- run:
357356
name: Install pylint
358-
command: python3 -m pip install pylint z3-solver pygments-lexer-solidity
359-
# also z3-solver to make sure pylint knows about this module, pygments-lexer-solidity for docs
357+
command: python3 -m pip install pylint z3-solver pygments-lexer-solidity parsec tabulate
358+
# also z3-solver, parsec and tabulate to make sure pylint knows about this module, pygments-lexer-solidity for docs
360359
- run:
361360
name: Linting Python Scripts
362361
command: ./scripts/pylint_all.py
@@ -414,6 +413,26 @@ jobs:
414413
- checkout
415414
- run: *run_docs_pragma_min_version
416415

416+
t_pyscripts_ubu:
417+
docker:
418+
- image: << pipeline.parameters.ubuntu-2004-docker-image >>
419+
steps:
420+
- checkout
421+
- run:
422+
name: Python unit tests
423+
command: python3 test/pyscriptTests.py
424+
425+
t_pyscripts_win:
426+
executor:
427+
name: win/default
428+
shell: powershell.exe
429+
steps:
430+
- run: git config --global core.autocrlf false
431+
- checkout
432+
- run:
433+
name: Python unit tests
434+
command: python.exe test/pyscriptTests.py
435+
417436
b_ubu_clang: &build_ubuntu2004_clang
418437
resource_class: xlarge
419438
docker:
@@ -552,7 +571,9 @@ jobs:
552571

553572
b_archlinux:
554573
docker:
555-
- image: archlinux/base
574+
# FIXME: Newer releases won't work until CircleCI updates its host machines.
575+
# See https://github.com/ethereum/solidity/pull/11332
576+
- image: archlinux:base-20210131.0.14634
556577
environment:
557578
TERM: xterm
558579
MAKEFLAGS: -j 3
@@ -691,11 +712,19 @@ jobs:
691712

692713
t_archlinux_soltest: &t_archlinux_soltest
693714
docker:
694-
- image: archlinux/base
715+
# FIXME: Newer releases won't work until CircleCI updates its host machines.
716+
# See https://github.com/ethereum/solidity/pull/11332
717+
- image: archlinux:base-20210131.0.14634
695718
environment:
696719
EVM: constantinople
697720
OPTIMIZE: 0
698721
TERM: xterm
722+
# For Archlinux we do not have prebuilt docker images and we would need to build evmone from source,
723+
# thus we forgo semantics tests to speed things up.
724+
# FIXME: Z3 4.8.11 prerelease is now in main Arch Linux repos but it makes some of our SMT
725+
# tests hang. Disabling SMT tests until we get a proper release.
726+
# See https://github.com/Z3Prover/z3/issues/5330 for more details.
727+
SOLTEST_FLAGS: --no-semantic-tests --no-smt
699728
steps:
700729
- run:
701730
name: Install runtime dependencies
@@ -844,6 +873,7 @@ jobs:
844873
name: win/default
845874
shell: powershell.exe
846875
steps:
876+
# NOTE: Not disabling git's core.autocrlf here because we want to build using the typical Windows config.
847877
- checkout
848878
- restore_cache:
849879
keys:
@@ -880,6 +910,8 @@ jobs:
880910
name: win/default
881911
shell: powershell.exe
882912
steps:
913+
# NOTE: Git's default core.autocrlf is fine for running soltest. We get additional coverage
914+
# for files using CRLF that way.
883915
- checkout
884916
- attach_workspace:
885917
at: build
@@ -902,13 +934,19 @@ jobs:
902934
- checkout
903935
- attach_workspace:
904936
at: build
905-
- run: scripts/bytecodecompare/storebytecode.sh && cp -v report.txt bytecode-report-ubuntu.txt
937+
- run: mkdir test-cases/
938+
- run: cd test-cases && ../scripts/isolate_tests.py ../test/
939+
- run: cd test-cases && ../scripts/bytecodecompare/prepare_report.py ../build/solc/solc --interface standard-json --report-file ../bytecode-report-ubuntu-json.txt
940+
- run: cd test-cases && ../scripts/bytecodecompare/prepare_report.py ../build/solc/solc --interface cli --report-file ../bytecode-report-ubuntu-cli.txt
941+
- store_artifacts:
942+
path: bytecode-report-ubuntu-json.txt
906943
- store_artifacts:
907-
path: report.txt
944+
path: bytecode-report-ubuntu-cli.txt
908945
- persist_to_workspace:
909946
root: .
910947
paths:
911-
- bytecode-report-ubuntu.txt
948+
- bytecode-report-ubuntu-json.txt
949+
- bytecode-report-ubuntu-cli.txt
912950

913951
b_bytecode_osx:
914952
macos:
@@ -919,31 +957,44 @@ jobs:
919957
- checkout
920958
- attach_workspace:
921959
at: .
922-
- run: scripts/bytecodecompare/storebytecode.sh && cp -v report.txt bytecode-report-osx.txt
960+
- run: mkdir test-cases/
961+
- run: cd test-cases && ../scripts/isolate_tests.py ../test/
962+
- run: cd test-cases && ../scripts/bytecodecompare/prepare_report.py ../build/solc/solc --interface standard-json --report-file ../bytecode-report-osx-json.txt
963+
- run: cd test-cases && ../scripts/bytecodecompare/prepare_report.py ../build/solc/solc --interface cli --report-file ../bytecode-report-osx-cli.txt
964+
- store_artifacts:
965+
path: bytecode-report-osx-json.txt
923966
- store_artifacts:
924-
path: report.txt
967+
path: bytecode-report-osx-cli.txt
925968
- persist_to_workspace:
926969
root: .
927970
paths:
928-
- bytecode-report-osx.txt
971+
- bytecode-report-osx-json.txt
972+
- bytecode-report-osx-cli.txt
929973

930974
b_bytecode_win:
931975
executor:
932976
name: win/default
933977
shell: cmd.exe
934978
steps:
979+
# NOTE: For bytecode generation we need the input files to be byte-for-byte identical on all
980+
# platforms so line ending conversions must absolutely be disabled.
981+
- run: git config --global core.autocrlf false
935982
- checkout
936983
- attach_workspace:
937984
at: build
938-
- run: python scripts\isolate_tests.py test\
939-
- run: python scripts\bytecodecompare\prepare_report.py build\solc\Release\solc.exe
940-
- run: cp report.txt bytecode-report-windows.txt
985+
- run: mkdir test-cases\
986+
- run: cd test-cases\ && python ..\scripts\isolate_tests.py ..\test\
987+
- run: cd test-cases\ && python ..\scripts\bytecodecompare\prepare_report.py ..\build\solc\Release\solc.exe --interface standard-json --report-file ..\bytecode-report-windows-json.txt
988+
- run: cd test-cases\ && python ..\scripts\bytecodecompare\prepare_report.py ..\build\solc\Release\solc.exe --interface cli --report-file ..\bytecode-report-windows-cli.txt
941989
- store_artifacts:
942-
path: report.txt
990+
path: bytecode-report-windows-json.txt
991+
- store_artifacts:
992+
path: bytecode-report-windows-cli.txt
943993
- persist_to_workspace:
944994
root: .
945995
paths:
946-
- bytecode-report-windows.txt
996+
- bytecode-report-windows-json.txt
997+
- bytecode-report-windows-cli.txt
947998

948999
b_bytecode_ems:
9491000
docker:
@@ -954,9 +1005,9 @@ jobs:
9541005
- checkout
9551006
- attach_workspace:
9561007
at: emscripten_build/libsolc
957-
- run: scripts/bytecodecompare/storebytecode.sh && cp -v report.txt bytecode-report-emscripten.txt
1008+
- run: scripts/bytecodecompare/storebytecode.sh && mv -v report.txt bytecode-report-emscripten.txt
9581009
- store_artifacts:
959-
path: report.txt
1010+
path: bytecode-report-emscripten.txt
9601011
- persist_to_workspace:
9611012
root: .
9621013
paths:
@@ -965,10 +1016,39 @@ jobs:
9651016
t_bytecode_compare:
9661017
docker:
9671018
- image: << pipeline.parameters.ubuntu-2004-docker-image >>
1019+
environment:
1020+
REPORT_FILES: |
1021+
bytecode-report-emscripten.txt
1022+
bytecode-report-ubuntu-json.txt
1023+
bytecode-report-ubuntu-cli.txt
1024+
bytecode-report-osx-json.txt
1025+
bytecode-report-osx-cli.txt
1026+
bytecode-report-windows-json.txt
1027+
bytecode-report-windows-cli.txt
9681028
steps:
9691029
- attach_workspace:
9701030
at: .
971-
- run: diff --report-identical-files --from-file bytecode-report-emscripten.txt bytecode-report-ubuntu.txt bytecode-report-osx.txt bytecode-report-windows.txt
1031+
- run:
1032+
name: Compare reports
1033+
command: diff --brief --report-identical-files --from-file $REPORT_FILES
1034+
- run:
1035+
name: Print diff
1036+
when: on_fail
1037+
command: diff --unified=0 --report-identical-files --from-file $REPORT_FILES | head --lines 50
1038+
- run:
1039+
name: Install zip
1040+
when: on_fail
1041+
command: |
1042+
apt update --quiet
1043+
apt install zip --assume-yes
1044+
- run:
1045+
name: Bundle reports into a single package
1046+
when: on_fail
1047+
command: zip all-bytecode-reports.zip $REPORT_FILES
1048+
- store_artifacts:
1049+
# NOTE: store_artifacts does not support the 'when' attribute.
1050+
# Fortunately when the artifact does not exist it just says "No artifact files found" and ignores it.
1051+
path: all-bytecode-reports.zip
9721052

9731053
workflows:
9741054
version: 2
@@ -985,6 +1065,8 @@ workflows:
9851065
- chk_errorcodes: *workflow_trigger_on_tags
9861066
- chk_antlr_grammar: *workflow_trigger_on_tags
9871067
- chk_docs_pragma_min_version: *workflow_trigger_on_tags
1068+
- t_pyscripts_ubu: *workflow_trigger_on_tags
1069+
- t_pyscripts_win: *workflow_trigger_on_tags
9881070

9891071
# build-only
9901072
- b_docs: *workflow_trigger_on_tags

.circleci/osx_install_dependencies.sh

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,13 @@
3333
# - /usr/local/Cellar
3434
# - /usr/local/Homebrew
3535

36+
set -eu
37+
3638
if [ ! -f /usr/local/lib/libz3.a ] # if this file does not exists (cache was not restored), rebuild dependencies
3739
then
40+
git -C /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core fetch --unshallow
41+
git -C /usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask fetch --unshallow
42+
brew update
3843
brew unlink python
3944
brew install boost
4045
brew install cmake
@@ -43,21 +48,21 @@ then
4348
./scripts/install_obsolete_jsoncpp_1_7_4.sh
4449

4550
# z3
46-
wget https://github.com/Z3Prover/z3/releases/download/z3-4.8.9/z3-4.8.9-x64-osx-10.14.6.zip
47-
unzip z3-4.8.9-x64-osx-10.14.6.zip
48-
rm -f z3-4.8.9-x64-osx-10.14.6.zip
49-
cp z3-4.8.9-x64-osx-10.14.6/bin/libz3.a /usr/local/lib
50-
cp z3-4.8.9-x64-osx-10.14.6/bin/z3 /usr/local/bin
51-
cp z3-4.8.9-x64-osx-10.14.6/include/* /usr/local/include
52-
rm -rf z3-4.8.9-x64-osx-10.14.6
51+
wget https://github.com/Z3Prover/z3/releases/download/z3-4.8.10/z3-4.8.10-x64-osx-10.15.7.zip
52+
unzip z3-4.8.10-x64-osx-10.15.7.zip
53+
rm -f z3-4.8.10-x64-osx-10.15.7.zip
54+
cp z3-4.8.10-x64-osx-10.15.7/bin/libz3.a /usr/local/lib
55+
cp z3-4.8.10-x64-osx-10.15.7/bin/z3 /usr/local/bin
56+
cp z3-4.8.10-x64-osx-10.15.7/include/* /usr/local/include
57+
rm -rf z3-4.8.10-x64-osx-10.15.7
5358

5459
# evmone
55-
wget https://github.com/ethereum/evmone/releases/download/v0.4.0/evmone-0.4.0-darwin-x86_64.tar.gz
56-
tar xzpf evmone-0.4.0-darwin-x86_64.tar.gz -C /usr/local
57-
rm -f evmone-0.4.0-darwin-x86_64.tar.gz
60+
wget https://github.com/ethereum/evmone/releases/download/v0.7.0/evmone-0.7.0-darwin-x86_64.tar.gz
61+
tar xzpf evmone-0.7.0-darwin-x86_64.tar.gz -C /usr/local
62+
rm -f evmone-0.7.0-darwin-x86_64.tar.gz
5863

5964
# hera
60-
wget https://github.com/ewasm/hera/releases/download/v0.3.2/hera-0.3.2-darwin-x86_64.tar.gz
61-
tar xzpf hera-0.3.2-darwin-x86_64.tar.gz -C /usr/local
62-
rm -f hera-0.3.2-darwin-x86_64.tar.gz
65+
wget https://github.com/ewasm/hera/releases/download/v0.3.2-evmc8/hera-0.3.2+commit.dc886eb7-darwin-x86_64.tar.gz
66+
tar xzpf hera-0.3.2+commit.dc886eb7-darwin-x86_64.tar.gz -C /usr/local
67+
rm -f hera-0.3.2+commit.dc886eb7-darwin-x86_64.tar.gz
6368
fi

.circleci/soltest.sh

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#! /bin/bash
1+
#!/usr/bin/env bash
22
#------------------------------------------------------------------------------
33
# Bash script to execute the Solidity tests by CircleCI.
44
#
@@ -36,8 +36,12 @@ set -e
3636

3737
OPTIMIZE=${OPTIMIZE:-"0"}
3838
EVM=${EVM:-"invalid"}
39-
REPODIR="$(realpath $(dirname $0)/..)"
39+
REPODIR="$(realpath "$(dirname "$0")/..")"
4040

41+
IFS=" " read -r -a BOOST_TEST_ARGS <<< "$BOOST_TEST_ARGS"
42+
IFS=" " read -r -a SOLTEST_FLAGS <<< "$SOLTEST_FLAGS"
43+
44+
# shellcheck source=scripts/common.sh
4145
source "${REPODIR}/scripts/common.sh"
4246
# Test result output directory (CircleCI is reading test results from here)
4347
mkdir -p test_results
@@ -53,11 +57,12 @@ get_logfile_basename() {
5357
echo -ne "${filename}"
5458
}
5559

56-
BOOST_TEST_ARGS="--color_output=no --show_progress=yes --logger=JUNIT,error,test_results/`get_logfile_basename`.xml ${BOOST_TEST_ARGS}"
57-
SOLTEST_ARGS="--evm-version=$EVM $SOLTEST_FLAGS"
58-
test "${OPTIMIZE}" = "1" && SOLTEST_ARGS="${SOLTEST_ARGS} --optimize"
59-
test "${ABI_ENCODER_V1}" = "1" && SOLTEST_ARGS="${SOLTEST_ARGS} --abiencoderv1"
60+
BOOST_TEST_ARGS=("--color_output=no" "--show_progress=yes" "--logger=JUNIT,error,test_results/$(get_logfile_basename).xml" "${BOOST_TEST_ARGS[@]}")
61+
SOLTEST_ARGS=("--evm-version=$EVM" "${SOLTEST_FLAGS[@]}")
62+
63+
test "${OPTIMIZE}" = "1" && SOLTEST_ARGS+=(--optimize)
64+
test "${ABI_ENCODER_V1}" = "1" && SOLTEST_ARGS+=(--abiencoderv1)
6065

61-
echo "Running ${REPODIR}/build/test/soltest ${BOOST_TEST_ARGS} -- ${SOLTEST_ARGS}"
66+
echo "Running ${REPODIR}/build/test/soltest ${BOOST_TEST_ARGS[*]} -- ${SOLTEST_ARGS[*]}"
6267

63-
${REPODIR}/build/test/soltest ${BOOST_TEST_ARGS} -- ${SOLTEST_ARGS}
68+
"${REPODIR}/build/test/soltest" "${BOOST_TEST_ARGS[@]}" -- "${SOLTEST_ARGS[@]}"

0 commit comments

Comments
 (0)