Skip to content

Commit

Permalink
Merge pull request #7716 from ethereum/develop
Browse files Browse the repository at this point in the history
Merge develop into release for 0.5.13
  • Loading branch information
chriseth authored Nov 14, 2019
2 parents 7709ece + 42338a5 commit 5b0b510
Show file tree
Hide file tree
Showing 374 changed files with 14,896 additions and 9,560 deletions.
69 changes: 40 additions & 29 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,17 +104,6 @@ defaults:
name: command line tests
command: ./test/cmdlineTests.sh

- test_ubuntu1904: &test_ubuntu1904
docker:
- image: ethereum/solidity-buildpack-deps:ubuntu1904
steps:
- checkout
- attach_workspace:
at: build
- run: *run_soltest
- store_test_results: *store_test_results
- store_artifacts: *artifacts_test_results

- test_ubuntu1904_clang: &test_ubuntu1904_clang
docker:
- image: ethereum/solidity-buildpack-deps:ubuntu1904-clang
Expand All @@ -126,7 +115,7 @@ defaults:
- store_test_results: *store_test_results
- store_artifacts: *artifacts_test_results

- test_ubuntu1904_all: &test_ubuntu1904
- test_ubuntu1904: &test_ubuntu1904
docker:
- image: ethereum/solidity-buildpack-deps:ubuntu1904
steps:
Expand Down Expand Up @@ -423,40 +412,61 @@ jobs:

b_osx:
macos:
xcode: "10.0.0"
xcode: "11.0.0"
environment:
TERM: xterm
CMAKE_BUILD_TYPE: Debug
CMAKE_OPTIONS: -DLLL=ON
steps:
- checkout
- restore_cache:
keys:
- dependencies-osx-{{ .Branch }}-{{ checksum ".circleci/config.yml" }}-{{ checksum ".circleci/osx_install_dependencies.sh" }}
- run:
name: Install build dependencies
command: |
brew unlink python
brew install z3
brew install boost
brew install cmake
brew install wget
./scripts/install_obsolete_jsoncpp_1_7_4.sh
command: ./.circleci/osx_install_dependencies.sh
- save_cache:
key: dependencies-osx-{{ .Branch }}-{{ checksum ".circleci/config.yml" }}-{{ checksum ".circleci/osx_install_dependencies.sh" }}
paths:
- /usr/local/bin
- /usr/local/sbin
- /usr/local/lib
- /usr/local/include
- /usr/local/Cellar
- /usr/local/Homebrew
- run: *run_build
- store_artifacts: *artifacts_solc
- persist_to_workspace: *artifacts_executables
- persist_to_workspace: *artifacts_build_dir

t_osx_soltest:
macos:
xcode: "11.0.0"
environment:
EVM: constantinople
OPTIMIZE: 0
TERM: xterm
steps:
- checkout
- restore_cache:
keys:
- dependencies-osx-{{ .Branch }}-{{ checksum ".circleci/config.yml" }}-{{ checksum ".circleci/osx_install_dependencies.sh" }}
- attach_workspace:
at: build
- run: *run_soltest
- store_test_results: *store_test_results
- store_artifacts: *artifacts_test_results

t_osx_cli:
macos:
xcode: "10.0.0"
xcode: "11.0.0"
environment:
TERM: xterm
steps:
- checkout
- restore_cache:
keys:
- dependencies-osx-{{ .Branch }}-{{ checksum ".circleci/config.yml" }}-{{ checksum ".circleci/osx_install_dependencies.sh" }}
- attach_workspace:
at: build
- run:
name: Install dependencies
command: |
brew unlink python
brew install z3
- run: *run_cmdline_tests
- store_artifacts: *artifacts_test_results

Expand Down Expand Up @@ -568,7 +578,7 @@ jobs:
environment:
EVM: constantinople
OPTIMIZE: 0
flags: --no-smt
SOLTEST_FLAGS: --no-smt
ASAN_OPTIONS: check_initialization_order=true:detect_stack_use_after_return=true:strict_init_order=true:strict_string_checks=true:detect_invalid_pointer_pairs=2

