diff --git a/.circleci/README.md b/.circleci/README.md index c8bcd45f5..c754b5df0 100644 --- a/.circleci/README.md +++ b/.circleci/README.md @@ -11,7 +11,7 @@ docker build -t ethereum/solidity-buildpack-deps:ubuntu1904- -f Docker docker push ethereum/solidity-buildpack-deps:ubuntu1904- ``` -The current revision is `2`. +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 (`` 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. Once the docker image has been built and pushed to Dockerhub, you can find it at: diff --git a/.circleci/config.yml b/.circleci/config.yml index 3fd62d9d8..2cde85f2d 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -5,7 +5,11 @@ # - t: test # - ubu: ubuntu # - ems: Emscripten -version: 2 +version: 2.1 +parameters: + docker-image-rev: + type: string + default: "2" defaults: @@ -106,7 +110,7 @@ defaults: - test_ubuntu1904_clang: &test_ubuntu1904_clang docker: - - image: ethereum/solidity-buildpack-deps:ubuntu1904-clang-2 + - image: ethereum/solidity-buildpack-deps:ubuntu1904-clang-<< pipeline.parameters.docker-image-rev >> steps: - checkout - attach_workspace: @@ -117,7 +121,7 @@ defaults: - test_ubuntu1904: &test_ubuntu1904 docker: - - image: ethereum/solidity-buildpack-deps:ubuntu1904-2 + - image: ethereum/solidity-buildpack-deps:ubuntu1904-<< pipeline.parameters.docker-image-rev >> steps: - checkout - attach_workspace: @@ -287,7 +291,7 @@ jobs: b_ubu_clang: &build_ubuntu1904_clang docker: - - image: ethereum/solidity-buildpack-deps:ubuntu1904-clang-2 + - image: ethereum/solidity-buildpack-deps:ubuntu1904-clang-<< pipeline.parameters.docker-image-rev >> environment: CC: clang CXX: clang++ @@ -299,7 +303,7 @@ jobs: b_ubu: &build_ubuntu1904 docker: - - image: ethereum/solidity-buildpack-deps:ubuntu1904-2 + - image: ethereum/solidity-buildpack-deps:ubuntu1904-<< pipeline.parameters.docker-image-rev >> steps: - checkout - run: *run_build @@ -313,7 +317,7 @@ jobs: b_ubu18: &build_ubuntu1804 docker: - - image: ethereum/solidity-buildpack-deps:ubuntu1804-2 + - image: ethereum/solidity-buildpack-deps:ubuntu1804-<< pipeline.parameters.docker-image-rev >> environment: CMAKE_OPTIONS: -DCMAKE_CXX_FLAGS=-O2 CMAKE_BUILD_TYPE: RelWithDebugInfo @@ -519,7 +523,7 @@ jobs: b_docs: docker: - - image: ethereum/solidity-buildpack-deps:ubuntu1904-2 + - image: ethereum/solidity-buildpack-deps:ubuntu1904-<< pipeline.parameters.docker-image-rev >> steps: - checkout - run: *setup_prerelease_commit_hash @@ -544,7 +548,7 @@ jobs: t_ubu_cli: &t_ubu_cli docker: - - image: ethereum/solidity-buildpack-deps:ubuntu1904-2 + - image: ethereum/solidity-buildpack-deps:ubuntu1904-<< pipeline.parameters.docker-image-rev >> environment: TERM: xterm steps: @@ -602,7 +606,22 @@ jobs: npm --version test/externalTests/solc-js/solc-js.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: @@ -618,7 +637,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: @@ -634,7 +668,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: @@ -698,6 +751,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: @@ -711,12 +767,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 diff --git a/README.md b/README.md index a8c04da2a..0af8dd905 100644 --- a/README.md +++ b/README.md @@ -44,10 +44,10 @@ contract HelloWorld { To get started with Solidity, you can use [Remix](https://remix.ethereum.org/), which is an browser-based IDE. Here are some example contracts: -1. [Voting](https://solidity.readthedocs.io/en/v0.4.24/solidity-by-example.html#voting) -2. [Blind Auction](https://solidity.readthedocs.io/en/v0.4.24/solidity-by-example.html#blind-auction) -3. [Safe remote purchase](https://solidity.readthedocs.io/en/v0.4.24/solidity-by-example.html#safe-remote-purchase) -4. [Micropayment Channel](https://solidity.readthedocs.io/en/v0.4.24/solidity-by-example.html#micropayment-channel) +1. [Voting](https://solidity.readthedocs.io/en/latest/solidity-by-example.html#voting) +2. [Blind Auction](https://solidity.readthedocs.io/en/latest/solidity-by-example.html#blind-auction) +3. [Safe remote purchase](https://solidity.readthedocs.io/en/latest/solidity-by-example.html#safe-remote-purchase) +4. [Micropayment Channel](https://solidity.readthedocs.io/en/latest/solidity-by-example.html#micropayment-channel) ## Documentation diff --git a/libevmasm/Assembly.cpp b/libevmasm/Assembly.cpp index d609aefed..56f2a6768 100644 --- a/libevmasm/Assembly.cpp +++ b/libevmasm/Assembly.cpp @@ -520,8 +520,11 @@ map Assembly::optimiseInternal( LinkerObject const& Assembly::assemble() const { + // Return the already assembled object, if present. if (!m_assembledObject.bytecode.empty()) return m_assembledObject; + // Otherwise ensure the object is actually clear. + assertThrow(m_assembledObject.linkReferences.empty(), AssemblyException, "Unexpected link references."); size_t subTagSize = 1; for (auto const& sub: m_subs) diff --git a/libevmasm/LinkerObject.h b/libevmasm/LinkerObject.h index 928908032..3630365e0 100644 --- a/libevmasm/LinkerObject.h +++ b/libevmasm/LinkerObject.h @@ -35,7 +35,9 @@ namespace eth */ struct LinkerObject { + /// The bytecode. bytes bytecode; + /// Map from offsets in bytecode to library identifiers. The addresses starting at those offsets /// need to be replaced by the actual addresses by the linker. std::map linkReferences; @@ -47,7 +49,7 @@ struct LinkerObject void link(std::map const& _libraryAddresses); /// @returns a hex representation of the bytecode of the given object, replacing unlinked - /// addresses by placeholders. + /// addresses by placeholders. This output is lowercase. std::string toHex() const; /// @returns a 36 character string that is used as a placeholder for the library diff --git a/test/externalTests/common.sh b/test/externalTests/common.sh index 58ce58974..7c86f74f5 100644 --- a/test/externalTests/common.sh +++ b/test/externalTests/common.sh @@ -255,8 +255,13 @@ function truffle_run_test printLog "Running compile function..." $compile_fn verify_compiler_version "$SOLCVERSION" - printLog "Running test function..." - $test_fn + + if [[ "$COMPILE_ONLY" == 1 ]]; then + printLog "Skipping test function..." + else + printLog "Running test function..." + $test_fn + fi done }