From 251079e1f0be6412069816c964ecf333cffbb140 Mon Sep 17 00:00:00 2001 From: Julian Nguyen <109386615+juliannguyen4@users.noreply.github.com> Date: Thu, 24 Apr 2025 13:56:21 -0700 Subject: [PATCH 01/48] give a try --- .github/workflows/tests.yml | 31 +++++++++++++++++++++++++++++++ setup.py | 7 ++++++- 2 files changed, 37 insertions(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index af5f051f8e..3737f6bac6 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -40,6 +40,31 @@ jobs: architecture: 'x64' - uses: pre-commit/action@v3.0.0 + # TODO: check if C client was already built for current submodule revision + # TODO: define a var for the same OS used in the other build job + build-c-client: + runs-on: ubuntu-22.04 + steps: + - run: sudo apt update + - name: Install C client build dependencies + run: sudo apt-get install -y libc6-dev libssl-dev autoconf automake libtool g++ zlib1g-dev ncurses-dev + + - uses: actions/checkout@v4 + with: + submodules: recursive + sparse-checkout: | + aerospike-client-c + + - run: make build + working-directory: aerospike-client-c + + - name: Send C client static library to job that builds Python client + uses: actions/upload-artifact@v4 + with: + name: c-client + # TODO: not the precise folder + path: ./aerospike-client-c/target/**/libaerospike.a + build: runs-on: ubuntu-22.04 strategy: @@ -73,10 +98,16 @@ jobs: - if: ${{ matrix.sanitizer }} run: echo SANITIZER=1 >> $GITHUB_ENV + - uses: actions/download-artifact@v4 + id: get-c-client + with: + name: c-client + - name: Build client run: python3 -m build env: CFLAGS: '-Werror' + C_CLIENT_SHARED_PATH: ${{ steps.get-c-client.outputs.download-path }} - run: echo WHEEL_GH_ARTIFACT_NAME=wheel-${{ matrix.py-version }} >> $GITHUB_ENV diff --git a/setup.py b/setup.py index 567bbfe345..a007708924 100644 --- a/setup.py +++ b/setup.py @@ -246,7 +246,12 @@ def compile(): print(cmd, library_dirs, libraries) call(cmd, cwd=CCLIENT_PATH) - self.execute(compile, [], 'Compiling core aerospike-client-c') + C_CLIENT_SHARED_PATH = os.getenv("C_CLIENT_SHARED_PATH") + if not C_CLIENT_SHARED_PATH: + self.execute(compile, [], 'Compiling core aerospike-client-c') + else: + import shutil + shutil.copyfile(C_CLIENT_SHARED_PATH, AEROSPIKE_C_TARGET + '/lib/libaerospike.a') # run original c-extension build code build.run(self) From dc9472ec2c0cb10f65ac15c5eac5835390b233a1 Mon Sep 17 00:00:00 2001 From: Julian Nguyen <109386615+juliannguyen4@users.noreply.github.com> Date: Thu, 24 Apr 2025 13:57:15 -0700 Subject: [PATCH 02/48] f --- .github/workflows/tests.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 3737f6bac6..821871bb4b 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -66,6 +66,7 @@ jobs: path: ./aerospike-client-c/target/**/libaerospike.a build: + depends-on: build-c-client runs-on: ubuntu-22.04 strategy: matrix: From 8a8554e96bd08f3947ff4544b11c94ba40bb05d8 Mon Sep 17 00:00:00 2001 From: Julian Nguyen <109386615+juliannguyen4@users.noreply.github.com> Date: Thu, 24 Apr 2025 13:58:03 -0700 Subject: [PATCH 03/48] f --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 821871bb4b..68846fe8fe 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -66,7 +66,7 @@ jobs: path: ./aerospike-client-c/target/**/libaerospike.a build: - depends-on: build-c-client + needs: build-c-client runs-on: ubuntu-22.04 strategy: matrix: From 3e65ecd32de769172e39ef49a8d8f2e3ad845bae Mon Sep 17 00:00:00 2001 From: Julian Nguyen <109386615+juliannguyen4@users.noreply.github.com> Date: Thu, 24 Apr 2025 14:01:52 -0700 Subject: [PATCH 04/48] f --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 68846fe8fe..f04c11a009 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -108,7 +108,7 @@ jobs: run: python3 -m build env: CFLAGS: '-Werror' - C_CLIENT_SHARED_PATH: ${{ steps.get-c-client.outputs.download-path }} + C_CLIENT_SHARED_PATH: ${{ steps.get-c-client.outputs.download-path }}/libaerospike.a - run: echo WHEEL_GH_ARTIFACT_NAME=wheel-${{ matrix.py-version }} >> $GITHUB_ENV From c3ae8173eb8268bea3cbd3891ca5ffff314ef544 Mon Sep 17 00:00:00 2001 From: Julian Nguyen <109386615+juliannguyen4@users.noreply.github.com> Date: Thu, 24 Apr 2025 15:54:54 -0700 Subject: [PATCH 05/48] move artifact to path --- .github/workflows/tests.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index f04c11a009..4e89773eef 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -103,6 +103,7 @@ jobs: id: get-c-client with: name: c-client + merge-multiple: true - name: Build client run: python3 -m build From 2f5d282c568592abf951f675879f619b75ee8dcd Mon Sep 17 00:00:00 2001 From: Julian Nguyen <109386615+juliannguyen4@users.noreply.github.com> Date: Thu, 24 Apr 2025 15:59:27 -0700 Subject: [PATCH 06/48] debug --- .github/workflows/tests.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 4e89773eef..4f0e6f7250 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -105,6 +105,8 @@ jobs: name: c-client merge-multiple: true + - run: ls -l + - name: Build client run: python3 -m build env: From 067791a3c8cf83c11b32e6a82d52a37a4c34ddc2 Mon Sep 17 00:00:00 2001 From: Julian Nguyen <109386615+juliannguyen4@users.noreply.github.com> Date: Thu, 24 Apr 2025 16:03:51 -0700 Subject: [PATCH 07/48] fix --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 4f0e6f7250..1be7d62527 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -63,7 +63,7 @@ jobs: with: name: c-client # TODO: not the precise folder - path: ./aerospike-client-c/target/**/libaerospike.a + path: ./aerospike-client-c/target/Linux-x86_64/lib/libaerospike.a build: needs: build-c-client From 3d42110309264da3782dee221c28c23ac4706e32 Mon Sep 17 00:00:00 2001 From: Julian Nguyen <109386615+juliannguyen4@users.noreply.github.com> Date: Thu, 24 Apr 2025 16:08:14 -0700 Subject: [PATCH 08/48] fail on error --- .github/workflows/tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 1be7d62527..9f2c4c33dd 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -64,6 +64,7 @@ jobs: name: c-client # TODO: not the precise folder path: ./aerospike-client-c/target/Linux-x86_64/lib/libaerospike.a + if-no-files-found: error build: needs: build-c-client @@ -103,9 +104,8 @@ jobs: id: get-c-client with: name: c-client - merge-multiple: true - - run: ls -l + - run: ls -R - name: Build client run: python3 -m build From a6c1aa74e3a25502109fbcb4897ba2d82c6740c9 Mon Sep 17 00:00:00 2001 From: Julian Nguyen <109386615+juliannguyen4@users.noreply.github.com> Date: Thu, 24 Apr 2025 16:10:42 -0700 Subject: [PATCH 09/48] idk --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 9f2c4c33dd..00ea6bd04f 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -111,7 +111,7 @@ jobs: run: python3 -m build env: CFLAGS: '-Werror' - C_CLIENT_SHARED_PATH: ${{ steps.get-c-client.outputs.download-path }}/libaerospike.a + C_CLIENT_SHARED_PATH: ./libaerospike.a - run: echo WHEEL_GH_ARTIFACT_NAME=wheel-${{ matrix.py-version }} >> $GITHUB_ENV From 2528cb7ff68386e0ca204dd86aa69491b2d45207 Mon Sep 17 00:00:00 2001 From: Julian Nguyen <109386615+juliannguyen4@users.noreply.github.com> Date: Thu, 24 Apr 2025 16:11:44 -0700 Subject: [PATCH 10/48] forgot --- MANIFEST.in | 1 + 1 file changed, 1 insertion(+) diff --git a/MANIFEST.in b/MANIFEST.in index 0ecdb34904..927a92de1e 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -8,3 +8,4 @@ include modules/aerospike-lua-core/src/*.lua global-include *.pyi global-include *.typed include custom-versionit-format.py +include libaerospike.a From e3ed46cb08cd91d761e5d4f46dc6dbe9e9af13ac Mon Sep 17 00:00:00 2001 From: Julian Nguyen <109386615+juliannguyen4@users.noreply.github.com> Date: Thu, 24 Apr 2025 16:14:56 -0700 Subject: [PATCH 11/48] ignore --- .github/workflows/tests.yml | 2 +- setup.py | 3 --- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 00ea6bd04f..784d067222 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -111,7 +111,7 @@ jobs: run: python3 -m build env: CFLAGS: '-Werror' - C_CLIENT_SHARED_PATH: ./libaerospike.a + C_CLIENT_SHARED_PATH: 1 - run: echo WHEEL_GH_ARTIFACT_NAME=wheel-${{ matrix.py-version }} >> $GITHUB_ENV diff --git a/setup.py b/setup.py index a007708924..750a615087 100644 --- a/setup.py +++ b/setup.py @@ -249,9 +249,6 @@ def compile(): C_CLIENT_SHARED_PATH = os.getenv("C_CLIENT_SHARED_PATH") if not C_CLIENT_SHARED_PATH: self.execute(compile, [], 'Compiling core aerospike-client-c') - else: - import shutil - shutil.copyfile(C_CLIENT_SHARED_PATH, AEROSPIKE_C_TARGET + '/lib/libaerospike.a') # run original c-extension build code build.run(self) From ad211a5702b4342c64b3d60a397f9d893dbeab17 Mon Sep 17 00:00:00 2001 From: Julian Nguyen <109386615+juliannguyen4@users.noreply.github.com> Date: Thu, 30 Oct 2025 08:37:26 -0700 Subject: [PATCH 12/48] Create separate workflows to trigger c client and python client builds --- .github/workflows/build-python-client.yml | 63 +++++++++++++++++++++++ .github/workflows/rebuild-c-client.yml | 37 +++++++++++++ 2 files changed, 100 insertions(+) create mode 100644 .github/workflows/build-python-client.yml create mode 100644 .github/workflows/rebuild-c-client.yml diff --git a/.github/workflows/build-python-client.yml b/.github/workflows/build-python-client.yml new file mode 100644 index 0000000000..d180a12676 --- /dev/null +++ b/.github/workflows/build-python-client.yml @@ -0,0 +1,63 @@ +on: + workflow_call: + +jobs: + build-python-client: + runs-on: ubuntu-22.04 + strategy: + matrix: + py-version: ["3.9", "3.10", "3.11", "3.12", "3.13", "3.14"] + # Make sure we can build and run tests on an instrumented build that uses libasan + # We aren't necessarily checking for memory errors / leaks in this test + sanitizer: [false] + include: + - py-version: 3.9 + sanitizer: true + fail-fast: false + + steps: + - uses: actions/checkout@v2 + with: + submodules: recursive + fetch-depth: 0 + + - run: echo C_CLIENT_REVISION=$(git submodule status | awk '{print $1}') >> $GITHUB_ENV + + - uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.py-version }} + architecture: 'x64' + allow-prereleases: true + + - run: sudo apt update + - name: Install build dependencies (apt packages) + run: sudo apt install python3-dev libssl-dev -y + - name: Install build dependencies (pip packages) + run: python3 -m pip install -r requirements.txt + + - if: ${{ matrix.sanitizer }} + run: echo SANITIZER=1 >> $GITHUB_ENV + + - uses: actions/download-artifact@v4 + id: get-c-client + with: + name: c-client-${{ env.C_CLIENT_REVISION }} + + - run: ls -R + + - name: Build client + run: python3 -m build + env: + CFLAGS: '-Werror' + C_CLIENT_SHARED_PATH: 1 + + - run: echo WHEEL_GH_ARTIFACT_NAME=wheel-${{ matrix.py-version }} >> $GITHUB_ENV + + - if: ${{ matrix.sanitizer }} + run: echo WHEEL_GH_ARTIFACT_NAME=${{ env.WHEEL_GH_ARTIFACT_NAME }}-sanitizer >> $GITHUB_ENV + + - name: Send wheel to test jobs + uses: actions/upload-artifact@v4 + with: + name: ${{ env.WHEEL_GH_ARTIFACT_NAME }} + path: ./dist/*.whl diff --git a/.github/workflows/rebuild-c-client.yml b/.github/workflows/rebuild-c-client.yml new file mode 100644 index 0000000000..bc21809b4c --- /dev/null +++ b/.github/workflows/rebuild-c-client.yml @@ -0,0 +1,37 @@ +on: + pull_request: + paths: + - 'aerospike-client-c' + +jobs: + # TODO: define a var for the same OS used in the other build job + build-c-client: + runs-on: ubuntu-22.04 + steps: + - run: sudo apt update + - name: Install C client build dependencies + run: sudo apt-get install -y libc6-dev libssl-dev autoconf automake libtool g++ zlib1g-dev ncurses-dev + + - uses: actions/checkout@v4 + with: + submodules: recursive + sparse-checkout: | + aerospike-client-c + + - run: echo C_CLIENT_REVISION=$(git rev-parse HEAD) >> $GITHUB_ENV + working-directory: aerospike-client-c + + - run: make build + working-directory: aerospike-client-c + + - name: Send C client static library to job that builds Python client + uses: actions/upload-artifact@v4 + with: + name: c-client-${{ env.C_CLIENT_REVISION }} + # TODO: not the precise folder + path: ./aerospike-client-c/target/Linux-x86_64/lib/libaerospike.a + if-no-files-found: error + + build-python-client: + needs: build-c-client + uses: ./github/workflows/build-python-client.yml From 86e26272864ff62bc7a28f7d400ab4e45189c0de Mon Sep 17 00:00:00 2001 From: Julian Nguyen <109386615+juliannguyen4@users.noreply.github.com> Date: Thu, 30 Oct 2025 08:46:04 -0700 Subject: [PATCH 13/48] Rename and test run --- .../{rebuild-c-client.yml => build-c-client.yml} | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) rename .github/workflows/{rebuild-c-client.yml => build-c-client.yml} (85%) diff --git a/.github/workflows/rebuild-c-client.yml b/.github/workflows/build-c-client.yml similarity index 85% rename from .github/workflows/rebuild-c-client.yml rename to .github/workflows/build-c-client.yml index bc21809b4c..52ad9b7b27 100644 --- a/.github/workflows/rebuild-c-client.yml +++ b/.github/workflows/build-c-client.yml @@ -1,7 +1,5 @@ on: - pull_request: - paths: - - 'aerospike-client-c' + workflow_call: jobs: # TODO: define a var for the same OS used in the other build job @@ -21,6 +19,11 @@ jobs: - run: echo C_CLIENT_REVISION=$(git rev-parse HEAD) >> $GITHUB_ENV working-directory: aerospike-client-c + - uses: actions/download-artifact@v4 + id: download-c-client + with: + name: c-client-${{ env.C_CLIENT_REVISION }} + - run: make build working-directory: aerospike-client-c @@ -31,7 +34,3 @@ jobs: # TODO: not the precise folder path: ./aerospike-client-c/target/Linux-x86_64/lib/libaerospike.a if-no-files-found: error - - build-python-client: - needs: build-c-client - uses: ./github/workflows/build-python-client.yml From 27766d0110e89d37a3d885cdde80de6f4530a4b8 Mon Sep 17 00:00:00 2001 From: Julian Nguyen <109386615+juliannguyen4@users.noreply.github.com> Date: Thu, 30 Oct 2025 08:46:46 -0700 Subject: [PATCH 14/48] Add workflow to tie two workflows --- .github/workflows/build.yml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000000..c708efb39a --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,14 @@ +on: + pull_request: + paths: + - aerospike-client-c + - src/** + workflow_dispatch: + +jobs: + build-c-client: + uses: ./.github/workflows/build-c-client.yml + + build-python-client: + needs: build-c-client + uses: ./.github/workflows/build-python-client.yml From e7d34f8a1180fd6109456aac783342fa6ef5d3ed Mon Sep 17 00:00:00 2001 From: Julian Nguyen <109386615+juliannguyen4@users.noreply.github.com> Date: Thu, 30 Oct 2025 08:47:44 -0700 Subject: [PATCH 15/48] has to run at least once. --- .github/workflows/build.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c708efb39a..810d86a2a8 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,8 +1,8 @@ on: pull_request: - paths: - - aerospike-client-c - - src/** + # paths: + # - aerospike-client-c + # - src/** workflow_dispatch: jobs: From 7a8ba51103307e46d4433ea0cc967891446a11e2 Mon Sep 17 00:00:00 2001 From: Julian Nguyen <109386615+juliannguyen4@users.noreply.github.com> Date: Thu, 30 Oct 2025 08:49:58 -0700 Subject: [PATCH 16/48] Don't exit if artifact doesn't exist. --- .github/workflows/build-c-client.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/build-c-client.yml b/.github/workflows/build-c-client.yml index 52ad9b7b27..164051faba 100644 --- a/.github/workflows/build-c-client.yml +++ b/.github/workflows/build-c-client.yml @@ -23,12 +23,15 @@ jobs: id: download-c-client with: name: c-client-${{ env.C_CLIENT_REVISION }} + continue-on-error: true - run: make build + if: ${{ steps.download-c-client.outcome == 'failure' }} working-directory: aerospike-client-c - name: Send C client static library to job that builds Python client uses: actions/upload-artifact@v4 + if: ${{ steps.download-c-client.outcome == 'failure' }} with: name: c-client-${{ env.C_CLIENT_REVISION }} # TODO: not the precise folder From e4fe04aff41dff35b89aaf7c37945eca343ec5ff Mon Sep 17 00:00:00 2001 From: Julian Nguyen <109386615+juliannguyen4@users.noreply.github.com> Date: Thu, 30 Oct 2025 08:51:04 -0700 Subject: [PATCH 17/48] refactor --- .github/workflows/build-c-client.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-c-client.yml b/.github/workflows/build-c-client.yml index 164051faba..c74a893337 100644 --- a/.github/workflows/build-c-client.yml +++ b/.github/workflows/build-c-client.yml @@ -6,10 +6,6 @@ jobs: build-c-client: runs-on: ubuntu-22.04 steps: - - run: sudo apt update - - name: Install C client build dependencies - run: sudo apt-get install -y libc6-dev libssl-dev autoconf automake libtool g++ zlib1g-dev ncurses-dev - - uses: actions/checkout@v4 with: submodules: recursive @@ -25,6 +21,12 @@ jobs: name: c-client-${{ env.C_CLIENT_REVISION }} continue-on-error: true + - name: Install C client build dependencies + if: ${{ steps.download-c-client.outcome == 'failure' }} + run: | + sudo apt update && + sudo apt-get install -y libc6-dev libssl-dev autoconf automake libtool g++ zlib1g-dev ncurses-dev + - run: make build if: ${{ steps.download-c-client.outcome == 'failure' }} working-directory: aerospike-client-c From 3f8d1ae4261b85731b235a86ad475b4f5598abd0 Mon Sep 17 00:00:00 2001 From: Julian Nguyen <109386615+juliannguyen4@users.noreply.github.com> Date: Thu, 30 Oct 2025 15:16:20 -0700 Subject: [PATCH 18/48] Just get include files from submodule's source code. it should be the same as target folder's include folder... --- setup.py | 1 + 1 file changed, 1 insertion(+) diff --git a/setup.py b/setup.py index 12635fc158..a0f4398b90 100644 --- a/setup.py +++ b/setup.py @@ -64,6 +64,7 @@ ################################################################################ include_dirs = ['src/include'] + \ + [f'{AEROSPIKE_C_HOME}/src/include'] + \ [x for x in os.getenv('CPATH', '').split(':') if len(x) > 0] + \ ['/usr/local/opt/openssl/include'] + \ ['aerospike-client-c/modules/common/src/include'] From d400d49deb2b1db3ddbee6d89e8a50b76958902e Mon Sep 17 00:00:00 2001 From: Julian Nguyen <109386615+juliannguyen4@users.noreply.github.com> Date: Thu, 30 Oct 2025 15:23:34 -0700 Subject: [PATCH 19/48] Allow passing in the path to c client static library so we don't have to rebuild. --- .github/workflows/build-python-client.yml | 2 +- setup.py | 13 +++++++++---- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build-python-client.yml b/.github/workflows/build-python-client.yml index d180a12676..4cd86225d0 100644 --- a/.github/workflows/build-python-client.yml +++ b/.github/workflows/build-python-client.yml @@ -49,7 +49,7 @@ jobs: run: python3 -m build env: CFLAGS: '-Werror' - C_CLIENT_SHARED_PATH: 1 + C_CLIENT_SHARED_PATH: ./libaerospike.a - run: echo WHEEL_GH_ARTIFACT_NAME=wheel-${{ matrix.py-version }} >> $GITHUB_ENV diff --git a/setup.py b/setup.py index a0f4398b90..83d4cc7909 100644 --- a/setup.py +++ b/setup.py @@ -178,11 +178,17 @@ '/usr/local/opt/openssl/include', ] + +C_CLIENT_SHARED_PATH = os.getenv("C_CLIENT_SHARED_PATH") + if not WINDOWS: include_dirs.append(AEROSPIKE_C_TARGET + '/include') - extra_objects = extra_objects + [ - AEROSPIKE_C_TARGET + '/lib/libaerospike.a' - ] + if C_CLIENT_SHARED_PATH: + extra_objects.append(C_CLIENT_SHARED_PATH) + else: + extra_objects = extra_objects + [ + AEROSPIKE_C_TARGET + '/lib/libaerospike.a' + ] else: include_dirs.append(AEROSPIKE_C_TARGET + '/src/include') library_dirs.append(f"{AEROSPIKE_C_TARGET}/vs/packages/aerospike-client-c-dependencies.{c_client_dependencies_version}/build/native/lib/x64/Release") @@ -250,7 +256,6 @@ def compile(): print(cmd, library_dirs, libraries) call(cmd, cwd=CCLIENT_PATH) - C_CLIENT_SHARED_PATH = os.getenv("C_CLIENT_SHARED_PATH") if not C_CLIENT_SHARED_PATH: self.execute(compile, [], 'Compiling core aerospike-client-c') # run original c-extension build code From ec8d5e83c098c6577d5e9acaf89c8bd00f8f8699 Mon Sep 17 00:00:00 2001 From: Julian Nguyen <109386615+juliannguyen4@users.noreply.github.com> Date: Tue, 6 Jan 2026 12:49:33 -0800 Subject: [PATCH 20/48] TODO this needs to use cache... --- .github/workflows/build-c-client.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-c-client.yml b/.github/workflows/build-c-client.yml index c74a893337..2a45ff47e2 100644 --- a/.github/workflows/build-c-client.yml +++ b/.github/workflows/build-c-client.yml @@ -15,7 +15,7 @@ jobs: - run: echo C_CLIENT_REVISION=$(git rev-parse HEAD) >> $GITHUB_ENV working-directory: aerospike-client-c - - uses: actions/download-artifact@v4 + - uses: actions/cache@v5 id: download-c-client with: name: c-client-${{ env.C_CLIENT_REVISION }} From e0c87ad016103221f1dabf2099081669bbf42c9c Mon Sep 17 00:00:00 2001 From: Julian Nguyen <109386615+juliannguyen4@users.noreply.github.com> Date: Tue, 6 Jan 2026 12:59:52 -0800 Subject: [PATCH 21/48] Add support for caching --- .github/workflows/build-c-client.yml | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build-c-client.yml b/.github/workflows/build-c-client.yml index 2a45ff47e2..939e701d4f 100644 --- a/.github/workflows/build-c-client.yml +++ b/.github/workflows/build-c-client.yml @@ -18,22 +18,18 @@ jobs: - uses: actions/cache@v5 id: download-c-client with: - name: c-client-${{ env.C_CLIENT_REVISION }} - continue-on-error: true + key: c-client-${{ env.C_CLIENT_REVISION }} + path: ./aerospike-client-c/target/Linux-x86_64/lib/libaerospike.a - name: Install C client build dependencies - if: ${{ steps.download-c-client.outcome == 'failure' }} + if: ${{ steps.download-c-client.outputs.cache-hit != 'true' }} run: | sudo apt update && sudo apt-get install -y libc6-dev libssl-dev autoconf automake libtool g++ zlib1g-dev ncurses-dev - - - run: make build - if: ${{ steps.download-c-client.outcome == 'failure' }} working-directory: aerospike-client-c - name: Send C client static library to job that builds Python client uses: actions/upload-artifact@v4 - if: ${{ steps.download-c-client.outcome == 'failure' }} with: name: c-client-${{ env.C_CLIENT_REVISION }} # TODO: not the precise folder From f113c14eeeea8cb7c8b889c60d332e0d1c68ad22 Mon Sep 17 00:00:00 2001 From: Julian Nguyen <109386615+juliannguyen4@users.noreply.github.com> Date: Tue, 6 Jan 2026 13:00:50 -0800 Subject: [PATCH 22/48] Fix --- .github/workflows/build-c-client.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-c-client.yml b/.github/workflows/build-c-client.yml index 939e701d4f..5fb15b0d2a 100644 --- a/.github/workflows/build-c-client.yml +++ b/.github/workflows/build-c-client.yml @@ -25,7 +25,8 @@ jobs: if: ${{ steps.download-c-client.outputs.cache-hit != 'true' }} run: | sudo apt update && - sudo apt-get install -y libc6-dev libssl-dev autoconf automake libtool g++ zlib1g-dev ncurses-dev + sudo apt-get install -y libc6-dev libssl-dev autoconf automake libtool g++ zlib1g-dev ncurses-dev && + make build working-directory: aerospike-client-c - name: Send C client static library to job that builds Python client From 57dbe68cd6a3cd00d3d8e8d5b39c847da9f625d7 Mon Sep 17 00:00:00 2001 From: Julian Nguyen <109386615+juliannguyen4@users.noreply.github.com> Date: Tue, 6 Jan 2026 13:04:08 -0800 Subject: [PATCH 23/48] Fix --- .github/workflows/build-c-client.yml | 8 -------- .github/workflows/build-python-client.yml | 6 +++--- 2 files changed, 3 insertions(+), 11 deletions(-) diff --git a/.github/workflows/build-c-client.yml b/.github/workflows/build-c-client.yml index 5fb15b0d2a..08e9cb58ab 100644 --- a/.github/workflows/build-c-client.yml +++ b/.github/workflows/build-c-client.yml @@ -28,11 +28,3 @@ jobs: sudo apt-get install -y libc6-dev libssl-dev autoconf automake libtool g++ zlib1g-dev ncurses-dev && make build working-directory: aerospike-client-c - - - name: Send C client static library to job that builds Python client - uses: actions/upload-artifact@v4 - with: - name: c-client-${{ env.C_CLIENT_REVISION }} - # TODO: not the precise folder - path: ./aerospike-client-c/target/Linux-x86_64/lib/libaerospike.a - if-no-files-found: error diff --git a/.github/workflows/build-python-client.yml b/.github/workflows/build-python-client.yml index 4cd86225d0..d52116740d 100644 --- a/.github/workflows/build-python-client.yml +++ b/.github/workflows/build-python-client.yml @@ -38,10 +38,10 @@ jobs: - if: ${{ matrix.sanitizer }} run: echo SANITIZER=1 >> $GITHUB_ENV - - uses: actions/download-artifact@v4 - id: get-c-client + - uses: actions/cache@v5 + id: download-c-client with: - name: c-client-${{ env.C_CLIENT_REVISION }} + key: c-client-${{ env.C_CLIENT_REVISION }} - run: ls -R From 52c13a404dc6f2d49b0054a56dad7f54d88509bb Mon Sep 17 00:00:00 2001 From: Julian Nguyen <109386615+juliannguyen4@users.noreply.github.com> Date: Tue, 6 Jan 2026 13:05:26 -0800 Subject: [PATCH 24/48] fix --- .github/workflows/build-python-client.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-python-client.yml b/.github/workflows/build-python-client.yml index d52116740d..5f6f5102ff 100644 --- a/.github/workflows/build-python-client.yml +++ b/.github/workflows/build-python-client.yml @@ -38,10 +38,11 @@ jobs: - if: ${{ matrix.sanitizer }} run: echo SANITIZER=1 >> $GITHUB_ENV - - uses: actions/cache@v5 + - uses: actions/cache/restore@v5 id: download-c-client with: key: c-client-${{ env.C_CLIENT_REVISION }} + path: libaerospike.a - run: ls -R From 8b768d89a8bf22a95b32b6b6094350ea8e3fc5a3 Mon Sep 17 00:00:00 2001 From: Julian Nguyen <109386615+juliannguyen4@users.noreply.github.com> Date: Thu, 8 Jan 2026 14:19:54 -0800 Subject: [PATCH 25/48] Remove sanitizer for now. C client also needs to be built with libasan --- .github/workflows/build-c-client.yml | 1 - .github/workflows/build-python-client.yml | 15 --------------- .github/workflows/build.yml | 10 +++++----- 3 files changed, 5 insertions(+), 21 deletions(-) diff --git a/.github/workflows/build-c-client.yml b/.github/workflows/build-c-client.yml index 08e9cb58ab..8384ce0938 100644 --- a/.github/workflows/build-c-client.yml +++ b/.github/workflows/build-c-client.yml @@ -2,7 +2,6 @@ on: workflow_call: jobs: - # TODO: define a var for the same OS used in the other build job build-c-client: runs-on: ubuntu-22.04 steps: diff --git a/.github/workflows/build-python-client.yml b/.github/workflows/build-python-client.yml index 5f6f5102ff..c0ea4ee84f 100644 --- a/.github/workflows/build-python-client.yml +++ b/.github/workflows/build-python-client.yml @@ -7,13 +7,6 @@ jobs: strategy: matrix: py-version: ["3.9", "3.10", "3.11", "3.12", "3.13", "3.14"] - # Make sure we can build and run tests on an instrumented build that uses libasan - # We aren't necessarily checking for memory errors / leaks in this test - sanitizer: [false] - include: - - py-version: 3.9 - sanitizer: true - fail-fast: false steps: - uses: actions/checkout@v2 @@ -35,17 +28,12 @@ jobs: - name: Install build dependencies (pip packages) run: python3 -m pip install -r requirements.txt - - if: ${{ matrix.sanitizer }} - run: echo SANITIZER=1 >> $GITHUB_ENV - - uses: actions/cache/restore@v5 id: download-c-client with: key: c-client-${{ env.C_CLIENT_REVISION }} path: libaerospike.a - - run: ls -R - - name: Build client run: python3 -m build env: @@ -54,9 +42,6 @@ jobs: - run: echo WHEEL_GH_ARTIFACT_NAME=wheel-${{ matrix.py-version }} >> $GITHUB_ENV - - if: ${{ matrix.sanitizer }} - run: echo WHEEL_GH_ARTIFACT_NAME=${{ env.WHEEL_GH_ARTIFACT_NAME }}-sanitizer >> $GITHUB_ENV - - name: Send wheel to test jobs uses: actions/upload-artifact@v4 with: diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 810d86a2a8..d1dd4364fc 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,14 +1,14 @@ on: pull_request: - # paths: - # - aerospike-client-c - # - src/** + paths: + - aerospike-client-c + - src/** workflow_dispatch: jobs: - build-c-client: + build-c-client-submodule: uses: ./.github/workflows/build-c-client.yml build-python-client: - needs: build-c-client + needs: build-c-client-submodule uses: ./.github/workflows/build-python-client.yml From acb7e54e332a4574a33d4b98fcbf7687f89f223e Mon Sep 17 00:00:00 2001 From: Julian Nguyen <109386615+juliannguyen4@users.noreply.github.com> Date: Fri, 16 Jan 2026 15:07:38 -0800 Subject: [PATCH 26/48] Move C client build job into smoke tests workflow since its harder to control when to run the C client build workflow and also trigger the python client build afterward --- .github/workflows/build-c-client.yml | 29 ------------------------ .github/workflows/build.yml | 14 ------------ .github/workflows/smoke-tests.yml | 33 +++++++++++++++------------- 3 files changed, 18 insertions(+), 58 deletions(-) delete mode 100644 .github/workflows/build-c-client.yml delete mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build-c-client.yml b/.github/workflows/build-c-client.yml deleted file mode 100644 index 8384ce0938..0000000000 --- a/.github/workflows/build-c-client.yml +++ /dev/null @@ -1,29 +0,0 @@ -on: - workflow_call: - -jobs: - build-c-client: - runs-on: ubuntu-22.04 - steps: - - uses: actions/checkout@v4 - with: - submodules: recursive - sparse-checkout: | - aerospike-client-c - - - run: echo C_CLIENT_REVISION=$(git rev-parse HEAD) >> $GITHUB_ENV - working-directory: aerospike-client-c - - - uses: actions/cache@v5 - id: download-c-client - with: - key: c-client-${{ env.C_CLIENT_REVISION }} - path: ./aerospike-client-c/target/Linux-x86_64/lib/libaerospike.a - - - name: Install C client build dependencies - if: ${{ steps.download-c-client.outputs.cache-hit != 'true' }} - run: | - sudo apt update && - sudo apt-get install -y libc6-dev libssl-dev autoconf automake libtool g++ zlib1g-dev ncurses-dev && - make build - working-directory: aerospike-client-c diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml deleted file mode 100644 index d1dd4364fc..0000000000 --- a/.github/workflows/build.yml +++ /dev/null @@ -1,14 +0,0 @@ -on: - pull_request: - paths: - - aerospike-client-c - - src/** - workflow_dispatch: - -jobs: - build-c-client-submodule: - uses: ./.github/workflows/build-c-client.yml - - build-python-client: - needs: build-c-client-submodule - uses: ./.github/workflows/build-python-client.yml diff --git a/.github/workflows/smoke-tests.yml b/.github/workflows/smoke-tests.yml index 6e545c6aa0..975268a33c 100644 --- a/.github/workflows/smoke-tests.yml +++ b/.github/workflows/smoke-tests.yml @@ -40,31 +40,31 @@ on: required: true jobs: - # TODO: check if C client was already built for current submodule revision - # TODO: define a var for the same OS used in the other build job build-c-client: runs-on: ubuntu-22.04 steps: - - run: sudo apt update - - name: Install C client build dependencies - run: sudo apt-get install -y libc6-dev libssl-dev autoconf automake libtool g++ zlib1g-dev ncurses-dev - - uses: actions/checkout@v4 with: submodules: recursive sparse-checkout: | aerospike-client-c - - run: make build + - run: echo C_CLIENT_REVISION=$(git rev-parse HEAD) >> $GITHUB_ENV working-directory: aerospike-client-c - - name: Send C client static library to job that builds Python client - uses: actions/upload-artifact@v4 + - uses: actions/cache@v5 + id: download-c-client with: - name: c-client - # TODO: not the precise folder + key: c-client-${{ env.C_CLIENT_REVISION }} path: ./aerospike-client-c/target/Linux-x86_64/lib/libaerospike.a - if-no-files-found: error + + - name: Install C client build dependencies + if: ${{ steps.download-c-client.outputs.cache-hit != 'true' }} + run: | + sudo apt update && + sudo apt-get install -y libc6-dev libssl-dev autoconf automake libtool g++ zlib1g-dev ncurses-dev && + make build + working-directory: aerospike-client-c build: needs: build-c-client @@ -106,10 +106,13 @@ jobs: - if: ${{ matrix.sanitizer }} run: echo SANITIZER=1 >> $GITHUB_ENV - - uses: actions/download-artifact@v4 - id: get-c-client + - run: echo C_CLIENT_REVISION=$(git rev-parse HEAD) >> $GITHUB_ENV + working-directory: aerospike-client-c + + - uses: actions/cache/restore@v5 with: - name: c-client + key: c-client-${{ env.C_CLIENT_REVISION }} + path: libaerospike.a - run: ls -R From 069bafb1721819a7134f2645362e74e02b9a86ee Mon Sep 17 00:00:00 2001 From: Julian Nguyen <109386615+juliannguyen4@users.noreply.github.com> Date: Fri, 16 Jan 2026 15:08:02 -0800 Subject: [PATCH 27/48] Remove --- .github/workflows/build-python-client.yml | 49 ----------------------- 1 file changed, 49 deletions(-) delete mode 100644 .github/workflows/build-python-client.yml diff --git a/.github/workflows/build-python-client.yml b/.github/workflows/build-python-client.yml deleted file mode 100644 index c0ea4ee84f..0000000000 --- a/.github/workflows/build-python-client.yml +++ /dev/null @@ -1,49 +0,0 @@ -on: - workflow_call: - -jobs: - build-python-client: - runs-on: ubuntu-22.04 - strategy: - matrix: - py-version: ["3.9", "3.10", "3.11", "3.12", "3.13", "3.14"] - - steps: - - uses: actions/checkout@v2 - with: - submodules: recursive - fetch-depth: 0 - - - run: echo C_CLIENT_REVISION=$(git submodule status | awk '{print $1}') >> $GITHUB_ENV - - - uses: actions/setup-python@v5 - with: - python-version: ${{ matrix.py-version }} - architecture: 'x64' - allow-prereleases: true - - - run: sudo apt update - - name: Install build dependencies (apt packages) - run: sudo apt install python3-dev libssl-dev -y - - name: Install build dependencies (pip packages) - run: python3 -m pip install -r requirements.txt - - - uses: actions/cache/restore@v5 - id: download-c-client - with: - key: c-client-${{ env.C_CLIENT_REVISION }} - path: libaerospike.a - - - name: Build client - run: python3 -m build - env: - CFLAGS: '-Werror' - C_CLIENT_SHARED_PATH: ./libaerospike.a - - - run: echo WHEEL_GH_ARTIFACT_NAME=wheel-${{ matrix.py-version }} >> $GITHUB_ENV - - - name: Send wheel to test jobs - uses: actions/upload-artifact@v4 - with: - name: ${{ env.WHEEL_GH_ARTIFACT_NAME }} - path: ./dist/*.whl From 3a60f6eeee444e44a8108d9b8e27cf0091bb50e9 Mon Sep 17 00:00:00 2001 From: Julian Nguyen <109386615+juliannguyen4@users.noreply.github.com> Date: Fri, 16 Jan 2026 15:13:26 -0800 Subject: [PATCH 28/48] This step should fail --- .github/workflows/smoke-tests.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/smoke-tests.yml b/.github/workflows/smoke-tests.yml index 975268a33c..773b44ad83 100644 --- a/.github/workflows/smoke-tests.yml +++ b/.github/workflows/smoke-tests.yml @@ -113,6 +113,7 @@ jobs: with: key: c-client-${{ env.C_CLIENT_REVISION }} path: libaerospike.a + fail-on-cache-miss: true - run: ls -R From 78bf1ebb8fb68bceeda762e8264d634e180c22f7 Mon Sep 17 00:00:00 2001 From: Julian Nguyen <109386615+juliannguyen4@users.noreply.github.com> Date: Fri, 16 Jan 2026 15:20:29 -0800 Subject: [PATCH 29/48] Assuming libaerospike.a will be restored in cwd --- .github/workflows/smoke-tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/smoke-tests.yml b/.github/workflows/smoke-tests.yml index 773b44ad83..5444ba1ff9 100644 --- a/.github/workflows/smoke-tests.yml +++ b/.github/workflows/smoke-tests.yml @@ -112,7 +112,7 @@ jobs: - uses: actions/cache/restore@v5 with: key: c-client-${{ env.C_CLIENT_REVISION }} - path: libaerospike.a + path: ./aerospike-client-c/target/Linux-x86_64/lib/libaerospike.a fail-on-cache-miss: true - run: ls -R From 756c4372288ad40f1f9446c0f1b79b45acd4a52f Mon Sep 17 00:00:00 2001 From: Julian Nguyen <109386615+juliannguyen4@users.noreply.github.com> Date: Fri, 16 Jan 2026 15:21:32 -0800 Subject: [PATCH 30/48] get prereqs for building python client further up the job --- .github/workflows/smoke-tests.yml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/smoke-tests.yml b/.github/workflows/smoke-tests.yml index 5444ba1ff9..d4f3fbddfa 100644 --- a/.github/workflows/smoke-tests.yml +++ b/.github/workflows/smoke-tests.yml @@ -91,6 +91,15 @@ jobs: submodules: recursive fetch-depth: 0 + - run: echo C_CLIENT_REVISION=$(git rev-parse HEAD) >> $GITHUB_ENV + working-directory: aerospike-client-c + + - uses: actions/cache/restore@v5 + with: + key: c-client-${{ env.C_CLIENT_REVISION }} + path: ./aerospike-client-c/target/Linux-x86_64/lib/libaerospike.a + fail-on-cache-miss: true + - uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0 with: python-version: ${{ matrix.py-version }} @@ -106,15 +115,6 @@ jobs: - if: ${{ matrix.sanitizer }} run: echo SANITIZER=1 >> $GITHUB_ENV - - run: echo C_CLIENT_REVISION=$(git rev-parse HEAD) >> $GITHUB_ENV - working-directory: aerospike-client-c - - - uses: actions/cache/restore@v5 - with: - key: c-client-${{ env.C_CLIENT_REVISION }} - path: ./aerospike-client-c/target/Linux-x86_64/lib/libaerospike.a - fail-on-cache-miss: true - - run: ls -R - name: Build client From 95e84de4944d9375f8231e2e0d877b64ca746c5f Mon Sep 17 00:00:00 2001 From: Julian Nguyen <109386615+juliannguyen4@users.noreply.github.com> Date: Fri, 16 Jan 2026 15:23:46 -0800 Subject: [PATCH 31/48] fix --- .github/workflows/smoke-tests.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/smoke-tests.yml b/.github/workflows/smoke-tests.yml index d4f3fbddfa..7e94eb1686 100644 --- a/.github/workflows/smoke-tests.yml +++ b/.github/workflows/smoke-tests.yml @@ -100,6 +100,8 @@ jobs: path: ./aerospike-client-c/target/Linux-x86_64/lib/libaerospike.a fail-on-cache-miss: true + - run: mv ./aerospike-client-c/target/Linux-x86_64/lib/libaerospike.a . + - uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0 with: python-version: ${{ matrix.py-version }} From 27adba5563656f628e40321d48e1cde76ecf5066 Mon Sep 17 00:00:00 2001 From: Julian Nguyen <109386615+juliannguyen4@users.noreply.github.com> Date: Fri, 16 Jan 2026 15:24:29 -0800 Subject: [PATCH 32/48] speed up --- .github/workflows/smoke-tests.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/smoke-tests.yml b/.github/workflows/smoke-tests.yml index 7e94eb1686..61be1f45d9 100644 --- a/.github/workflows/smoke-tests.yml +++ b/.github/workflows/smoke-tests.yml @@ -57,6 +57,7 @@ jobs: with: key: c-client-${{ env.C_CLIENT_REVISION }} path: ./aerospike-client-c/target/Linux-x86_64/lib/libaerospike.a + lookup-only: true - name: Install C client build dependencies if: ${{ steps.download-c-client.outputs.cache-hit != 'true' }} From 49132487f1ac663331313e8baeb3510a60c99c3a Mon Sep 17 00:00:00 2001 From: Julian Nguyen <109386615+juliannguyen4@users.noreply.github.com> Date: Fri, 16 Jan 2026 15:28:56 -0800 Subject: [PATCH 33/48] fix --- .github/workflows/smoke-tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/smoke-tests.yml b/.github/workflows/smoke-tests.yml index 61be1f45d9..40329214c1 100644 --- a/.github/workflows/smoke-tests.yml +++ b/.github/workflows/smoke-tests.yml @@ -124,7 +124,7 @@ jobs: run: python3 -m build env: CFLAGS: '-Werror' - C_CLIENT_SHARED_PATH: 1 + C_CLIENT_SHARED_PATH: ./libaerospike.a - run: echo WHEEL_GH_ARTIFACT_NAME=wheel-${{ matrix.py-version }} >> $GITHUB_ENV From 76c346eba50db92549acd3568ab6023a81a4bb86 Mon Sep 17 00:00:00 2001 From: Julian Nguyen <109386615+juliannguyen4@users.noreply.github.com> Date: Fri, 16 Jan 2026 15:39:29 -0800 Subject: [PATCH 34/48] clean up --- .github/workflows/smoke-tests.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/smoke-tests.yml b/.github/workflows/smoke-tests.yml index 40329214c1..f9fe59262a 100644 --- a/.github/workflows/smoke-tests.yml +++ b/.github/workflows/smoke-tests.yml @@ -41,6 +41,8 @@ on: jobs: build-c-client: + outputs: + c-client-sha: ${{ steps.get-c-client-sha.outputs.sha }} runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v4 @@ -49,13 +51,14 @@ jobs: sparse-checkout: | aerospike-client-c - - run: echo C_CLIENT_REVISION=$(git rev-parse HEAD) >> $GITHUB_ENV + - id: get-c-client-sha + run: echo sha=$(git rev-parse HEAD) >> $GITHUB_OUTPUT working-directory: aerospike-client-c - uses: actions/cache@v5 id: download-c-client with: - key: c-client-${{ env.C_CLIENT_REVISION }} + key: c-client-${{ steps.get-c-client-sha.outputs.sha }} path: ./aerospike-client-c/target/Linux-x86_64/lib/libaerospike.a lookup-only: true @@ -92,12 +95,9 @@ jobs: submodules: recursive fetch-depth: 0 - - run: echo C_CLIENT_REVISION=$(git rev-parse HEAD) >> $GITHUB_ENV - working-directory: aerospike-client-c - - uses: actions/cache/restore@v5 with: - key: c-client-${{ env.C_CLIENT_REVISION }} + key: c-client-${{ needs.build-c-client.outputs.c-client-sha }} path: ./aerospike-client-c/target/Linux-x86_64/lib/libaerospike.a fail-on-cache-miss: true From e2f6fee2ee4ca449ffd56748315187017317f6ba Mon Sep 17 00:00:00 2001 From: Julian Nguyen <109386615+juliannguyen4@users.noreply.github.com> Date: Tue, 20 Jan 2026 16:16:57 -0800 Subject: [PATCH 35/48] Move libaerospike.a so we don't have to use full path for cache key --- .github/workflows/smoke-tests.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/smoke-tests.yml b/.github/workflows/smoke-tests.yml index f9fe59262a..7176cf7876 100644 --- a/.github/workflows/smoke-tests.yml +++ b/.github/workflows/smoke-tests.yml @@ -55,11 +55,13 @@ jobs: run: echo sha=$(git rev-parse HEAD) >> $GITHUB_OUTPUT working-directory: aerospike-client-c + - run: mv ./aerospike-client-c/target/Linux-x86_64/lib/libaerospike.a . + - uses: actions/cache@v5 id: download-c-client with: key: c-client-${{ steps.get-c-client-sha.outputs.sha }} - path: ./aerospike-client-c/target/Linux-x86_64/lib/libaerospike.a + path: ./libaerospike.a lookup-only: true - name: Install C client build dependencies @@ -98,11 +100,9 @@ jobs: - uses: actions/cache/restore@v5 with: key: c-client-${{ needs.build-c-client.outputs.c-client-sha }} - path: ./aerospike-client-c/target/Linux-x86_64/lib/libaerospike.a + path: ./libaerospike.a fail-on-cache-miss: true - - run: mv ./aerospike-client-c/target/Linux-x86_64/lib/libaerospike.a . - - uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0 with: python-version: ${{ matrix.py-version }} From 6cf65482e7ece3fe078de2d9b533d114371eda9d Mon Sep 17 00:00:00 2001 From: Julian Nguyen <109386615+juliannguyen4@users.noreply.github.com> Date: Tue, 20 Jan 2026 16:18:04 -0800 Subject: [PATCH 36/48] Rm debug step --- .github/workflows/smoke-tests.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/smoke-tests.yml b/.github/workflows/smoke-tests.yml index 7176cf7876..b7885b9d1f 100644 --- a/.github/workflows/smoke-tests.yml +++ b/.github/workflows/smoke-tests.yml @@ -118,8 +118,6 @@ jobs: - if: ${{ matrix.sanitizer }} run: echo SANITIZER=1 >> $GITHUB_ENV - - run: ls -R - - name: Build client run: python3 -m build env: From c7fd983459a16279105293f9ebfd5a3356fa2aa3 Mon Sep 17 00:00:00 2001 From: Julian Nguyen <109386615+juliannguyen4@users.noreply.github.com> Date: Tue, 20 Jan 2026 16:28:22 -0800 Subject: [PATCH 37/48] Rm unnecessary lines. I don't believe MANIFEST.in i.e the sdist should have libaerospike.a since we always require sdist users to build the c client from source. --- MANIFEST.in | 1 - setup.py | 1 - 2 files changed, 2 deletions(-) diff --git a/MANIFEST.in b/MANIFEST.in index 927a92de1e..0ecdb34904 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -8,4 +8,3 @@ include modules/aerospike-lua-core/src/*.lua global-include *.pyi global-include *.typed include custom-versionit-format.py -include libaerospike.a diff --git a/setup.py b/setup.py index 83d4cc7909..0c78cb15ba 100644 --- a/setup.py +++ b/setup.py @@ -64,7 +64,6 @@ ################################################################################ include_dirs = ['src/include'] + \ - [f'{AEROSPIKE_C_HOME}/src/include'] + \ [x for x in os.getenv('CPATH', '').split(':') if len(x) > 0] + \ ['/usr/local/opt/openssl/include'] + \ ['aerospike-client-c/modules/common/src/include'] From db483aad7e162b064915b76bc212046e90c67527 Mon Sep 17 00:00:00 2001 From: Julian Nguyen <109386615+juliannguyen4@users.noreply.github.com> Date: Tue, 20 Jan 2026 16:31:12 -0800 Subject: [PATCH 38/48] fix. --- .github/workflows/smoke-tests.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/smoke-tests.yml b/.github/workflows/smoke-tests.yml index b7885b9d1f..69c25881fc 100644 --- a/.github/workflows/smoke-tests.yml +++ b/.github/workflows/smoke-tests.yml @@ -55,8 +55,6 @@ jobs: run: echo sha=$(git rev-parse HEAD) >> $GITHUB_OUTPUT working-directory: aerospike-client-c - - run: mv ./aerospike-client-c/target/Linux-x86_64/lib/libaerospike.a . - - uses: actions/cache@v5 id: download-c-client with: @@ -70,7 +68,7 @@ jobs: sudo apt update && sudo apt-get install -y libc6-dev libssl-dev autoconf automake libtool g++ zlib1g-dev ncurses-dev && make build - working-directory: aerospike-client-c + - run: mv ./aerospike-client-c/target/Linux-x86_64/lib/libaerospike.a . build: needs: build-c-client From a48ae8587d00957d547acb9a2bd4b6fca34be063 Mon Sep 17 00:00:00 2001 From: Julian Nguyen <109386615+juliannguyen4@users.noreply.github.com> Date: Tue, 20 Jan 2026 16:33:40 -0800 Subject: [PATCH 39/48] fix... --- .github/workflows/smoke-tests.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/smoke-tests.yml b/.github/workflows/smoke-tests.yml index 69c25881fc..5641c3b896 100644 --- a/.github/workflows/smoke-tests.yml +++ b/.github/workflows/smoke-tests.yml @@ -65,9 +65,11 @@ jobs: - name: Install C client build dependencies if: ${{ steps.download-c-client.outputs.cache-hit != 'true' }} run: | - sudo apt update && + sudo apt-get update && sudo apt-get install -y libc6-dev libssl-dev autoconf automake libtool g++ zlib1g-dev ncurses-dev && make build + working-directory: aerospike-client-c + - run: mv ./aerospike-client-c/target/Linux-x86_64/lib/libaerospike.a . build: From 310a67ef094e9e0ba78ada8142d3e3a8aa71c3f4 Mon Sep 17 00:00:00 2001 From: Julian Nguyen <109386615+juliannguyen4@users.noreply.github.com> Date: Tue, 20 Jan 2026 16:42:28 -0800 Subject: [PATCH 40/48] Fix incorrect path... --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 0c78cb15ba..7018dce6b0 100644 --- a/setup.py +++ b/setup.py @@ -181,7 +181,7 @@ C_CLIENT_SHARED_PATH = os.getenv("C_CLIENT_SHARED_PATH") if not WINDOWS: - include_dirs.append(AEROSPIKE_C_TARGET + '/include') + include_dirs.append(AEROSPIKE_C_TARGET + '/src/include') if C_CLIENT_SHARED_PATH: extra_objects.append(C_CLIENT_SHARED_PATH) else: From fc0dfb870091df98b2b0c49361caae5f6fd564fc Mon Sep 17 00:00:00 2001 From: Julian Nguyen <109386615+juliannguyen4@users.noreply.github.com> Date: Fri, 23 Jan 2026 10:26:18 -0800 Subject: [PATCH 41/48] fix --- .github/workflows/smoke-tests.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/smoke-tests.yml b/.github/workflows/smoke-tests.yml index 5641c3b896..f706251528 100644 --- a/.github/workflows/smoke-tests.yml +++ b/.github/workflows/smoke-tests.yml @@ -67,11 +67,10 @@ jobs: run: | sudo apt-get update && sudo apt-get install -y libc6-dev libssl-dev autoconf automake libtool g++ zlib1g-dev ncurses-dev && - make build + make build && + mv ./target/Linux-x86_64/lib/libaerospike.a .. working-directory: aerospike-client-c - - run: mv ./aerospike-client-c/target/Linux-x86_64/lib/libaerospike.a . - build: needs: build-c-client runs-on: ubuntu-22.04 From cfdf8a84122a1a1803429cb0f5dd2fc598d3b15e Mon Sep 17 00:00:00 2001 From: Julian Nguyen <109386615+juliannguyen4@users.noreply.github.com> Date: Fri, 23 Jan 2026 10:31:51 -0800 Subject: [PATCH 42/48] Fix --- setup.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 7018dce6b0..13af7ee890 100644 --- a/setup.py +++ b/setup.py @@ -181,10 +181,12 @@ C_CLIENT_SHARED_PATH = os.getenv("C_CLIENT_SHARED_PATH") if not WINDOWS: - include_dirs.append(AEROSPIKE_C_TARGET + '/src/include') if C_CLIENT_SHARED_PATH: + # In this case, no headers will be installed in target directory. + include_dirs.append(AEROSPIKE_C_HOME + '/src/include') extra_objects.append(C_CLIENT_SHARED_PATH) else: + include_dirs.append(AEROSPIKE_C_TARGET + '/src/include') extra_objects = extra_objects + [ AEROSPIKE_C_TARGET + '/lib/libaerospike.a' ] From 802f647c4195406faea353ede18c9af65ba8f3ff Mon Sep 17 00:00:00 2001 From: Julian Nguyen <109386615+juliannguyen4@users.noreply.github.com> Date: Fri, 23 Jan 2026 10:52:28 -0800 Subject: [PATCH 43/48] Revert "Rm unnecessary lines. I don't believe MANIFEST.in i.e the sdist should have libaerospike.a since we always require sdist users to build the c client from source." This reverts commit c7fd983459a16279105293f9ebfd5a3356fa2aa3. This is ok since I believe MANIFEST.in doesn't raise an error if a file isn't present. --- MANIFEST.in | 1 + setup.py | 1 + 2 files changed, 2 insertions(+) diff --git a/MANIFEST.in b/MANIFEST.in index 0ecdb34904..927a92de1e 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -8,3 +8,4 @@ include modules/aerospike-lua-core/src/*.lua global-include *.pyi global-include *.typed include custom-versionit-format.py +include libaerospike.a diff --git a/setup.py b/setup.py index 13af7ee890..e1120dc669 100644 --- a/setup.py +++ b/setup.py @@ -64,6 +64,7 @@ ################################################################################ include_dirs = ['src/include'] + \ + [f'{AEROSPIKE_C_HOME}/src/include'] + \ [x for x in os.getenv('CPATH', '').split(':') if len(x) > 0] + \ ['/usr/local/opt/openssl/include'] + \ ['aerospike-client-c/modules/common/src/include'] From 582a0bfa0c421566c29105898104242d45ca87d2 Mon Sep 17 00:00:00 2001 From: Julian Nguyen <109386615+juliannguyen4@users.noreply.github.com> Date: Fri, 23 Jan 2026 11:32:15 -0800 Subject: [PATCH 44/48] Guessing that libaerospike.a got copied to user directory? --- .github/workflows/smoke-tests.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/smoke-tests.yml b/.github/workflows/smoke-tests.yml index f706251528..8abaa6df2a 100644 --- a/.github/workflows/smoke-tests.yml +++ b/.github/workflows/smoke-tests.yml @@ -102,6 +102,8 @@ jobs: path: ./libaerospike.a fail-on-cache-miss: true + - run: mv ../libaerospike.a . + - uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0 with: python-version: ${{ matrix.py-version }} From e5b34677b92ecccfd5aeccceebb86c4ceca2f400 Mon Sep 17 00:00:00 2001 From: Julian Nguyen <109386615+juliannguyen4@users.noreply.github.com> Date: Fri, 23 Jan 2026 11:41:28 -0800 Subject: [PATCH 45/48] Revert "Guessing that libaerospike.a got copied to user directory?" This reverts commit 582a0bfa0c421566c29105898104242d45ca87d2. --- .github/workflows/smoke-tests.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/smoke-tests.yml b/.github/workflows/smoke-tests.yml index 8abaa6df2a..f706251528 100644 --- a/.github/workflows/smoke-tests.yml +++ b/.github/workflows/smoke-tests.yml @@ -102,8 +102,6 @@ jobs: path: ./libaerospike.a fail-on-cache-miss: true - - run: mv ../libaerospike.a . - - uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0 with: python-version: ${{ matrix.py-version }} From fed4b252d1fb1bfd3afc4ef5aa1bbd5ef69c1503 Mon Sep 17 00:00:00 2001 From: Julian Nguyen <109386615+juliannguyen4@users.noreply.github.com> Date: Fri, 23 Jan 2026 13:19:08 -0800 Subject: [PATCH 46/48] Update LD_LIBRARY_PATH in setup.py --- MANIFEST.in | 1 - setup.py | 5 +++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/MANIFEST.in b/MANIFEST.in index 927a92de1e..0ecdb34904 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -8,4 +8,3 @@ include modules/aerospike-lua-core/src/*.lua global-include *.pyi global-include *.typed include custom-versionit-format.py -include libaerospike.a diff --git a/setup.py b/setup.py index e1120dc669..8240d7f7a6 100644 --- a/setup.py +++ b/setup.py @@ -29,6 +29,7 @@ import io import xml.etree.ElementTree as ET import glob +from pathlib import Path ################################################################################ # ENVIRONMENT VARIABLES @@ -186,6 +187,10 @@ # In this case, no headers will be installed in target directory. include_dirs.append(AEROSPIKE_C_HOME + '/src/include') extra_objects.append(C_CLIENT_SHARED_PATH) + # The C client isn't included in the sdist, so we need to explicitly tell linker to find it + # outside of the isolated build environment created by pypa/build + dir_containing_c_client_static_lib = Path(C_CLIENT_SHARED_PATH).parent.__str__ + library_dirs.append(dir_containing_c_client_static_lib) else: include_dirs.append(AEROSPIKE_C_TARGET + '/src/include') extra_objects = extra_objects + [ From 97a1e2c3b960672f9b391714dec7c75b858744b6 Mon Sep 17 00:00:00 2001 From: Julian Nguyen <109386615+juliannguyen4@users.noreply.github.com> Date: Fri, 23 Jan 2026 13:20:40 -0800 Subject: [PATCH 47/48] fix --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 8240d7f7a6..eec11e9395 100644 --- a/setup.py +++ b/setup.py @@ -189,7 +189,7 @@ extra_objects.append(C_CLIENT_SHARED_PATH) # The C client isn't included in the sdist, so we need to explicitly tell linker to find it # outside of the isolated build environment created by pypa/build - dir_containing_c_client_static_lib = Path(C_CLIENT_SHARED_PATH).parent.__str__ + dir_containing_c_client_static_lib = Path(C_CLIENT_SHARED_PATH).parent.__str__() library_dirs.append(dir_containing_c_client_static_lib) else: include_dirs.append(AEROSPIKE_C_TARGET + '/src/include') From 8b25450d6b181633c0b72e81ac42488b10184cd7 Mon Sep 17 00:00:00 2001 From: juliannguyen4 <109386615+juliannguyen4@users.noreply.github.com> Date: Fri, 23 Jan 2026 21:38:11 +0000 Subject: [PATCH 48/48] since python3 setup.py runs inside the isolated build folder, we need to pass in the absolute path of the c client static library for setup.py to find it accurately --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index eec11e9395..9d6e75d929 100644 --- a/setup.py +++ b/setup.py @@ -189,7 +189,7 @@ extra_objects.append(C_CLIENT_SHARED_PATH) # The C client isn't included in the sdist, so we need to explicitly tell linker to find it # outside of the isolated build environment created by pypa/build - dir_containing_c_client_static_lib = Path(C_CLIENT_SHARED_PATH).parent.__str__() + dir_containing_c_client_static_lib = os.path.dirname(os.path.abspath(C_CLIENT_SHARED_PATH)) library_dirs.append(dir_containing_c_client_static_lib) else: include_dirs.append(AEROSPIKE_C_TARGET + '/src/include')