Skip to content

Commit

Permalink
Merge pull request EOSIO#1 from boscore/release/3.0.x
Browse files Browse the repository at this point in the history
Upgrade to version 2.0 data migration and prepare for eos-vm merge (#…
  • Loading branch information
winlin committed Mar 7, 2020
2 parents 608a68a + 14db844 commit 5df6936
Show file tree
Hide file tree
Showing 454 changed files with 11,821 additions and 231,526 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
*.bc
*.wast
*.wast.hpp
*.wasm
*.s
*.dot
*.abi.hpp
Expand Down
28 changes: 15 additions & 13 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required( VERSION 3.5 )
cmake_minimum_required( VERSION 3.8 )

project( EOSIO )

Expand All @@ -15,7 +15,7 @@ list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/libraries/fc/CMakeMod
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules")

if (UNIX AND APPLE)
list(APPEND CMAKE_PREFIX_PATH "/usr/local/opt/llvm@4" "/usr/local/opt/gettext")
list(APPEND CMAKE_PREFIX_PATH "/usr/local/opt/llvm@7" "/usr/local/opt/gettext")
endif()

include( GNUInstallDirs )
Expand All @@ -25,7 +25,7 @@ include( InstallDirectoryPermissions )
include( MASSigning )

set( BLOCKCHAIN_NAME "BOS" )
set( CMAKE_CXX_STANDARD 14 )
set( CMAKE_CXX_STANDARD 17 )
set( CMAKE_CXX_EXTENSIONS ON )
set( CXX_STANDARD_REQUIRED ON)

Expand Down Expand Up @@ -55,11 +55,8 @@ if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
add_compile_options(-fdiagnostics-color=always)
endif()
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "AppleClang")
if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.0)
message(FATAL_ERROR "Clang version must be at least 4.0!")
endif()
if ("${CMAKE_GENERATOR}" STREQUAL "Ninja")
add_compile_options(-fcolor-diagnostics)
if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 6.0)
message(FATAL_ERROR "Clang version must be at least 6.0!")
endif()
endif()

Expand Down Expand Up @@ -89,6 +86,11 @@ if ("${OPENSSL_ROOT_DIR}" STREQUAL "")
endif()
endif()

# WASM runtimes to enable. Each runtime in this list will have:
# * definition EOSIO_<RUNTIME>_RUNTIME_ENABLED defined in public libchain interface
# * ctest entries with --runtime
list(APPEND EOSIO_WASM_RUNTIMES wabt) #always enable wabt; it works everywhere and parts of eosio still assume it's always available

if(UNIX)
if(APPLE)
set(whole_archive_flag "-force_load")
Expand Down Expand Up @@ -158,7 +160,7 @@ else( WIN32 ) # Apple AND Linux

if( APPLE )
# Apple Specific Options Here
message( STATUS "Configuring EOSIO on OS X" )
message( STATUS "Configuring EOSIO on macOS" )
set( CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS} ${CMAKE_CXX_FLAGS} -Wall -Wno-deprecated-declarations" )
else( APPLE )
# Linux Specific Options Here
Expand Down Expand Up @@ -201,10 +203,10 @@ if(ENABLE_COVERAGE_TESTING)
endif()

include(utils)
add_subdirectory( externals )
#add_subdirectory( externals )

if ("${CORE_SYMBOL_NAME}" STREQUAL "")
set( CORE_SYMBOL_NAME "SYS" )
set( CORE_SYMBOL_NAME "EOS" )
endif()
string(TOUPPER ${CORE_SYMBOL_NAME} CORE_SYMBOL_NAME)

Expand All @@ -221,9 +223,9 @@ endif()

message( STATUS "Using '${EOSIO_ROOT_KEY}' as public key for 'eosio' account" )

include(wasm)
#include(wasm)
add_subdirectory( libraries )
add_subdirectory( contracts )
#add_subdirectory( contracts )
add_subdirectory( plugins )
add_subdirectory( programs )
add_subdirectory( scripts )
Expand Down
9 changes: 9 additions & 0 deletions CMakeModules/CMakeASM-LLVMWARInformation.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# These trio of files implement a workaround for LLVM bug 39427

set(ASM_DIALECT "-LLVMWAR")
set(CMAKE_ASM${ASM_DIALECT}_SOURCE_FILE_EXTENSIONS llvmwar)

set(CMAKE_ASM${ASM_DIALECT}_COMPILE_OBJECT "g++ -x c++ -O3 --std=c++11 <DEFINES> <INCLUDES> <FLAGS> -c -o <OBJECT> <SOURCE>")

include(CMakeASMInformation)
set(ASM_DIALECT)
6 changes: 6 additions & 0 deletions CMakeModules/CMakeDetermineASM-LLVMWARCompiler.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# These trio of files implement a workaround for LLVM bug 39427

set(ASM_DIALECT "-LLVMWAR")
set(CMAKE_ASM${ASM_DIALECT}_COMPILER_INIT "g++")
include(CMakeDetermineASMCompiler)
set(ASM_DIALECT)
5 changes: 5 additions & 0 deletions CMakeModules/CMakeTestASM-LLVMWARCompiler.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# These trio of files implement a workaround for LLVM bug 39427

