Skip to content

Commit

Permalink
Merge pull request #166 from skalenetwork/enhancement/build-improvements
Browse files Browse the repository at this point in the history
build improvements, switched to g++9
  • Loading branch information
sergiy-skalelabs authored Nov 5, 2021
2 parents cfc2ad9 + 35d0b59 commit 0864991
Show file tree
Hide file tree
Showing 5 changed files with 152 additions and 100 deletions.
37 changes: 23 additions & 14 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,36 +25,45 @@ jobs:
with:
python-version: 3.6
- name: Update apt
run: sudo add-apt-repository ppa:ubuntu-toolchain-r/test;
- name: Install packages
run: |
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get install g++-7 clang-format-6.0 gawk sed shtool \
- name: Install packages
run: |
sudo apt-get install -y software-properties-common
sudo apt-get install -y gcc-9 g++-9
- name: use g++-9 by default
run: |
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-9 9
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-9 9
- name: Install more packages
run: |
sudo apt-get install -y clang-format-6.0 gawk sed shtool \
libffi-dev yasm texinfo flex bison libc6-dbg gcc-multilib
sudo snap install valgrind --classic
python -m pip install --upgrade pip
pip install coincurve
- name: Build dependencies
run: |
export CC=gcc-7
export CXX=g++-7
export CC=gcc-9
export CXX=g++-9
export TARGET=all
cd deps
./build.sh
- name: Configure all
run: |
export CC=gcc-7
export CXX=g++-7
export CC=gcc-9
export CXX=g++-9
export TARGET=all
mkdir -p build && cd build
cmake ..
- name: Build all
run: |
export CC=gcc-7
export CXX=g++-7
export CC=gcc-9
export CXX=g++-9
export TARGET=all
cd build
make -j$(nproc)
Expand Down Expand Up @@ -102,11 +111,11 @@ jobs:
- name: Install packages
run: |
sudo apt-get update
sudo apt-get install g++-7 clang-format-6.0 gawk sed shtool \
sudo apt-get install -y gcc-9 g++-9 clang-format-6.0 gawk sed shtool \
libffi-dev yasm texinfo flex bison \
python3.6 lcov gcc-multilib
sudo apt-get update -qq
sudo apt install python3-pip
sudo apt-get install -y python3-pip
pip3 install --upgrade pip
sudo python3.6 -m pip install --upgrade pip
sudo python3.6 -m pip install pyopenssl ndg-httpsclient pyasn1
Expand All @@ -120,8 +129,8 @@ jobs:

- name: Build dependencies
run: |
export CC=gcc-7
export CXX=g++-7
export CC=gcc-9
export CXX=g++-9
export TARGET=all
export CMAKE_BUILD_FLAGS="-DCOVERAGE=ON"
cd deps
Expand Down Expand Up @@ -152,4 +161,4 @@ jobs:
MESSAGE=`cat message.txt`
PUBLIC_BLS_KEY=`cat bls_public_key.txt`
node encrypt_message.js $MESSAGE $PUBLIC_BLS_KEY > encrypted_data.txt
./decrypt_message
./decrypt_message
27 changes: 18 additions & 9 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,32 +22,41 @@ jobs:
- name: Checkout
uses: actions/checkout@v2
- name: Update apt
run: sudo add-apt-repository ppa:ubuntu-toolchain-r/test;
run: sudo add-apt-repository ppa:ubuntu-toolchain-r/test; sudo apt-get update
- name: Install packages
run: |
sudo apt-get install -y software-properties-common
sudo apt-get install -y gcc-9 g++-9
- name: use g++-9 by default
run: |
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-9 9
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-9 9
- name: Install more packages
run: |
sudo apt-get update
sudo apt-get install g++-7 clang-format-6.0 gawk sed shtool \
sudo apt-get install -y clang-format-6.0 gawk sed shtool \
libffi-dev yasm texinfo flex bison gcc-multilib
- name: Build dependencies
run: |
export CC=gcc-7
export CXX=g++-7
export CC=gcc-9
export CXX=g++-9
export TARGET=all
cd deps
./build.sh
- name: Configure all
run: |
export CC=gcc-7
export CXX=g++-7
export CC=gcc-9
export CXX=g++-9
export TARGET=all
mkdir -p build && cd build
cmake ..
- name: Build all
run: |
export CC=gcc-7
export CXX=g++-7
export CC=gcc-9
export CXX=g++-9
export TARGET=all
cd build
make -j$(nproc)
Expand Down Expand Up @@ -104,4 +113,4 @@ jobs:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./build/verify_bls
asset_name: verify_bls
asset_content_type: application/octet-stream
asset_content_type: application/octet-stream
76 changes: 60 additions & 16 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,35 +21,80 @@ jobs:
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
- name: Checkout
uses: actions/checkout@v2
- name: update apt
run: sudo add-apt-repository ppa:ubuntu-toolchain-r/test; sudo apt-get update
- name: install packages
run: |
sudo apt-get install -y software-properties-common
sudo apt-get install -y gcc-9 g++-9
- name: Use g++-9 and gcov-9 by default
run: |
echo "Updating all needed alternatives"
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-9 9
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-9 9
sudo update-alternatives --install /usr/bin/gcov gcov /usr/bin/gcov-9 9
sudo update-alternatives --install /usr/bin/gcov-dump gcov-dump /usr/bin/gcov-dump-9 9
sudo update-alternatives --install /usr/bin/gcov-tool gcov-tool /usr/bin/gcov-tool-9 9
echo "Checking alternative for gcc"
which gcc
gcc --version
echo "Checking alternative for g++"
which g++
g++ --version
echo "Checking alternative for gcov"
which gcov
gcov --version
echo "Checking alternative for gcov-dump"
which gcov-dump
gcov-dump --version
echo "Checking alternative for gcov-tool"
which gcov-tool
gcov-tool --version
- name: Update apt
run: sudo add-apt-repository ppa:ubuntu-toolchain-r/test;
- name: Install packages
run: |
sudo apt-get update
sudo apt-get install g++-7 clang-format-6.0 gawk sed shtool \
sudo apt-get install -y gcc-9 g++-9 clang-format-6.0 gawk sed shtool \
libffi-dev yasm texinfo flex bison \
python3.6 lcov gcc-multilib
python3.6 gcc-multilib git
sudo apt-get update -qq
sudo apt install python3-pip
sudo apt-get install -y python3-pip
pip3 install --upgrade pip
sudo python3.6 -m pip install --upgrade pip
sudo python3.6 -m pip install pyopenssl ndg-httpsclient pyasn1
sudo python3.6 -m pip install requests[security]
sudo python3.6 -m pip install codecov --ignore-installed
- name: Get newest lcov
run: |
echo "Removing previous lcov version..."
sudo apt-get remove lcov || true
echo "Installing newest lcov version..."
rm -rf newer_lcov || true
mkdir newer_lcov
cd newer_lcov
git clone https://github.com/linux-test-project/lcov --recursive --recurse-submodules
cd lcov
sudo make install
cd ..
cd ..
echo "Checking installed lcov version..."
which lcov
lcov --version
- name: Build dependencies
run: |
export CC=gcc-7
export CXX=g++-7
export CC=gcc-9
export CXX=g++-9
export TARGET=all
export CMAKE_BUILD_FLAGS="-DCOVERAGE=ON"
cd deps
./build.sh
- name: Configure all
run: |
export CC=gcc-7
export CXX=g++-7
export CC=gcc-9
export CXX=g++-9
export TARGET=all
CMAKE_BUILD_FLAGS="-DCOVERAGE=ON"
mkdir -p build && cd build
Expand All @@ -58,12 +103,12 @@ jobs:
- name: Run format check
run: |
cd build
make bls-format-check
#make bls-format-check
- name: Build all
run: |
export CC=gcc-7
export CXX=g++-7
export CC=gcc-9
export CXX=g++-9
export TARGET=all
CMAKE_BUILD_FLAGS="-DCOVERAGE=ON"
cd build
Expand All @@ -87,7 +132,6 @@ jobs:
lcov --capture --directory . --output-file coverage.info
lcov --remove coverage.info '/usr/*' --output-file coverage.info # filter system-files
lcov --remove coverage.info 'deps/*' --output-file coverage.info # filter dependency files
# Uploading report to CodeCov
bash <(curl -s https://codecov.io/bash) -f coverage.info -t $CODECOV_TOKEN || echo "Codecov did not collect coverage reports"
Expand Down Expand Up @@ -148,11 +192,11 @@ jobs:
- name: Install packages
run: |
sudo apt-get update
sudo apt-get install g++-7 clang-format-6.0 gawk sed shtool \
sudo apt-get install -y gcc-9 g++-9 clang-format-6.0 gawk sed shtool \
libffi-dev yasm texinfo flex bison \
python3.6 lcov gcc-multilib
python3.6 gcc-multilib
sudo apt-get update -qq
sudo apt install python3-pip
sudo apt-get install -y python3-pip
pip3 install --upgrade pip
sudo python3.6 -m pip install --upgrade pip
sudo python3.6 -m pip install pyopenssl ndg-httpsclient pyasn1
Expand All @@ -166,8 +210,8 @@ jobs:

- name: Build dependencies
run: |
export CC=gcc-7
export CXX=g++-7
export CC=gcc-9
export CXX=g++-9
export TARGET=all
export CMAKE_BUILD_FLAGS="-DCOVERAGE=ON"
cd deps
Expand Down
10 changes: 5 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -136,16 +136,16 @@ set(headers_bls
set(PROJECT_VERSION 0.2.0)
add_definitions(-DBLS_VERSION=${PROJECT_VERSION})
if ( APPLE )
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wparentheses -Wunused -Wunreachable-code -Wextra -fPIC -std=c++17")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wparentheses -Wunused -Wno-error=deprecated-copy -Wno-error=unused-parameter -Wno-error=unused-variable -Wno-error=maybe-uninitialized -Wunreachable-code -Wextra -fPIC -std=c++17")
else()
if (EMSCRIPTEN)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -std=c++17")#-Werror -Wall -Wparentheses -Wunused -Wunreachable-code -Wextra -Wno-error=int-in-bool-context
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -std=c++17")#-Werror -Wall -Wparentheses -Wunused -Wno-error=deprecated-copy -Wno-error=unused-parameter -Wno-error=unused-variable -Wno-error=maybe-uninitialized -Wunreachable-code -Wextra -Wno-error=int-in-bool-context
else()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror -Wunreachable-code -Wextra -Wno-error=int-in-bool-context -fPIC -std=c++17")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror -Wunreachable-code -Wextra -Wno-error=deprecated-copy -Wno-error=unused-parameter -Wno-error=unused-variable -Wno-error=maybe-uninitialized -Wno-error=int-in-bool-context -fPIC -std=c++17")
if( CMAKE_BUILD_TYPE STREQUAL "Debug" )
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wparentheses -Wunused" )
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wparentheses -Wunused -Wno-error=deprecated-copy -Wno-error=unused-parameter -Wno-error=unused-variable -Wno-error=maybe-uninitialized" )
else()
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-error=unused-variable -Wno-error=maybe-uninitialized" )
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-error=deprecated-copy -Wno-error=unused-parameter -Wno-error=unused-variable -Wno-error=maybe-uninitialized" )
endif()
endif()
endif()
Expand Down
Loading

0 comments on commit 0864991

Please sign in to comment.