Skip to content

Commit

Permalink
Merge branch 'main' into ph-manual-workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
oschwaldp-oci committed Jul 28, 2023
2 parents 78b16c5 + 4fd572c commit b30be9c
Show file tree
Hide file tree
Showing 42 changed files with 859 additions and 428 deletions.
3 changes: 2 additions & 1 deletion .cicd/platforms/ubuntu20.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@ RUN apt-get update && apt-get upgrade -y && \
cmake \
git \
jq \
libboost-all-dev \
libcurl4-openssl-dev \
libgmp-dev \
libssl-dev \
llvm-11-dev \
ninja-build \
python3-numpy \
file \
zlib1g-dev \
zstd
3 changes: 2 additions & 1 deletion .cicd/platforms/ubuntu22.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@ RUN apt-get update && apt-get upgrade -y && \
cmake \
git \
jq \
libboost-all-dev \
libcurl4-openssl-dev \
libgmp-dev \
libssl-dev \
llvm-11-dev \
ninja-build \
python3-numpy \
file \
zlib1g-dev \
zstd
22 changes: 13 additions & 9 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ jobs:
steps:
- uses: actions/checkout@v3
with:
submodules: true
submodules: recursive
- name: Download builddir
uses: actions/download-artifact@v3
with:
Expand All @@ -104,8 +104,8 @@ jobs:
cpack
- name: Install dev package
run: |
apt update && apt upgrade -y
apt install -y ./build/leap_*.deb ./build/leap-dev*.deb
apt-get update && apt-get upgrade -y
apt-get install -y ./build/leap_*.deb ./build/leap-dev*.deb
- name: Test using TestHarness
run: |
python3 -c "from TestHarness import Cluster"
Expand Down Expand Up @@ -212,7 +212,15 @@ jobs:
test: [build-tree, make-dev-install, deb-install]
runs-on: ["self-hosted", "enf-x86-midtier"]
container: ${{ matrix.test != 'deb-install' && fromJSON(needs.platforms.outputs.p)[matrix.platform].image || matrix.platform == 'ubuntu20' && 'ubuntu:focal' || 'ubuntu:jammy' }}
env:
DEBIAN_FRONTEND: noninteractive
TZ: Etc/UTC
steps:
- name: Update Package Index & Upgrade Packages
run: |
apt-get update
apt-get upgrade -y
# LEAP
- if: ${{ matrix.test != 'deb-install' }}
name: Clone leap
Expand Down Expand Up @@ -249,26 +257,22 @@ jobs:
- if: ${{ matrix.test == 'deb-install' }}
name: Install leap-dev Package
run: |
apt-get update
export DEBIAN_FRONTEND='noninteractive'
export TZ='Etc/UTC'
apt-get install -y ./*.deb
rm ./*.deb
# CDT
- name: Download cdt
uses: AntelopeIO/asset-artifact-download-action@v2
uses: AntelopeIO/asset-artifact-download-action@v3
with:
owner: AntelopeIO
repo: cdt
file: 'cdt_.*amd64.deb'
target: '${{needs.v.outputs.cdt-target}}'
prereleases: ${{fromJSON(needs.v.outputs.cdt-prerelease)}}
artifact-name: cdt_ubuntu_package_amd64
token: ${{github.token}}
- name: Install cdt Packages
run: |
apt install -y ./*.deb
apt-get install -y ./*.deb
rm ./*.deb
# Reference Contracts
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build_base.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
run: |
# https://github.com/actions/runner/issues/2033
chown -R $(id -u):$(id -g) $PWD
cmake -B build -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr -GNinja
cmake -B build -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr -DENABLE_LEAP_DEV_DEB=On -GNinja
cmake --build build
tar -pc --exclude "*.o" build | zstd --long -T0 -9 > build.tar.zst
- name: Upload builddir
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/ph_backward_compatibility.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,12 @@ jobs:
run: |
zstdcat build.tar.zst | tar x
- name: Download Prev Leap Version
uses: AntelopeIO/asset-artifact-download-action@v2
uses: AntelopeIO/asset-artifact-download-action@v3
with:
owner: AntelopeIO
repo: leap
file: '(leap).*${{matrix.platform}}.04.*(x86_64|amd64).deb'
target: '${{matrix.release}}'
token: ${{github.token}}
- name: Install leap & replace binaries for PH use
run: |
apt-get update
Expand Down
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,6 @@
[submodule "libraries/cli11/cli11"]
path = libraries/cli11/cli11
url = https://github.com/AntelopeIO/CLI11.git
[submodule "libraries/boost"]
path = libraries/boost
url = https://github.com/boostorg/boost.git
20 changes: 14 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -101,12 +101,6 @@ else()
set(no_whole_archive_flag "--no-whole-archive")
endif()

set(Boost_USE_MULTITHREADED ON)
set( Boost_USE_STATIC_LIBS ON CACHE STRING "ON or OFF" )
# Most boost deps get implictly picked up via fc, as just about everything links to fc. In addition we pick up
# the pthread dependency through fc.
find_package(Boost 1.71 REQUIRED COMPONENTS program_options unit_test_framework system)

if( APPLE AND UNIX )
# Apple Specific Options Here
message( STATUS "Configuring Leap on macOS" )
Expand Down Expand Up @@ -278,6 +272,18 @@ configure_file(${CMAKE_SOURCE_DIR}/libraries/cli11/bash-completion/completions/c
install(FILES libraries/cli11/bash-completion/completions/leap-util DESTINATION ${CMAKE_INSTALL_FULL_DATAROOTDIR}/bash-completion/completions COMPONENT base)
install(FILES libraries/cli11/bash-completion/completions/cleos DESTINATION ${CMAKE_INSTALL_FULL_DATAROOTDIR}/bash-completion/completions COMPONENT base)

# Add the boost submodule we used to build to our install package, so headers can be found for libtester
install(DIRECTORY "${CMAKE_SOURCE_DIR}/libraries/boost/"
DESTINATION ${CMAKE_INSTALL_FULL_DATAROOTDIR}/leap_boost
COMPONENT dev EXCLUDE_FROM_ALL
PATTERN ".git/*" EXCLUDE
PATTERN "example/*" EXCLUDE
PATTERN "bench/*" EXCLUDE
PATTERN "doc/*" EXCLUDE
PATTERN "libs/*/test" EXCLUDE
PATTERN "tools/*/test" EXCLUDE
)