t_ems_solcjs:
Expand Down Expand Up @@ -660,6 +670,7 @@ workflows:
# OS/X build and tests
- b_osx: *workflow_trigger_on_tags
- t_osx_cli: *workflow_osx
- t_osx_soltest: *workflow_osx

# Ubuntu build and tests
- b_ubu: *workflow_trigger_on_tags
Expand Down
4 changes: 2 additions & 2 deletions .circleci/docker/Dockerfile.clang.ubuntu1904
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,12 @@ RUN git clone --recursive -b boost-1.69.0 https://github.com/boostorg/boost.git
./bootstrap.sh --with-toolset=clang --prefix=/usr; \
./b2 toolset=clang headers; \
./b2 toolset=clang variant=release \
system regex filesystem unit_test_framework program_options \
system filesystem unit_test_framework program_options \
install -j $(($(nproc)/2)); \
rm -rf /usr/src/boost

# Z3
RUN git clone --depth 1 -b Z3-4.8.5 https://github.com/Z3Prover/z3.git \
RUN git clone --depth 1 -b z3-4.8.6 https://github.com/Z3Prover/z3.git \
/usr/src/z3; \
cd /usr/src/z3; \
python scripts/mk_make.py --prefix=/usr ; \
Expand Down
2 changes: 1 addition & 1 deletion .circleci/docker/Dockerfile.ubuntu1804
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ RUN set -ex; \
build-essential \
software-properties-common \
cmake ninja-build clang++-8 \
libboost-regex-dev libboost-filesystem-dev libboost-test-dev libboost-system-dev \
libboost-filesystem-dev libboost-test-dev libboost-system-dev \
libboost-program-options-dev \
libjsoncpp-dev \
llvm-8-dev libz3-static-dev \
Expand Down
2 changes: 1 addition & 1 deletion .circleci/docker/Dockerfile.ubuntu1904
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ RUN set -ex; \
build-essential \
software-properties-common \
cmake ninja-build clang++-8 libc++-8-dev libc++abi-8-dev \
libboost-regex-dev libboost-filesystem-dev libboost-test-dev libboost-system-dev \
libboost-filesystem-dev libboost-test-dev libboost-system-dev \
libboost-program-options-dev \
libjsoncpp-dev \
llvm-8-dev libcvc4-dev libz3-static-dev libleveldb1d \
Expand Down
59 changes: 59 additions & 0 deletions .circleci/osx_install_dependencies.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
#! /bin/bash
#------------------------------------------------------------------------------
# Bash script to install osx dependencies
#
# The documentation for solidity is hosted at:
#
# https://solidity.readthedocs.org
#
# ------------------------------------------------------------------------------
# This file is part of solidity.
#
# solidity is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# solidity is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with solidity. If not, see <http://www.gnu.org/licenses/>
#
# (c) 2016-2019 solidity contributors.
# ------------------------------------------------------------------------------

# note that the following directories may be cached by circleci:
# - /usr/local/bin
# - /usr/local/sbin
# - /usr/local/lib
# - /usr/local/include
# - /usr/local/Cellar
# - /usr/local/Homebrew

if [ ! -f /usr/local/lib/libz3.a ] # if this file does not exists (cache was not restored), rebuild dependencies
then
brew unlink python
brew install boost
brew install cmake
brew install wget
brew install coreutils
./scripts/install_obsolete_jsoncpp_1_7_4.sh