set(ASM_DIALECT "-LLVMWAR")
include(CMakeTestASMCompiler)
set(ASM_DIALECT)
212 changes: 0 additions & 212 deletions CMakeModules/wasm.cmake

This file was deleted.

6 changes: 3 additions & 3 deletions Docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM boscore/builder:v2.0.4 as builder
ARG branch=master
ARG symbol=SYS
ARG symbol=EOS

ENV OPENSSL_ROOT_DIR /usr/include/openssl

Expand All @@ -13,7 +13,7 @@ RUN git clone -b $branch https://github.com/boscore/bos.git --recursive \

FROM ubuntu:18.04

RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get -y install openssl ca-certificates && rm -rf /var/lib/apt/lists/*
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get -y install openssl ca-certificates iproute2 && rm -rf /var/lib/apt/lists/*
COPY --from=builder /usr/local/lib/* /usr/local/lib/
COPY --from=builder /tmp/build/bin /opt/eosio/bin
COPY --from=builder /bos/Docker/config.ini /
Expand All @@ -22,4 +22,4 @@ COPY --from=builder /bos/Docker/nodeosd.sh /opt/eosio/bin/nodeosd.sh
ENV EOSIO_ROOT=/opt/eosio
RUN chmod +x /opt/eosio/bin/nodeosd.sh
ENV LD_LIBRARY_PATH /usr/local/lib
ENV PATH /opt/eosio/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
ENV PATH /opt/eosio/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
12 changes: 6 additions & 6 deletions Docker/builder/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ RUN echo "deb http://apt.llvm.org/bionic/ llvm-toolchain-bionic main" >> /etc/ap
&& apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y git-core automake autoconf libtool build-essential pkg-config libtool \
mpi-default-dev libicu-dev python-dev python3-dev libbz2-dev zlib1g-dev libssl-dev libgmp-dev \
clang-4.0 lldb-4.0 lld-4.0 llvm-4.0-dev libclang-4.0-dev ninja-build libusb-1.0-0-dev curl libcurl4-gnutls-dev \
clang-7 lld-4.0 llvm-7-dev libclang-4.0-dev ninja-build libusb-1.0-0-dev curl libcurl4-gnutls-dev \
&& rm -rf /var/lib/apt/lists/*

RUN update-alternatives --install /usr/bin/clang clang /usr/lib/llvm-4.0/bin/clang 400 \
&& update-alternatives --install /usr/bin/clang++ clang++ /usr/lib/llvm-4.0/bin/clang++ 400
RUN update-alternatives --install /usr/bin/clang clang /usr/lib/llvm-7/bin/clang 700 \
&& update-alternatives --install /usr/bin/clang++ clang++ /usr/lib/llvm-7/bin/clang++ 700

RUN wget https://cmake.org/files/v3.9/cmake-3.9.6-Linux-x86_64.sh \
&& bash cmake-3.9.6-Linux-x86_64.sh --prefix=/usr/local --exclude-subdir --skip-license \
Expand All @@ -29,7 +29,7 @@ ENV CXX clang++
RUN wget https://dl.bintray.com/boostorg/release/1.71.0/source/boost_1_71_0.tar.bz2 -O - | tar -xj \
&& cd boost_1_71_0 \
&& ./bootstrap.sh --prefix=/usr/local \
&& echo 'using clang : 4.0 : clang++-4.0 ;' >> project-config.jam \
&& echo 'using clang : 7 : clang++-7 ;' >> project-config.jam \
&& ./b2 -d0 -j$(nproc) --with-thread --with-date_time --with-system --with-filesystem --with-program_options \
--with-serialization --with-chrono --with-test --with-context --with-locale --with-coroutine --with-iostreams toolset=clang link=static install \
&& cd .. && rm -rf boost_1_71_0
Expand All @@ -43,8 +43,8 @@ RUN wget https://github.com/mongodb/mongo-c-driver/releases/download/1.10.2/mong
&& make install \
&& cd ../../ && rm -rf mongo-c-driver-1.10.2

RUN git clone --depth 1 --single-branch --branch release_40 https://github.com/llvm-mirror/llvm.git \
&& git clone --depth 1 --single-branch --branch release_40 https://github.com/llvm-mirror/clang.git llvm/tools/clang \
RUN git clone --depth 1 --single-branch --branch release_70 https://github.com/llvm-mirror/llvm.git \
&& git clone --depth 1 --single-branch --branch release_70 https://github.com/llvm-mirror/clang.git llvm/tools/clang \
&& cd llvm \
&& cmake -H. -Bbuild -GNinja -DCMAKE_INSTALL_PREFIX=/opt/wasm -DLLVM_TARGETS_TO_BUILD= -DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD=WebAssembly -DCMAKE_BUILD_TYPE=Release \
&& cmake --build build --target install \
Expand Down
Loading

0 comments on commit 5df6936

Please sign in to comment.