Skip to content

Commit

Permalink
Merge pull request #31 from tronprotocol/tron_solidity0.5.14
Browse files Browse the repository at this point in the history
Tron solidity0.5.14
  • Loading branch information
taihaofu authored Nov 11, 2020
2 parents 37057bf + 100ccf3 commit b5ab4d1
Show file tree
Hide file tree
Showing 393 changed files with 7,189 additions and 2,634 deletions.
20 changes: 11 additions & 9 deletions .circleci/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,27 @@

The docker images are build locally on the developer machine:

```!sh
```sh
cd .circleci/docker/

docker build -t ethereum/solidity-buildpack-deps:ubuntu1904 -f Dockerfile.ubuntu1904 .
docker push ethereum/solidity-buildpack-deps:ubuntu1904
docker build -t ethereum/solidity-buildpack-deps:ubuntu1904-<revision> -f Dockerfile.ubuntu1904 .
docker push ethereum/solidity-buildpack-deps:ubuntu1904-<revision>
```

which you can find on Dockerhub after the push at:
The current revision is stored in a [circle ci pipeline parameter](https://github.com/CircleCI-Public/api-preview-docs/blob/master/docs/pipeline-parameters.md#pipeline-parameters) called `docker-image-rev`. Please update the value assigned to this parameter at the time of a docker image update. Please verify that the value assigned to the parameter matches the revision part of the docker image tag (`<revision>` in the docker build/push snippet shown above). Otherwise, the docker image used by circle ci and the one actually pushed to docker hub will differ.

https://hub.docker.com/r/ethereum/solidity-buildpack-deps
Once the docker image has been built and pushed to Dockerhub, you can find it at:

where the image tag reflects the target OS to build Solidity and run its test on.
https://hub.docker.com/r/ethereum/solidity-buildpack-deps:ubuntu1904-<revision>

where the image tag reflects the target OS and revision to build Solidity and run its tests on.

### Testing docker images locally

```!sh
```sh
cd solidity
# Mounts your local solidity directory in docker container for testing
docker run -v `pwd`:/src/solidity -ti ethereum/solidity-buildpack-deps:ubuntu1904 /bin/bash
docker run -v `pwd`:/src/solidity -ti ethereum/solidity-buildpack-deps:ubuntu1904-<revision> /bin/bash
cd /src/solidity
<commands_to_test_build_with_new_docker_image>
```
```
96 changes: 76 additions & 20 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@
# - t: test
# - ubu: ubuntu
# - ems: Emscripten
version: 2
version: 2.1
parameters:
docker-image-rev:
type: string
default: "3"

defaults:

Expand Down Expand Up @@ -106,7 +110,7 @@ defaults:

- test_ubuntu1904_clang: &test_ubuntu1904_clang
docker:
- image: ethereum/solidity-buildpack-deps:ubuntu1904-clang
- image: ethereum/solidity-buildpack-deps:ubuntu1904-clang-<< pipeline.parameters.docker-image-rev >>
steps:
- checkout
- attach_workspace:
Expand All @@ -117,7 +121,7 @@ defaults:

- test_ubuntu1904: &test_ubuntu1904
docker:
- image: ethereum/solidity-buildpack-deps:ubuntu1904
- image: ethereum/solidity-buildpack-deps:ubuntu1904-<< pipeline.parameters.docker-image-rev >>
steps:
- checkout
- attach_workspace:
Expand Down Expand Up @@ -287,10 +291,11 @@ jobs:

b_ubu_clang: &build_ubuntu1904_clang
docker:
- image: ethereum/solidity-buildpack-deps:ubuntu1904-clang
- image: ethereum/solidity-buildpack-deps:ubuntu1904-clang-<< pipeline.parameters.docker-image-rev >>
environment:
CC: clang
CXX: clang++
CMAKE_OPTIONS: -DLLL=ON
steps:
- checkout
- run: *run_build
Expand All @@ -299,7 +304,9 @@ jobs:

b_ubu: &build_ubuntu1904
docker:
- image: ethereum/solidity-buildpack-deps:ubuntu1904
- image: ethereum/solidity-buildpack-deps:ubuntu1904-<< pipeline.parameters.docker-image-rev >>
environment:
CMAKE_OPTIONS: -DLLL=ON
steps:
- checkout
- run: *run_build
Expand All @@ -310,12 +317,13 @@ jobs:
<<: *build_ubuntu1904
environment:
FORCE_RELEASE: ON
CMAKE_OPTIONS: -DLLL=ON

b_ubu18: &build_ubuntu1804
docker:
- image: ethereum/solidity-buildpack-deps:ubuntu1804
- image: ethereum/solidity-buildpack-deps:ubuntu1804-<< pipeline.parameters.docker-image-rev >>
environment:
CMAKE_OPTIONS: -DCMAKE_CXX_FLAGS=-O2
CMAKE_OPTIONS: -DCMAKE_CXX_FLAGS=-O2 -DLLL=ON
CMAKE_BUILD_TYPE: RelWithDebugInfo
steps:
- checkout
Expand Down Expand Up @@ -360,7 +368,7 @@ jobs:
<<: *build_ubuntu1904
environment:
CMAKE_BUILD_TYPE: Debug
CMAKE_OPTIONS: -DCMAKE_TOOLCHAIN_FILE=cmake/toolchains/cxx20.cmake -DUSE_CVC4=OFF
CMAKE_OPTIONS: -DCMAKE_TOOLCHAIN_FILE=cmake/toolchains/cxx20.cmake -DUSE_CVC4=OFF -DLLL=ON
steps:
- checkout
- run: *run_build
Expand Down Expand Up @@ -400,6 +408,7 @@ jobs:
- image: archlinux/base
environment:
TERM: xterm
CMAKE_OPTIONS: -DLLL=ON
steps:
- run:
name: Install build dependencies
Expand All @@ -416,6 +425,7 @@ jobs:
environment:
TERM: xterm
CMAKE_BUILD_TYPE: Debug
CMAKE_OPTIONS: -DLLL=ON
steps:
- checkout
- restore_cache:
Expand Down Expand Up @@ -472,7 +482,7 @@ jobs:

b_ems:
docker:
- image: trzeci/emscripten:sdk-tag-1.38.22-64bit
- image: trzeci/emscripten:sdk-tag-1.39.3-64bit
environment:
TERM: xterm
steps:
Expand Down Expand Up @@ -519,7 +529,7 @@ jobs:

b_docs:
docker:
- image: ethereum/solidity-buildpack-deps:ubuntu1904
- image: ethereum/solidity-buildpack-deps:ubuntu1904-<< pipeline.parameters.docker-image-rev >>
steps:
- checkout
- run: *setup_prerelease_commit_hash
Expand All @@ -544,7 +554,7 @@ jobs:

t_ubu_cli: &t_ubu_cli
docker:
- image: ethereum/solidity-buildpack-deps:ubuntu1904
- image: ethereum/solidity-buildpack-deps:ubuntu1904-<< pipeline.parameters.docker-image-rev >>
environment:
TERM: xterm
steps:
Expand Down Expand Up @@ -597,7 +607,22 @@ jobs:
npm --version
test/solcjsTests.sh /tmp/workspace/soljson.js $(cat /tmp/workspace/version.txt)
t_ems_external_gnosis:
t_ems_compile_ext_gnosis:
docker:
- image: circleci/node:10
environment:
TERM: xterm
steps:
- checkout
- attach_workspace:
at: /tmp/workspace
- run:
name: External GnosisSafe compilation
command: |
export COMPILE_ONLY=1
test/externalTests/gnosis.sh /tmp/workspace/soljson.js || test/externalTests/gnosis.sh /tmp/workspace/soljson.js
t_ems_test_ext_gnosis:
docker:
- image: circleci/node:10
environment:
Expand All @@ -613,7 +638,22 @@ jobs:
- run: *gitter_notify_failure
- run: *gitter_notify_success

t_ems_external_zeppelin:
t_ems_compile_ext_zeppelin:
docker:
- image: circleci/node:10
environment:
TERM: xterm
steps:
- checkout
- attach_workspace:
at: /tmp/workspace
- run:
name: External Zeppelin compilation
command: |
export COMPILE_ONLY=1
test/externalTests/zeppelin.sh /tmp/workspace/soljson.js || test/externalTests/zeppelin.sh /tmp/workspace/soljson.js
t_ems_test_ext_zeppelin:
docker:
- image: circleci/node:10
environment:
Expand All @@ -629,7 +669,26 @@ jobs:
- run: *gitter_notify_failure
- run: *gitter_notify_success

t_ems_external_colony:
t_ems_compile_ext_colony:
docker:
- image: circleci/node:10
environment:
TERM: xterm
steps:
- checkout
- attach_workspace:
at: /tmp/workspace
- run:
name: Install test dependencies
command: |
sudo apt-get -qy install lsof
- run:
name: External ColonyNetworks compilation
command: |
export COMPILE_ONLY=1
test/externalTests/colony.sh /tmp/workspace/soljson.js || test/externalTests/colony.sh /tmp/workspace/soljson.js
t_ems_test_ext_colony:
docker:
- image: circleci/node:10
environment:
Expand Down Expand Up @@ -693,6 +752,9 @@ workflows:
# Emscripten build and selected tests
- b_ems: *workflow_trigger_on_tags
- t_ems_solcjs: *workflow_emscripten
- t_ems_compile_ext_colony: *workflow_emscripten
- t_ems_compile_ext_gnosis: *workflow_emscripten
- t_ems_compile_ext_zeppelin: *workflow_emscripten

nightly:

Expand All @@ -706,12 +768,6 @@ workflows:
- develop_060

jobs:
# Emscripten builds and external tests
- b_ems: *workflow_trigger_on_tags
- t_ems_external_zeppelin: *workflow_emscripten
- t_ems_external_gnosis: *workflow_emscripten
- t_ems_external_colony: *workflow_emscripten

# OSSFUZZ builds and (regression) tests
- b_ubu_ossfuzz: *workflow_trigger_on_tags
- t_ubu_ossfuzz: *workflow_ubuntu1904_ossfuzz
Expand Down
35 changes: 8 additions & 27 deletions .circleci/docker/Dockerfile.clang.ubuntu1904
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ RUN git clone --recursive -b boost-1.69.0 https://github.com/boostorg/boost.git
rm -rf /usr/src/boost

# Z3
RUN git clone --depth 1 -b z3-4.8.6 https://github.com/Z3Prover/z3.git \
RUN git clone --depth 1 -b z3-4.8.7 https://github.com/Z3Prover/z3.git \
/usr/src/z3; \
cd /usr/src/z3; \
python scripts/mk_make.py --prefix=/usr ; \
Expand All @@ -89,43 +89,24 @@ RUN set -ex; \
ninja install/strip; \
rm -rf /usr/src/libprotobuf-mutator

# ETHASH
RUN set -ex; \
cd /usr/src; \
git clone --branch="v0.4.4" https://github.com/chfast/ethash.git; \
cd ethash; \
mkdir build; \
cd build; \
cmake .. -G Ninja -DBUILD_SHARED_LIBS=ON -DETHASH_BUILD_TESTS=OFF -DCMAKE_INSTALL_PREFIX="/usr"; \
ninja; \
ninja install/strip; \
rm -rf /usr/src/ethash

# INTX
RUN set -ex; \
cd /usr/src; \
git clone --branch="v0.2.0" https://github.com/chfast/intx.git; \
cd intx; \
mkdir build; \
cd build; \
cmake .. -G Ninja -DBUILD_SHARED_LIBS=ON -DINTX_TESTING=OFF -DINTX_BENCHMARKING=OFF -DCMAKE_INSTALL_PREFIX="/usr"; \
ninja; \
ninja install/strip; \
rm -rf /usr/src/intx;

# EVMONE
RUN set -ex; \
cd /usr/src; \
git clone --branch="v0.1.0" --recurse-submodules https://github.com/ethereum/evmone.git; \
git clone --branch="v0.3.0" --recurse-submodules https://github.com/ethereum/evmone.git; \
cd evmone; \
mkdir build; \
cd build; \
# isoltest links against the evmone shared library
cmake -G Ninja -DBUILD_SHARED_LIBS=ON -DCMAKE_INSTALL_PREFIX="/usr" ..; \
ninja; \
ninja install/strip; \
# abiv2_proto_ossfuzz links against the evmone standalone static library
cmake -G Ninja -DBUILD_SHARED_LIBS=OFF -DCMAKE_INSTALL_PREFIX="/usr" ..; \
ninja; \
ninja install/strip; \
rm -rf /usr/src/evmone

FROM base
COPY --from=libraries /usr/lib /usr/lib
COPY --from=libraries /usr/bin /usr/bin
COPY --from=libraries /usr/include /usr/include
COPY --from=libraries /usr/include /usr/include
28 changes: 2 additions & 26 deletions .circleci/docker/Dockerfile.ubuntu1804
Original file line number Diff line number Diff line change
Expand Up @@ -74,34 +74,10 @@ RUN set -ex; \
ar r /usr/lib/libFuzzingEngine.a *.o; \
rm -rf /var/lib/libfuzzer

# ETHASH
RUN set -ex; \
cd /usr/src; \
git clone --branch="v0.4.4" https://github.com/chfast/ethash.git; \
cd ethash; \
mkdir build; \
cd build; \
cmake .. -G Ninja -DBUILD_SHARED_LIBS=OFF -DETHASH_BUILD_TESTS=OFF -DCMAKE_INSTALL_PREFIX="/usr"; \
ninja; \
ninja install/strip; \
rm -rf /usr/src/ethash

# INTX
RUN set -ex; \
cd /usr/src; \
git clone --branch="v0.2.0" https://github.com/chfast/intx.git; \
cd intx; \
mkdir build; \
cd build; \
cmake .. -G Ninja -DBUILD_SHARED_LIBS=OFF -DINTX_TESTING=OFF -DINTX_BENCHMARKING=OFF -DCMAKE_INSTALL_PREFIX="/usr"; \
ninja; \
ninja install/strip; \
rm -rf /usr/src/intx;

# EVMONE
ARG EVMONE_HASH="f10d12c190f55a9d373e78b2dc0074d35d752c02cb536bb6fe754fb3719dd69e"
ARG EVMONE_HASH="fa4f40daf7cf9ccbcca6c78345977e084ea2136a8eae661e4d19471be852b15b"
ARG EVMONE_MAJOR="0"
ARG EVMONE_MINOR="1"
ARG EVMONE_MINOR="3"
ARG EVMONE_MICRO="0"
RUN set -ex; \
EVMONE_VERSION="$EVMONE_MAJOR.$EVMONE_MINOR.$EVMONE_MICRO"; \
Expand Down
27 changes: 2 additions & 25 deletions .circleci/docker/Dockerfile.ubuntu1904
Original file line number Diff line number Diff line change
Expand Up @@ -74,37 +74,14 @@ RUN set -ex; \
ar r /usr/lib/libFuzzingEngine.a *.o; \
rm -rf /var/lib/libfuzzer

# ETHASH
RUN set -ex; \
cd /usr/src; \
git clone --branch="v0.4.4" https://github.com/chfast/ethash.git; \
cd ethash; \
mkdir build; \
cd build; \
cmake .. -G Ninja -DBUILD_SHARED_LIBS=OFF -DETHASH_BUILD_TESTS=OFF -DCMAKE_INSTALL_PREFIX="/usr"; \
ninja; \
ninja install/strip; \
rm -rf /usr/src/ethash

# INTX
RUN set -ex; \
cd /usr/src; \
git clone --branch="v0.2.0" https://github.com/chfast/intx.git; \
cd intx; \
mkdir build; \
cd build; \
cmake .. -G Ninja -DBUILD_SHARED_LIBS=OFF -DINTX_TESTING=OFF -DINTX_BENCHMARKING=OFF -DCMAKE_INSTALL_PREFIX="/usr"; \
ninja; \
ninja install/strip; \
rm -rf /usr/src/intx;

# EVMONE
RUN set -ex; \
cd /usr/src; \
git clone --branch="v0.1.0" --recurse-submodules https://github.com/ethereum/evmone.git; \
git clone --branch="v0.3.0" --recurse-submodules https://github.com/ethereum/evmone.git; \
cd evmone; \
mkdir build; \
cd build; \
# isoltest links against the evmone shared library
cmake -G Ninja -DBUILD_SHARED_LIBS=ON -DCMAKE_INSTALL_PREFIX="/usr" ..; \
ninja; \
ninja install/strip; \
Expand Down
Loading

0 comments on commit b5ab4d1

Please sign in to comment.