From f66e2dd1806ecd8c997252ece4b566282bc76c81 Mon Sep 17 00:00:00 2001 From: Gene Hoffman Date: Tue, 20 Jun 2023 17:07:43 -0700 Subject: [PATCH 01/14] Add back nightly testing of blst dependency --- .github/workflows/build-blst-nightly.yml | 91 ++++++++++++++++++++++++ CMakeLists.txt | 6 +- 2 files changed, 96 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/build-blst-nightly.yml diff --git a/.github/workflows/build-blst-nightly.yml b/.github/workflows/build-blst-nightly.yml new file mode 100644 index 000000000..3d872e173 --- /dev/null +++ b/.github/workflows/build-blst-nightly.yml @@ -0,0 +1,91 @@ +name: Build and Test with blst Nightly + +on: + schedule: + - cron: "0 11 * * *" + workflow_dispatch: + +concurrency: + # SHA is added to the end if on `main` to let all main workflows run + group: ${{ github.ref }}-${{ github.workflow }}-${{ github.event_name }}-${{ (github.ref == 'refs/heads/main') && github.sha || '' }} + cancel-in-progress: true + +jobs: + build_wheels: + name: Build and Test with blst Nightly + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [macos-latest, ubuntu-latest, windows-latest] + + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Ubuntu build C++ and test blst at origin/main + if: startsWith(matrix.os, 'ubuntu') + run: | + echo "Relic origin/main commit:" + curl -H "application/vnd.github.v3.sha" \ + https://api.github.com/repos/supranational/blst/commits/main | \ + head -10 + sudo apt-get update + sudo apt-get install snap -y + sudo apt-get remove --purge cmake -y + # sudo snap install cmake --classic + hash -r + cmake --version + export BLST_MAIN=1 + mkdir -p build + cd build + cmake ../ + cmake --build . -- -j 6 + echo "Running ./src/runtest" + ./src/runtest + + - name: Mac OS build C++ and test + if: startsWith(matrix.os, 'macos') + run: | + ls -l + export MACOSX_DEPLOYMENT_TARGET=10.14 + export BLST_MAIN=1 + mkdir -p build + ls -l build + cd build + cmake ../ + cmake --build . -- -j 6 + echo "Running ./src/runtest" + ./src/runtest + + - name: Windows build C++ and test + if: startsWith(matrix.os, 'windows') + run: | + ls -l + export BLST_MAIN=1 + mkdir -p build + ls -l build + cd build + cmake ../ + cmake --build . -- -j 6 + echo "Running ./src/runtest" + ./src/runtest + + - uses: actions/setup-python@v2 + name: Install Python + with: + python-version: '3.8' + + - name: Test pure python implementation + run: | + python python-impl/impl-test.py + + - name: Install emsdk + uses: mymindstorm/setup-emsdk@v11 + + - name: Test javascript bindings + run: | + emcc -v + export RELIC_MAIN=1 + sh emsdk_build.sh + sh js_test.sh \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt index c1553c3e9..602709637 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -49,7 +49,11 @@ set(SODIUM_DISABLE_TESTS "on" CACHE STRING "") set(SODIUM_CHIA_MINIMAL "on" CACHE STRING "") FetchContent_MakeAvailable(Sodium) -set(BLST_GIT_TAG "a8cd361c9f671577aeab3f074098443af92a53fc") +if (DEFINED ENV{BLST_MAIN}) + set(BLST_GIT_TAG "origin/main") +else () + # This is currently anchored to upstream aecdcae7956f542fbee2392c1f0feb0a8ac41dc5 + set(BLST_GIT_TAG "a8cd361c9f671577aeab3f074098443af92a53fc") set(BLST_REPOSITORY "https://github.com/supranational/blst") message(STATUS "blst will be built from: ${BLST_GIT_TAG} and repository ${BLST_REPOSITORY}") From 542ba3fad8a019091e37f0b0e3157aeacf229b3b Mon Sep 17 00:00:00 2001 From: Gene Hoffman Date: Tue, 20 Jun 2023 17:11:45 -0700 Subject: [PATCH 02/14] missing endif () --- CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 602709637..a74b58f2f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -54,6 +54,7 @@ if (DEFINED ENV{BLST_MAIN}) else () # This is currently anchored to upstream aecdcae7956f542fbee2392c1f0feb0a8ac41dc5 set(BLST_GIT_TAG "a8cd361c9f671577aeab3f074098443af92a53fc") +endif () set(BLST_REPOSITORY "https://github.com/supranational/blst") message(STATUS "blst will be built from: ${BLST_GIT_TAG} and repository ${BLST_REPOSITORY}") From d836cfb48f75ec90b6fc304974519579e9c8fbfb Mon Sep 17 00:00:00 2001 From: Gene Hoffman Date: Tue, 20 Jun 2023 17:21:04 -0700 Subject: [PATCH 03/14] temporarily run on all pushes and PRs to test --- .github/workflows/build-blst-nightly.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-blst-nightly.yml b/.github/workflows/build-blst-nightly.yml index 3d872e173..e7d5f0095 100644 --- a/.github/workflows/build-blst-nightly.yml +++ b/.github/workflows/build-blst-nightly.yml @@ -1,6 +1,13 @@ name: Build and Test with blst Nightly on: + # temporarily run on all PRs and commits + pull_request: + branches: + - '**' + push: + branches: + - '**' schedule: - cron: "0 11 * * *" workflow_dispatch: @@ -88,4 +95,4 @@ jobs: emcc -v export RELIC_MAIN=1 sh emsdk_build.sh - sh js_test.sh \ No newline at end of file + sh js_test.sh From ea48fe707af579592dbf0c74331b28cc434cade9 Mon Sep 17 00:00:00 2001 From: Gene Hoffman Date: Tue, 20 Jun 2023 17:34:35 -0700 Subject: [PATCH 04/14] yaml fixup --- .github/workflows/build-blst-nightly.yml | 32 ++++++++++++------------ 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/.github/workflows/build-blst-nightly.yml b/.github/workflows/build-blst-nightly.yml index e7d5f0095..fd9c6a9eb 100644 --- a/.github/workflows/build-blst-nightly.yml +++ b/.github/workflows/build-blst-nightly.yml @@ -18,7 +18,7 @@ concurrency: cancel-in-progress: true jobs: - build_wheels: + build_with_blst_main: name: Build and Test with blst Nightly runs-on: ${{ matrix.os }} strategy: @@ -65,23 +65,23 @@ jobs: echo "Running ./src/runtest" ./src/runtest - - name: Windows build C++ and test - if: startsWith(matrix.os, 'windows') - run: | - ls -l - export BLST_MAIN=1 - mkdir -p build - ls -l build - cd build - cmake ../ - cmake --build . -- -j 6 - echo "Running ./src/runtest" - ./src/runtest + - name: Windows build C++ and test + if: startsWith(matrix.os, 'windows') + run: | + ls -l + export BLST_MAIN=1 + mkdir -p build + ls -l build + cd build + cmake ../ + cmake --build . -- -j 6 + echo "Running ./src/runtest" + ./src/runtest - - uses: actions/setup-python@v2 - name: Install Python + - name: Install Python + uses: actions/setup-python@v4 with: - python-version: '3.8' + python-version: '3.9' - name: Test pure python implementation run: | From 10d119c9e671384056fabf00e9b43c8a740a073d Mon Sep 17 00:00:00 2001 From: Gene Hoffman Date: Tue, 20 Jun 2023 17:39:41 -0700 Subject: [PATCH 05/14] Fix origin/main tag issue --- .github/workflows/build-blst-nightly.yml | 3 --- CMakeLists.txt | 2 +- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/build-blst-nightly.yml b/.github/workflows/build-blst-nightly.yml index fd9c6a9eb..dec53e925 100644 --- a/.github/workflows/build-blst-nightly.yml +++ b/.github/workflows/build-blst-nightly.yml @@ -5,9 +5,6 @@ on: pull_request: branches: - '**' - push: - branches: - - '**' schedule: - cron: "0 11 * * *" workflow_dispatch: diff --git a/CMakeLists.txt b/CMakeLists.txt index a74b58f2f..28eeefeb9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -55,7 +55,7 @@ else () # This is currently anchored to upstream aecdcae7956f542fbee2392c1f0feb0a8ac41dc5 set(BLST_GIT_TAG "a8cd361c9f671577aeab3f074098443af92a53fc") endif () -set(BLST_REPOSITORY "https://github.com/supranational/blst") +set(BLST_REPOSITORY "https://github.com/supranational/blst.git") message(STATUS "blst will be built from: ${BLST_GIT_TAG} and repository ${BLST_REPOSITORY}") From 44f5c40d66882630928882513cd9b7f27282d87b Mon Sep 17 00:00:00 2001 From: Gene Hoffman Date: Tue, 20 Jun 2023 17:43:47 -0700 Subject: [PATCH 06/14] blst still uses master --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 28eeefeb9..f2154bad4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -50,7 +50,7 @@ set(SODIUM_CHIA_MINIMAL "on" CACHE STRING "") FetchContent_MakeAvailable(Sodium) if (DEFINED ENV{BLST_MAIN}) - set(BLST_GIT_TAG "origin/main") + set(BLST_GIT_TAG "origin/master") else () # This is currently anchored to upstream aecdcae7956f542fbee2392c1f0feb0a8ac41dc5 set(BLST_GIT_TAG "a8cd361c9f671577aeab3f074098443af92a53fc") From 0296b74ffd3495e361e1edf992e08f65a2e7f405 Mon Sep 17 00:00:00 2001 From: Gene Hoffman Date: Tue, 20 Jun 2023 17:49:26 -0700 Subject: [PATCH 07/14] windows fixes, less linux cmake --- .github/workflows/build-blst-nightly.yml | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/.github/workflows/build-blst-nightly.yml b/.github/workflows/build-blst-nightly.yml index dec53e925..6af89fcea 100644 --- a/.github/workflows/build-blst-nightly.yml +++ b/.github/workflows/build-blst-nightly.yml @@ -32,13 +32,8 @@ jobs: run: | echo "Relic origin/main commit:" curl -H "application/vnd.github.v3.sha" \ - https://api.github.com/repos/supranational/blst/commits/main | \ + https://api.github.com/repos/supranational/blst/commits/master | \ head -10 - sudo apt-get update - sudo apt-get install snap -y - sudo apt-get remove --purge cmake -y - # sudo snap install cmake --classic - hash -r cmake --version export BLST_MAIN=1 mkdir -p build @@ -65,10 +60,8 @@ jobs: - name: Windows build C++ and test if: startsWith(matrix.os, 'windows') run: | - ls -l - export BLST_MAIN=1 + set BLST_MAIN=1 mkdir -p build - ls -l build cd build cmake ../ cmake --build . -- -j 6 From e3ae60cd3aa805fa7b47e3d1afc31e979551c3c6 Mon Sep 17 00:00:00 2001 From: Gene Hoffman Date: Tue, 20 Jun 2023 18:10:28 -0700 Subject: [PATCH 08/14] more windows tweaks --- .github/workflows/build-blst-nightly.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-blst-nightly.yml b/.github/workflows/build-blst-nightly.yml index 6af89fcea..b45ccd558 100644 --- a/.github/workflows/build-blst-nightly.yml +++ b/.github/workflows/build-blst-nightly.yml @@ -61,12 +61,12 @@ jobs: if: startsWith(matrix.os, 'windows') run: | set BLST_MAIN=1 - mkdir -p build + mkdir build cd build cmake ../ - cmake --build . -- -j 6 + cmake --build . echo "Running ./src/runtest" - ./src/runtest + .\src\runtest - name: Install Python uses: actions/setup-python@v4 From 091e837a46f3f9d2b623ff42a5ac62c21bcb2cff Mon Sep 17 00:00:00 2001 From: Gene Hoffman Date: Tue, 20 Jun 2023 18:21:11 -0700 Subject: [PATCH 09/14] windows env fix, try runtest again --- .github/workflows/build-blst-nightly.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-blst-nightly.yml b/.github/workflows/build-blst-nightly.yml index b45ccd558..bc69680c3 100644 --- a/.github/workflows/build-blst-nightly.yml +++ b/.github/workflows/build-blst-nightly.yml @@ -60,13 +60,14 @@ jobs: - name: Windows build C++ and test if: startsWith(matrix.os, 'windows') run: | - set BLST_MAIN=1 + $env:BLST_MAIN = '1' mkdir build cd build cmake ../ cmake --build . + Get-ChildItem -Path src\ -Force echo "Running ./src/runtest" - .\src\runtest + src\runtest - name: Install Python uses: actions/setup-python@v4 From 9182e241b49e4345fd142cfb1a45ed3b49c084a5 Mon Sep 17 00:00:00 2001 From: Amine Khaldi Date: Wed, 21 Jun 2023 17:00:15 +0100 Subject: [PATCH 10/14] Fix the Windows flow and improve the others (#413) --- .github/workflows/build-blst-nightly.yml | 35 +++++++++--------------- 1 file changed, 13 insertions(+), 22 deletions(-) diff --git a/.github/workflows/build-blst-nightly.yml b/.github/workflows/build-blst-nightly.yml index bc69680c3..9a5faf39d 100644 --- a/.github/workflows/build-blst-nightly.yml +++ b/.github/workflows/build-blst-nightly.yml @@ -30,44 +30,35 @@ jobs: - name: Ubuntu build C++ and test blst at origin/main if: startsWith(matrix.os, 'ubuntu') run: | - echo "Relic origin/main commit:" + echo "blst origin/main commit:" curl -H "application/vnd.github.v3.sha" \ https://api.github.com/repos/supranational/blst/commits/master | \ head -10 cmake --version export BLST_MAIN=1 - mkdir -p build - cd build - cmake ../ - cmake --build . -- -j 6 + cmake -B build . + cmake --build build -- -j 6 echo "Running ./src/runtest" - ./src/runtest + ./build/src/runtest - name: Mac OS build C++ and test if: startsWith(matrix.os, 'macos') run: | - ls -l export MACOSX_DEPLOYMENT_TARGET=10.14 export BLST_MAIN=1 - mkdir -p build - ls -l build - cd build - cmake ../ - cmake --build . -- -j 6 + cmake -B build . + cmake --build build -- -j 6 echo "Running ./src/runtest" - ./src/runtest + ./build/src/runtest - name: Windows build C++ and test if: startsWith(matrix.os, 'windows') run: | - $env:BLST_MAIN = '1' - mkdir build - cd build - cmake ../ - cmake --build . - Get-ChildItem -Path src\ -Force - echo "Running ./src/runtest" - src\runtest + set BLST_MAIN=1 + cmake -B build . + cmake --build build + echo "Running runtest" + build\src\Debug\runtest.exe - name: Install Python uses: actions/setup-python@v4 @@ -84,6 +75,6 @@ jobs: - name: Test javascript bindings run: | emcc -v - export RELIC_MAIN=1 + export BLST_MAIN=1 sh emsdk_build.sh sh js_test.sh From b252373ae80237ffbf8b30a4266d4894dbfeb733 Mon Sep 17 00:00:00 2001 From: Gene Hoffman Date: Wed, 21 Jun 2023 10:45:43 -0700 Subject: [PATCH 11/14] Try setting the env at the workflow level --- .github/workflows/build-blst-nightly.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-blst-nightly.yml b/.github/workflows/build-blst-nightly.yml index 9a5faf39d..b4f1acd9c 100644 --- a/.github/workflows/build-blst-nightly.yml +++ b/.github/workflows/build-blst-nightly.yml @@ -73,8 +73,9 @@ jobs: uses: mymindstorm/setup-emsdk@v11 - name: Test javascript bindings + env: + BLST_MAIN: 1 run: | emcc -v - export BLST_MAIN=1 sh emsdk_build.sh sh js_test.sh From 6e0ff4470d951233a818c6dbc9edde7b429ff53a Mon Sep 17 00:00:00 2001 From: Gene Hoffman Date: Wed, 21 Jun 2023 11:06:43 -0700 Subject: [PATCH 12/14] move to env: for all steps --- .github/workflows/build-blst-nightly.yml | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build-blst-nightly.yml b/.github/workflows/build-blst-nightly.yml index b4f1acd9c..a1d207ae2 100644 --- a/.github/workflows/build-blst-nightly.yml +++ b/.github/workflows/build-blst-nightly.yml @@ -29,13 +29,14 @@ jobs: - name: Ubuntu build C++ and test blst at origin/main if: startsWith(matrix.os, 'ubuntu') + # blst is still using master instead of main + env: + BLST_MAIN: 1 run: | echo "blst origin/main commit:" curl -H "application/vnd.github.v3.sha" \ https://api.github.com/repos/supranational/blst/commits/master | \ head -10 - cmake --version - export BLST_MAIN=1 cmake -B build . cmake --build build -- -j 6 echo "Running ./src/runtest" @@ -43,9 +44,10 @@ jobs: - name: Mac OS build C++ and test if: startsWith(matrix.os, 'macos') + env: + BLST_MAIN: 1 + MACOSX_DEPLOYMENT_TARGET: 10.14 run: | - export MACOSX_DEPLOYMENT_TARGET=10.14 - export BLST_MAIN=1 cmake -B build . cmake --build build -- -j 6 echo "Running ./src/runtest" @@ -53,8 +55,9 @@ jobs: - name: Windows build C++ and test if: startsWith(matrix.os, 'windows') + env: + BLST_MAIN: 1 run: | - set BLST_MAIN=1 cmake -B build . cmake --build build echo "Running runtest" From 789634990a419296291f8cc4c78d37611b85266e Mon Sep 17 00:00:00 2001 From: Amine Khaldi Date: Wed, 21 Jun 2023 22:48:34 +0100 Subject: [PATCH 13/14] Fix Linux build when using blst's main. Discovered by Earle. (#415) --- python-bindings/CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/python-bindings/CMakeLists.txt b/python-bindings/CMakeLists.txt index 9ddc24e33..0e77050f7 100644 --- a/python-bindings/CMakeLists.txt +++ b/python-bindings/CMakeLists.txt @@ -8,3 +8,7 @@ FetchContent_MakeAvailable(pybind11) pybind11_add_module(blspy ${CMAKE_CURRENT_SOURCE_DIR}/pythonbindings.cpp) target_link_libraries(blspy PRIVATE bls) + +if((NOT MSVC) AND (NOT ${CMAKE_SYSTEM_NAME} MATCHES "Darwin")) + target_link_options(blspy PRIVATE -Wl,-Bsymbolic) +endif() From f6cf46fc65c920f372bb762c81ea0474be8af6a8 Mon Sep 17 00:00:00 2001 From: Gene Hoffman Date: Wed, 21 Jun 2023 15:17:49 -0700 Subject: [PATCH 14/14] Remove regular on PR for nightly and on-demand --- .github/workflows/build-blst-nightly.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/build-blst-nightly.yml b/.github/workflows/build-blst-nightly.yml index a1d207ae2..799fdc736 100644 --- a/.github/workflows/build-blst-nightly.yml +++ b/.github/workflows/build-blst-nightly.yml @@ -1,10 +1,6 @@ name: Build and Test with blst Nightly on: - # temporarily run on all PRs and commits - pull_request: - branches: - - '**' schedule: - cron: "0 11 * * *" workflow_dispatch: