diff --git a/.github/actions/build-asset-unix.sh b/.github/actions/build-asset-unix.sh index 2ff28d7c..d8c7c844 100755 --- a/.github/actions/build-asset-unix.sh +++ b/.github/actions/build-asset-unix.sh @@ -6,6 +6,7 @@ # - BB_VERSION # set -eo pipefail +set -vx thread_count=2 @@ -33,8 +34,19 @@ if [[ "$bb_version" != "$BB_VERSION" ]]; then exit 1 fi +tar --version +ls -la bladebit +python3 -c 'f = open("bladebit", "rb"); contents = f.read(); print("zero count:", contents.count(b"\x00"))' tar -czvf $BB_ARTIFACT_NAME bladebit +ls -la $BB_ARTIFACT_NAME mkdir ../bin +cp bladebit ../bin/ +mkdir tmp1 +cd tmp1 +tar -xvf ../$BB_ARTIFACT_NAME +python3 -c 'f = open("bladebit", "rb"); contents = f.read(); print("zero count:", contents.count(b"\x00"))' +cp bladebit ../../bin/bladebit.tarred-untarred +diff bladebit ../../bin/bladebit +cd .. mv $BB_ARTIFACT_NAME ../bin/ -ls -la ../bin - +ls -la ../bin/ diff --git a/.github/workflows/build-release.yml b/.github/workflows/build-release.yml index db4d6908..edb755e4 100644 --- a/.github/workflows/build-release.yml +++ b/.github/workflows/build-release.yml @@ -4,206 +4,18 @@ on: branches: ['*'] workflow_dispatch: -jobs: - build-ubuntu-x86-64: - runs-on: ubuntu-20.04 - steps: - - name: Checkout Repo - uses: actions/checkout@v3 - - - name: Get Version Number - id: version_number - run: .github/actions/get-version.sh ubuntu x86-64 - - - name: Install Prerequisites - run: sudo apt install -y libgmp-dev libnuma-dev - - - name: Build - env: - BB_ARTIFACT_NAME: ${{ steps.version_number.outputs.BB_ARTIFACT_NAME }} - BB_VERSION: ${{steps.version_number.outputs.BB_VERSION}} - run: .github/actions/build-asset-unix.sh - - - name: Upload Artifact Ubuntu x86-64 - uses: actions/upload-artifact@v2 - with: - name: ${{ steps.version_number.outputs.BB_ARTIFACT_NAME }} - path: ${{ github.workspace }}/bin/${{ steps.version_number.outputs.BB_ARTIFACT_NAME }} - if-no-files-found: error - - build-centos-x86-64: - runs-on: ubuntu-20.04 - container: - image: quay.io/centos/centos:stream8 - steps: - - name: Checkout Repo - uses: actions/checkout@v3 - - - name: Get Version Number - id: version_number - run: .github/actions/get-version.sh centos x86-64 - - - name: Install Prerequisites - run: | - dnf install -y gcc-toolset-9-gcc gcc-toolset-9-gcc-c++ \ - cmake gmp-devel numactl-devel make git - - - name: Build - env: - BB_ARTIFACT_NAME: ${{ steps.version_number.outputs.BB_ARTIFACT_NAME }} - BB_VERSION: ${{steps.version_number.outputs.BB_VERSION}} - run: | - source /opt/rh/gcc-toolset-9/enable - .github/actions/build-asset-unix.sh - - - name: Upload Artifact CentOS x86-64 - uses: actions/upload-artifact@v2 - with: - name: ${{ steps.version_number.outputs.BB_ARTIFACT_NAME }} - path: ${{ github.workspace }}/bin/${{ steps.version_number.outputs.BB_ARTIFACT_NAME }} - if-no-files-found: error - - build-ubuntu-arm64: - runs-on: [ARM64, Linux] - container: - image: chianetwork/ubuntu-20.04-builder:latest - defaults: - run: - shell: bash - steps: - - name: Checkout Repo - uses: actions/checkout@v3 - - - name: Get Version Number - id: version_number - run: .github/actions/get-version.sh ubuntu arm64 - - - name: Install Prerequisites - run: | - export DEBIAN_FRONTEND=noninteractive - apt update - apt install -y build-essential git libgmp-dev libnuma-dev - - - name: Build - env: - BB_ARTIFACT_NAME: ${{ steps.version_number.outputs.BB_ARTIFACT_NAME }} - BB_VERSION: ${{steps.version_number.outputs.BB_VERSION}} - run: .github/actions/build-asset-unix.sh - - - name: Upload Artifact Ubuntu ARM64 - uses: actions/upload-artifact@v2 - with: - name: ${{ steps.version_number.outputs.BB_ARTIFACT_NAME }} - path: ${{ github.workspace }}/bin/${{ steps.version_number.outputs.BB_ARTIFACT_NAME }} - if-no-files-found: error - - build-centos-arm64: - runs-on: [ARM64, Linux] - container: - image: quay.io/centos/centos:stream8 - steps: - - name: Checkout Repo - uses: actions/checkout@v3 - - - name: Get Version Number - id: version_number - run: .github/actions/get-version.sh centos arm64 - - - name: Install Prerequisites - run: | - dnf install -y gcc-toolset-9-gcc gcc-toolset-9-gcc-c++ \ - cmake gmp-devel numactl-devel make git - - - name: Build - env: - BB_ARTIFACT_NAME: ${{ steps.version_number.outputs.BB_ARTIFACT_NAME }} - BB_VERSION: ${{steps.version_number.outputs.BB_VERSION}} - run: | - source /opt/rh/gcc-toolset-9/enable - .github/actions/build-asset-unix.sh - - - name: Upload Artifact CentOS ARM64 - uses: actions/upload-artifact@v2 - with: - name: ${{ steps.version_number.outputs.BB_ARTIFACT_NAME }} - path: ${{ github.workspace }}/bin/${{ steps.version_number.outputs.BB_ARTIFACT_NAME }} - if-no-files-found: error - - build-windows-x86-64: - runs-on: windows-2019 - steps: - - name: Checkout Repo - uses: actions/checkout@v3 - - - name: Get Version Number - shell: bash - id: version_number - run: .github/actions/get-version.sh windows x86-64 - - - name: Build - shell: bash - env: - BB_ARTIFACT_NAME: ${{ steps.version_number.outputs.BB_ARTIFACT_NAME }} - BB_VERSION: ${{steps.version_number.outputs.BB_VERSION}} - run: | - - mkdir build && cd build - cmake .. - bash -e -o pipefail ../embed-version.sh - cat ../src/Version.h - cmake --build . --target bladebit --config Release - - # Ensure bladebit version matches expected version - bb_version="$(./Release/bladebit.exe --version | xargs)" - - if [[ "$bb_version" != "$BB_VERSION" ]]; then - >&2 echo "Incorrect bladebit version. Got but '$bb_version' expected '$BB_VERSION'." - exit 1 - fi - - mkdir ../bin - cd Release - 7z.exe a -tzip ../../bin/${BB_ARTIFACT_NAME} bladebit.exe - ls -la ../../bin - - - name: Upload Artifact Windows x86-64 - uses: actions/upload-artifact@v2 - with: - name: ${{ steps.version_number.outputs.BB_ARTIFACT_NAME }} - path: ${{ github.workspace }}/bin/${{ steps.version_number.outputs.BB_ARTIFACT_NAME }} - if-no-files-found: error - - build-macos-arm64: - runs-on: [macOS, ARM64] - steps: - - name: Cleanup Environment - uses: Chia-Network/actions/clean-workspace@main - - - name: Checkout Repo - uses: actions/checkout@v3 - - - name: Get Version Number - id: version_number - run: bash -e .github/actions/get-version.sh macos arm64 - - - name: Install Prerequisites - run: brew install cmake - - - name: Build - env: - BB_ARTIFACT_NAME: ${{ steps.version_number.outputs.BB_ARTIFACT_NAME }} - BB_VERSION: ${{steps.version_number.outputs.BB_VERSION}} - run: .github/actions/build-asset-unix.sh - - - name: Upload Artifact macOS arm64 - uses: actions/upload-artifact@v2 - with: - name: ${{ steps.version_number.outputs.BB_ARTIFACT_NAME }} - path: ${{ github.workspace }}/bin/${{ steps.version_number.outputs.BB_ARTIFACT_NAME }} - if-no-files-found: error +env: + CMAKE_BUILD_PARALLEL_LEVEL: 1 +jobs: build-macos-x86-64: - runs-on: macOS-latest + name: tar - ${{ matrix.runs-on }} - ${{ matrix.n }} + runs-on: ${{ matrix.runs-on }} + strategy: + fail-fast: false + matrix: + runs-on: [macos-11, macos-12, macos-latest] + n: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80] steps: - name: Cleanup Environment uses: Chia-Network/actions/clean-workspace@main @@ -225,8 +37,9 @@ jobs: run: .github/actions/build-asset-unix.sh - name: Upload Artifact macOS x86-64 + if: always() uses: actions/upload-artifact@v2 with: - name: ${{ steps.version_number.outputs.BB_ARTIFACT_NAME }} - path: ${{ github.workspace }}/bin/${{ steps.version_number.outputs.BB_ARTIFACT_NAME }} + name: ${{ matrix.runs-on }}-${{ matrix.n }}-${{ steps.version_number.outputs.BB_ARTIFACT_NAME }} + path: ${{ github.workspace }}/bin/ if-no-files-found: error diff --git a/CMakeLists.txt b/CMakeLists.txt index a8022376..6704f3cf 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,8 @@ cmake_minimum_required(VERSION 3.20 FATAL_ERROR) +set(CMAKE_VERBOSE_MAKEFILE ON) +set(CMAKE_FIND_DEBUG_MODE ON) + set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD_REQUIRED ON)