From c99be39ae97d7e079aadee26a3ab5fec00ca1c31 Mon Sep 17 00:00:00 2001 From: Alexey Shlyonskikh Date: Mon, 29 Jul 2024 16:32:39 +0700 Subject: [PATCH 1/3] Use newer boost version 1.81.0 contains unordered flat structures. Also have to compile from source again. --- .../download-libraries/action.yml | 39 +++++++++++++++++-- .github/workflows/wheel.yml | 22 ++--------- CMakeLists.txt | 2 +- 3 files changed, 40 insertions(+), 23 deletions(-) diff --git a/.github/composite-actions/download-libraries/action.yml b/.github/composite-actions/download-libraries/action.yml index 09062e7520..cdf5e98558 100644 --- a/.github/composite-actions/download-libraries/action.yml +++ b/.github/composite-actions/download-libraries/action.yml @@ -11,6 +11,11 @@ inputs: description: 'Download googletest' default: true + install-boost: + type: boolean + description: 'Install boost' + default: true + runs: using: 'composite' steps: @@ -21,10 +26,6 @@ runs: sudo apt-get install gcc-10 g++-10 cmake build-essential -y shell: bash - - name: Install Boost - run: sudo apt-get install libboost-all-dev -y - shell: bash - - name: Make lib directory run: | mkdir -p lib @@ -66,6 +67,36 @@ runs: directory: atomicbitvector download-command: git clone https://github.com/ekg/atomicbitvector.git --depth 1 + - name: Cache Boost + uses: actions/cache@v3 + id: cache-boost + with: + path: ${{github.workspace}}/lib/boost_1_81_0 + key: ${{ runner.os }}-boost-81 + + - name: Download and unpack Boost + run: | + cd lib + wget -O boost_1_81_0.tar.gz https://sourceforge.net/projects/boost/files/boost/1.81.0/boost_1_81_0.tar.gz/download + tar xzvf boost_1_81_0.tar.gz + shell: bash + if: steps.cache-boost.outputs.cache-hit != 'true' + + - name: Copy boost + run: | + cd lib + # Avoid caching build files + cp -r boost_1_81_0 boost + shell: bash + + - name: Install Boost + run: | + cd lib/boost + ./bootstrap.sh --prefix=/usr + sudo ./b2 install --prefix=/usr + shell: bash + if: inputs.install-boost != 'false' + # Uncomment this if we set up our own git lfs server # - name: Install git-lfs # run: | diff --git a/.github/workflows/wheel.yml b/.github/workflows/wheel.yml index d6773ee9cd..deb3beb3ce 100644 --- a/.github/workflows/wheel.yml +++ b/.github/workflows/wheel.yml @@ -79,21 +79,7 @@ jobs: with: download-pybind: true download-googletest: false - - - name: Cache unpacked Boost - uses: actions/cache@v3 - id: cache-unpacked-boost - with: - path: ${{github.workspace}}/lib/boost_1_78_0 - key: ${{ runner.os }}-boost-for-wheels-78 - - - name: Download & unpack Boost - run: | - cd ${{github.workspace}}/lib - wget -O boost_1_78_0.tar.gz https://sourceforge.net/projects/boost/files/boost/1.78.0/boost_1_78_0.tar.gz/download - tar xzf boost_1_78_0.tar.gz - shell: bash - if: steps.cache-unpacked-boost.outputs.cache-hit != 'true' + install-boost: false - name: Build wheels uses: pypa/cibuildwheel@v2.16.2 @@ -101,9 +87,9 @@ jobs: only: ${{ matrix.only }} env: CIBW_BEFORE_ALL: > - cd lib/boost_1_78_0 && - ./bootstrap.sh --prefix=/usr/local && - ./b2 install -j4 --prefix=/usr/local + cd lib/boost && + ./bootstrap.sh --prefix=/usr && + ./b2 install -j4 --prefix=/usr CIBW_TEST_COMMAND: > cp {project}/test_input_data/WDC_satellites.csv {project}/src/python_bindings && cp {project}/test_input_data/transactional_data/rules-kaggle-rows.csv {project}/src/python_bindings && diff --git a/CMakeLists.txt b/CMakeLists.txt index ae4372f4f6..1a33ec7d18 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -102,7 +102,7 @@ endif() # configuring boost set(Boost_USE_STATIC_LIBS OFF) -find_package(Boost 1.72.0 REQUIRED COMPONENTS container thread graph) +find_package(Boost 1.81.0 REQUIRED COMPONENTS container thread graph) include_directories(${Boost_INCLUDE_DIRS}) message(${Boost_INCLUDE_DIRS}) From 58b7952232834693ea9b93fc03de8a01d3a9d873 Mon Sep 17 00:00:00 2001 From: Alexey Shlyonskikh Date: Thu, 15 Aug 2024 14:10:45 +0700 Subject: [PATCH 2/3] Enable musllinux wheel build --- .github/workflows/wheel.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/wheel.yml b/.github/workflows/wheel.yml index deb3beb3ce..5ac31d0a33 100644 --- a/.github/workflows/wheel.yml +++ b/.github/workflows/wheel.yml @@ -55,10 +55,6 @@ jobs: CIBW_ARCHS_LINUX: x86_64 # Builds wheels for PyPy & CPython on manylinux CIBW_BUILD: "*manylinux*" - # musllinux crashes during Boost 1.78.0 compilation - # May be related to https://bugs.gentoo.org/829147 - # Perhaps that bumping Boost version in workflow can solve the issue - CIBW_SKIP: "*musllinux*" CIBW_TEST_REQUIRES: pytest CIBW_BUILD_VERBOSITY: 1 CIBW_MANYLINUX_X86_64_IMAGE: manylinux2014 From 165763e02ef2a5d0780c417eac07cde116552ac0 Mon Sep 17 00:00:00 2001 From: Alexey Shlyonskikh Date: Sat, 17 Aug 2024 20:45:45 +0700 Subject: [PATCH 3/3] Cache libraries immediately Prevents issues with build files ending up in cache --- .../download-libraries/action.yml | 25 +++---------------- .../download-library/action.yml | 15 +++++------ 2 files changed, 10 insertions(+), 30 deletions(-) diff --git a/.github/composite-actions/download-libraries/action.yml b/.github/composite-actions/download-libraries/action.yml index cdf5e98558..cfd3c46d07 100644 --- a/.github/composite-actions/download-libraries/action.yml +++ b/.github/composite-actions/download-libraries/action.yml @@ -66,28 +66,11 @@ runs: with: directory: atomicbitvector download-command: git clone https://github.com/ekg/atomicbitvector.git --depth 1 - - - name: Cache Boost - uses: actions/cache@v3 - id: cache-boost + - name: Download boost + uses: ./.github/composite-actions/download-library with: - path: ${{github.workspace}}/lib/boost_1_81_0 - key: ${{ runner.os }}-boost-81 - - - name: Download and unpack Boost - run: | - cd lib - wget -O boost_1_81_0.tar.gz https://sourceforge.net/projects/boost/files/boost/1.81.0/boost_1_81_0.tar.gz/download - tar xzvf boost_1_81_0.tar.gz - shell: bash - if: steps.cache-boost.outputs.cache-hit != 'true' - - - name: Copy boost - run: | - cd lib - # Avoid caching build files - cp -r boost_1_81_0 boost - shell: bash + directory: boost + download-command: wget -O boost_1_81_0.tar.gz https://sourceforge.net/projects/boost/files/boost/1.81.0/boost_1_81_0.tar.gz/download && tar xzvf boost_1_81_0.tar.gz && mv boost_1_81_0 boost - name: Install Boost run: | diff --git a/.github/composite-actions/download-library/action.yml b/.github/composite-actions/download-library/action.yml index 9adfb8016e..989b9d9abc 100644 --- a/.github/composite-actions/download-library/action.yml +++ b/.github/composite-actions/download-library/action.yml @@ -10,7 +10,7 @@ inputs: runs: using: 'composite' steps: - - uses: actions/cache@v3 + - uses: actions/cache/restore@v4 id: cache-library with: path: ${{github.workspace}}/lib/${{inputs.directory}} @@ -20,11 +20,8 @@ runs: ${{inputs.download-command}} shell: bash if: steps.cache-library.outputs.cache-hit != 'true' - - run: | - if ! test -d lib/'${{inputs.directory}}'; then - echo 'Library directory name is not correct:' '${{inputs.directory}}' - ls lib - exit 1 - fi - exit 0 - shell: bash + - uses: actions/cache/save@v4 + with: + path: ${{github.workspace}}/lib/${{inputs.directory}} + key: ${{runner.os}}-${{inputs.directory}} + if: steps.cache-library.outputs.cache-hit != 'true'