add_custom_target(dev-install
COMMAND "${CMAKE_COMMAND}" --build "${CMAKE_BINARY_DIR}"
COMMAND "${CMAKE_COMMAND}" --install "${CMAKE_BINARY_DIR}"
Expand All @@ -287,5 +293,7 @@ add_custom_target(dev-install

include(doxygen)

option(ENABLE_LEAP_DEV_DEB "Enable building the leap-dev .deb package" OFF)

include(package.cmake)
include(CPack)
27 changes: 14 additions & 13 deletions CMakeModules/EosioTester.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,10 @@ else ( APPLE )
set( CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS} ${CMAKE_CXX_FLAGS} -Wall")
endif ( APPLE )

set( Boost_USE_MULTITHREADED ON )
set( Boost_USE_STATIC_LIBS ON CACHE STRING "ON or OFF" )
find_package(Boost @Boost_MAJOR_VERSION@.@Boost_MINOR_VERSION@ EXACT REQUIRED COMPONENTS
date_time
filesystem
system
chrono
iostreams
unit_test_framework)

add_subdirectory( @CMAKE_INSTALL_FULL_DATAROOTDIR@/leap_boost ${PROJECT_BINARY_DIR}/libraries/boost EXCLUDE_FROM_ALL)

find_library(libtester eosio_testing @CMAKE_INSTALL_FULL_LIBDIR@ NO_DEFAULT_PATH)
find_library(libchain eosio_chain @CMAKE_INSTALL_FULL_LIBDIR@ NO_DEFAULT_PATH)
Expand Down Expand Up @@ -88,12 +84,18 @@ macro(add_eosio_test_executable test_name)
${libbn256}
@GMP_LIBRARY@

${Boost_FILESYSTEM_LIBRARY}
${Boost_SYSTEM_LIBRARY}
${Boost_CHRONO_LIBRARY}
${Boost_IOSTREAMS_LIBRARY}
Boost::date_time
Boost::filesystem
Boost::system
Boost::chrono
Boost::multi_index
Boost::multiprecision
Boost::interprocess
Boost::asio
Boost::signals2
Boost::iostreams
"-lz" # Needed by Boost iostreams
${Boost_DATE_TIME_LIBRARY}
Boost::unit_test_framework

${LLVM_LIBS}

Expand All @@ -109,7 +111,6 @@ macro(add_eosio_test_executable test_name)
endif()

target_include_directories( ${test_name} PUBLIC
${Boost_INCLUDE_DIRS}
@OPENSSL_INCLUDE_DIR@
@CMAKE_INSTALL_PREFIX@
@CMAKE_INSTALL_FULL_INCLUDEDIR@
Expand Down
27 changes: 14 additions & 13 deletions CMakeModules/EosioTesterBuild.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,10 @@ else ( APPLE )
set( CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS} ${CMAKE_CXX_FLAGS} -Wall")
endif ( APPLE )

set( Boost_USE_MULTITHREADED ON )
set( Boost_USE_STATIC_LIBS ON CACHE STRING "ON or OFF" )
find_package(Boost @Boost_MAJOR_VERSION@.@Boost_MINOR_VERSION@ EXACT REQUIRED COMPONENTS
date_time
filesystem
system
chrono
iostreams
unit_test_framework)

add_subdirectory( @CMAKE_SOURCE_DIR@/libraries/boost ${PROJECT_BINARY_DIR}/libraries/boost EXCLUDE_FROM_ALL)

find_library(libtester eosio_testing @CMAKE_BINARY_DIR@/libraries/testing NO_DEFAULT_PATH)
find_library(libchain eosio_chain @CMAKE_BINARY_DIR@/libraries/chain NO_DEFAULT_PATH)
Expand Down Expand Up @@ -85,12 +81,18 @@ macro(add_eosio_test_executable test_name)
${libbn256}
@GMP_LIBRARY@

${Boost_FILESYSTEM_LIBRARY}
${Boost_SYSTEM_LIBRARY}
${Boost_CHRONO_LIBRARY}
${Boost_IOSTREAMS_LIBRARY}
Boost::date_time
Boost::filesystem
Boost::system
Boost::chrono
Boost::multi_index
Boost::multiprecision
Boost::interprocess
Boost::asio
Boost::signals2
Boost::iostreams
"-lz" # Needed by Boost iostreams
${Boost_DATE_TIME_LIBRARY}
Boost::unit_test_framework

${LLVM_LIBS}

Expand All @@ -106,7 +108,6 @@ macro(add_eosio_test_executable test_name)
endif()

target_include_directories( ${test_name} PUBLIC
${Boost_INCLUDE_DIRS}
@OPENSSL_INCLUDE_DIR@
@CMAKE_SOURCE_DIR@/libraries/chain/include
@CMAKE_BINARY_DIR@/libraries/chain/include
Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,12 +132,13 @@ sudo apt-get install -y \
build-essential \
cmake \
git \
libboost-all-dev \
libcurl4-openssl-dev \
libgmp-dev \
libssl-dev \
llvm-11-dev \
python3-numpy
python3-numpy \
file \
zlib1g-dev
```
To build, make sure you are in the root of the `leap` repo, then run the following command:
```bash
Expand Down
4 changes: 4 additions & 0 deletions libraries/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ set(SOFTFLOAT_INSTALL_COMPONENT "dev")
set(EOSVM_INSTALL_COMPONENT "dev")
set(BN256_INSTALL_COMPONENT "dev")

set( Boost_USE_MULTITHREADED ON )
set( Boost_USE_STATIC_LIBS ON CACHE STRING "ON or OFF" )
add_subdirectory( boost EXCLUDE_FROM_ALL )

add_subdirectory( libfc )
add_subdirectory( builtins )
add_subdirectory( softfloat )
Expand Down
2 changes: 1 addition & 1 deletion libraries/appbase
Submodule appbase updated 1 files
+8 −1 CMakeLists.txt
1 change: 1 addition & 0 deletions libraries/boost
Submodule boost added at b6928a
14 changes: 14 additions & 0 deletions libraries/chain/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,16 @@ if("eos-vm-oc" IN_LIST EOSIO_WASM_RUNTIMES)
webassembly/runtimes/eos-vm-oc.cpp
webassembly/runtimes/eos-vm-oc/default_real_main.cpp)

set_source_files_properties(webassembly/runtimes/eos-vm-oc/LLVMJIT.cpp PROPERTIES COMPILE_FLAGS "--std=gnu++17")
set_source_files_properties(webassembly/runtimes/eos-vm-oc/LLVMEmitIR.cpp PROPERTIES COMPILE_FLAGS "--std=gnu++17")

if(LLVM_VERSION VERSION_LESS 7.1 AND CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
enable_language(ASM-LLVMWAR)
list(APPEND CHAIN_EOSVMOC_SOURCES webassembly/runtimes/eos-vm-oc/llvmWARshim.llvmwar)
set_source_files_properties(webassembly/runtimes/eos-vm-oc/llvmWARshim.llvmwar PROPERTIES COMPILE_FLAGS "--std=gnu++17")
else()
list(APPEND CHAIN_EOSVMOC_SOURCES webassembly/runtimes/eos-vm-oc/llvmWARshim.cpp)
set_source_files_properties(webassembly/runtimes/eos-vm-oc/llvmWARshim.cpp PROPERTIES COMPILE_FLAGS "--std=gnu++17")
endif()

llvm_map_components_to_libnames(LLVM_LIBS support core passes mcjit native orcjit)
Expand Down Expand Up @@ -131,8 +136,17 @@ add_library( eosio_chain
${HEADERS}
)

## Boost::accumulators depends on Boost::numeric_ublas, which is still missing cmake support (see
## https://github.com/boostorg/cmake/issues/39). Until this is fixed, manually add Boost::numeric_ublas
## as an interface library
## ----------------------------------------------------------------------------------------------------
add_library(boost_numeric_ublas INTERFACE)
add_library(Boost::numeric_ublas ALIAS boost_numeric_ublas)

target_link_libraries( eosio_chain PUBLIC bn256 fc chainbase eosio_rapidjson Logging IR WAST WASM
softfloat builtins ${CHAIN_EOSVM_LIBRARIES} ${LLVM_LIBS} ${CHAIN_RT_LINKAGE}
Boost::signals2 Boost::hana Boost::property_tree Boost::multi_index Boost::asio Boost::lockfree
Boost::assign Boost::accumulators
)
target_include_directories( eosio_chain
PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/include" "${CMAKE_CURRENT_BINARY_DIR}/include"
Expand Down
18 changes: 18 additions & 0 deletions libraries/chain/webassembly/runtimes/eos-vm-oc/LLVMEmitIR.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#pragma once

#include "Inline/BasicTypes.h"
#include "IR/Module.h"

#include "llvm/IR/Module.h"

#include <vector>
#include <map>

namespace eosio { namespace chain { namespace eosvmoc {

namespace LLVMJIT {
bool getFunctionIndexFromExternalName(const char* externalName,Uptr& outFunctionDefIndex);
const char* getTableSymbolName();
llvm::Module* emitModule(const IR::Module& module);
}
}}}
Loading

0 comments on commit b30be9c

Please sign in to comment.