# z3
wget https://github.com/Z3Prover/z3/releases/download/z3-4.8.6/z3-4.8.6-x64-osx-10.14.6.zip
unzip z3-4.8.6-x64-osx-10.14.6.zip
rm -f z3-4.8.6-x64-osx-10.14.6.zip
cp z3-4.8.6-x64-osx-10.14.6/bin/libz3.a /usr/local/lib
cp z3-4.8.6-x64-osx-10.14.6/bin/z3 /usr/local/bin
cp z3-4.8.6-x64-osx-10.14.6/include/* /usr/local/include
rm -rf z3-4.8.6-x64-osx-10.14.6

# evmone
wget https://github.com/ethereum/evmone/releases/download/v0.1.0/evmone-0.1.0-darwin-x86_64.tar.gz
tar xzpf evmone-0.1.0-darwin-x86_64.tar.gz -C /usr/local
rm -f evmone-0.1.0-darwin-x86_64.tar.gz
fi

3 changes: 2 additions & 1 deletion .circleci/soltest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
# EVM=version_string Specifies EVM version to compile for (such as homestead, etc)
# OPTIMIZE=1 Enables backend optimizer
# ABI_ENCODER_V2=1 Enables ABI encoder version 2
# SOLTEST_FLAGS=<flags> Appends <flags> to default SOLTEST_ARGS
#
# ------------------------------------------------------------------------------
# This file is part of solidity.
Expand Down Expand Up @@ -54,7 +55,7 @@ get_logfile_basename() {
}

BOOST_TEST_ARGS="--color_output=no --show_progress=yes --logger=JUNIT,error,test_results/`get_logfile_basename`.xml"
SOLTEST_ARGS="--evm-version=$EVM --evmonepath /usr/lib/libevmone.so $flags"
SOLTEST_ARGS="--evm-version=$EVM $SOLTEST_FLAGS"
test "${OPTIMIZE}" = "1" && SOLTEST_ARGS="${SOLTEST_ARGS} --optimize"
test "${ABI_ENCODER_V2}" = "1" && SOLTEST_ARGS="${SOLTEST_ARGS} --abiencoderv2 --optimize-yul"

Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ include(EthPolicy)
eth_policy()

# project name and version should be set after cmake_policy CMP0048
set(PROJECT_VERSION "0.5.12")
set(PROJECT_VERSION "0.5.13")
project(solidity VERSION ${PROJECT_VERSION} LANGUAGES C CXX)

include(TestBigEndian)
Expand Down
10 changes: 5 additions & 5 deletions CODING_STYLE.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ Use `solAssert` and `solUnimplementedAssert` generously to check assumptions tha
4. Favour declarations close to use; don't habitually declare at top of scope ala C.
5. Pass non-trivial parameters as const reference, unless the data is to be copied into the function, then either pass by const reference or by value and use std::move.
6. If a function returns multiple values, use std::tuple (std::pair acceptable) or better introduce a struct type. Do not use */& arguments.
7. Use parameters of pointer type only if ``nullptr`` is a valid argument, use references otherwise. Often, ``boost::optional`` is better suited than a raw pointer.
7. Use parameters of pointer type only if ``nullptr`` is a valid argument, use references otherwise. Often, ``std::optional`` is better suited than a raw pointer.
8. Never use a macro where adequate non-preprocessor C++ can be written.
9. Only use ``auto`` if the type is very long and rather irrelevant.
10. Do not pass bools: prefer enumerations instead.
Expand All @@ -135,12 +135,12 @@ enum class Accuracy
};
struct MeanSigma
{
float mean;
float standardDeviation;
float mean = 0.0f;
float standardDeviation = 1.0f;
};
double const d = 0;
int i;
int j;
int i = 0;
int j = 0;
char* s;
MeanAndSigma ms meanAndSigma(std::vector<float> const& _v, Accuracy _a);
Derived* x = dynamic_cast<Derived*>(base);
Expand Down
28 changes: 28 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,30 @@
### 0.5.13 (2019-11-14)

Language Features:
* Allow to obtain the address of a linked library with ``address(LibraryName)``.


Compiler Features:
* Code Generator: Use SELFBALANCE opcode for ``address(this).balance`` if using Istanbul EVM.
* EWasm: Experimental EWasm binary output via ``--ewasm`` and as documented in standard-json.
* SMTChecker: Add break/continue support to the CHC engine.
* SMTChecker: Support assignments to multi-dimensional arrays and mappings.
* SMTChecker: Support inheritance and function overriding.
* Standard JSON Interface: Output the storage layout of a contract when artifact ``storageLayout`` is requested.
* TypeChecker: List possible candidates when overload resolution fails.
* TypeChecker: Disallow variables of library types.


Bugfixes:
* Code Generator: Fixed a faulty assert that would wrongly trigger for array sizes exceeding unsigned integer.
* SMTChecker: Fix internal error when accessing indices of fixed bytes.
* SMTChecker: Fix internal error when using function pointers as arguments.
* SMTChecker: Fix internal error when implicitly converting string literals to fixed bytes.
* Type Checker: Disallow constructor of the same class to be used as modifier.
* Type Checker: Treat magic variables as unknown identifiers in inline assembly.



### 0.5.12 (2019-10-01)

Language Features:
Expand All @@ -10,6 +37,7 @@ Compiler Features:
* SMTChecker: Add loop support to the CHC engine.
* Yul Optimizer: Take side-effect-freeness of user-defined functions into account.
* Yul Optimizer: Remove redundant mload/sload operations.
* Yul Optimizer: Use the fact that branch conditions have certain value inside the branch.


Bugfixes:
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ Please follow the
[Developers Guide](https://solidity.readthedocs.io/en/latest/contributing.html)
if you want to help.

You can find our current feature and bug priorities for forthcoming releases [in the projects section](https://github.com/ethereum/solidity/projects).

## Maintainers
* [@axic](https://github.com/axic)
* [@chriseth](https://github.com/chriseth)
Expand Down
5 changes: 5 additions & 0 deletions cmake/EthCompilerSettings.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ endif()

eth_add_cxx_compiler_flag_if_supported(-Wimplicit-fallthrough)

# Prevent the path of the source directory from ending up in the binary via __FILE__ macros.
eth_add_cxx_compiler_flag_if_supported("-fmacro-prefix-map=${CMAKE_SOURCE_DIR}=/solidity")

if (("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU") OR ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang"))
# Enables all the warnings about constructions that some users consider questionable,
# and that are easy to avoid. Also enable some extra warning flags that are not
Expand Down Expand Up @@ -130,6 +133,8 @@ elseif (DEFINED MSVC)
add_compile_options(-D_WIN32_WINNT=0x0600) # declare Windows Vista API requirement
add_compile_options(-DNOMINMAX) # undefine windows.h MAX && MIN macros cause it cause conflicts with std::min && std::max functions
add_compile_options(/utf-8) # enable utf-8 encoding (solves warning 4819)
add_compile_options(-DBOOST_REGEX_NO_LIB) # disable automatic boost::regex library selection
add_compile_options(-D_REGEX_MAX_STACK_COUNT=200000L) # increase std::regex recursion depth limit

# disable empty object file warning
set(CMAKE_STATIC_LINKER_FLAGS "${CMAKE_STATIC_LINKER_FLAGS} /ignore:4221")
Expand Down
2 changes: 1 addition & 1 deletion cmake/EthDependencies.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ set(ETH_SCRIPTS_DIR ${ETH_CMAKE_DIR}/scripts)
set(Boost_USE_MULTITHREADED ON)
option(Boost_USE_STATIC_LIBS "Link Boost statically" ON)

set(BOOST_COMPONENTS "regex;filesystem;unit_test_framework;program_options;system")
set(BOOST_COMPONENTS "filesystem;unit_test_framework;program_options;system")

find_package(Boost 1.65.0 QUIET REQUIRED COMPONENTS ${BOOST_COMPONENTS})

Expand Down
14 changes: 14 additions & 0 deletions cmake/EthUtils.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,17 @@ macro(eth_default_option O DEF)
endif()
endmacro()

function(detect_stray_source_files FILELIST DIRECTORY)
if(CMAKE_VERSION VERSION_LESS 3.12)
file(GLOB sources RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "${DIRECTORY}/*.cpp" "${DIRECTORY}/*.h")
else()
file(GLOB sources RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" CONFIGURE_DEPENDS "${DIRECTORY}/*.cpp" "${DIRECTORY}/*.h")
endif()
foreach(path IN LISTS FILELIST)
list(REMOVE_ITEM sources ${path})
endforeach()
list(LENGTH sources leftover_sources)
if (leftover_sources)
message(SEND_ERROR "The following source files are present but are not compiled: ${sources}")
endif()
endfunction(detect_stray_source_files)
Loading

0 comments on commit 5b0b510

Please sign in to comment.