Skip to content

Commit 9afe91b

Browse files
committed
Use Zig linker for glibc compatibility
1 parent 3b9ed95 commit 9afe91b

3 files changed

Lines changed: 141 additions & 3 deletions

File tree

.github/workflows/build-and-test.yml

Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,3 +144,117 @@ jobs:
144144
cd python
145145
uv run dev/lint-python
146146
uv run dev/pytest
147+
148+
python-release-build:
149+
runs-on: ubuntu-24.04
150+
steps:
151+
- name: Checkout repository
152+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
153+
- name: Install Python and uv
154+
uses: astral-sh/setup-uv@cec208311dfd045dd5311c1add060b2062131d57 # v8.0.0
155+
with:
156+
python-version: "3.10"
157+
- name: Install twine
158+
run: uv tool install twine
159+
- name: Build delta-sharing package
160+
run: |
161+
cd python
162+
uv build
163+
- name: Build delta-kernel-rust-sharing-wrapper distribution
164+
uses: PyO3/maturin-action@86b9d133d34bc1b40018696f782949dac11bd380 # v1.49.4
165+
with:
166+
command: build
167+
maturin-version: v1.12.6
168+
manylinux: 2014
169+
working-directory: python
170+
# The manylinux2014 container has perl but omits some core modules
171+
# that vendored OpenSSL's Configure script requires.
172+
before-script-linux: yum install -y perl-core
173+
args: >-
174+
--manifest-path delta-kernel-rust-sharing-wrapper/Cargo.toml
175+
--release
176+
--sdist
177+
-i python3.10
178+
- name: Check built distributions
179+
run: |
180+
cd python
181+
uv run twine check --strict dist/*
182+
uv run twine check --strict delta-kernel-rust-sharing-wrapper/target/wheels/*
183+
- name: Upload distributions
184+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
185+
with:
186+
name: python-release-distributions
187+
path: |
188+
python/dist/*
189+
python/delta-kernel-rust-sharing-wrapper/target/wheels/*
190+
if-no-files-found: error
191+
192+
# Install the wheels built by python-release-build on an older Ubuntu image
193+
# so we catch glibc / shared-library regressions that ubuntu-24.04 would
194+
# otherwise hide.
195+
python-release-test:
196+
needs: python-release-build
197+
runs-on: ubuntu-22.04
198+
env:
199+
SPARK_LOCAL_IP: localhost
200+
GOOGLE_APPLICATION_CREDENTIALS: /tmp/google_service_account_key.json
201+
steps:
202+
- name: Checkout repository
203+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
204+
- name: Cache Scala, SBT
205+
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
206+
with:
207+
path: |
208+
~/.sbt
209+
~/.ivy2
210+
~/.cache/coursier
211+
key: build-and-test-python-release-test
212+
- name: Install Java 8
213+
uses: actions/setup-java@c1e323688fd81a25caa38c78aa6df2d33d3e20d9 # v4.8.0
214+
with:
215+
distribution: 'zulu'
216+
java-version: '8'
217+
- name: Install Python and uv
218+
uses: astral-sh/setup-uv@cec208311dfd045dd5311c1add060b2062131d57 # v8.0.0
219+
with:
220+
python-version: "3.10"
221+
- name: Download built wheels
222+
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
223+
with:
224+
name: python-release-distributions
225+
path: built-wheels/
226+
- name: Install built wheels into a fresh venv
227+
run: |
228+
set -euo pipefail
229+
shopt -s failglob
230+
uv venv /tmp/release-venv --python 3.10
231+
# actions/upload-artifact@v4 collapses the LCA, so paths inside the
232+
# artifact start at `dist/` and `delta-kernel-rust-sharing-wrapper/`,
233+
# not `python/dist/` and `python/delta-kernel-rust-sharing-wrapper/`.
234+
uv pip install --python /tmp/release-venv/bin/python \
235+
built-wheels/delta-kernel-rust-sharing-wrapper/target/wheels/*.whl \
236+
built-wheels/dist/*.whl \
237+
pytest
238+
# The published wheel intentionally excludes delta_sharing.tests, but
239+
# the test files import from `delta_sharing.tests.conftest`. Copy the
240+
# tests subpackage into the installed location so the import works.
241+
site_packages=$(/tmp/release-venv/bin/python -c "import sysconfig; print(sysconfig.get_paths()['purelib'])")
242+
cp -r python/delta_sharing/tests "$site_packages/delta_sharing/tests"
243+
# Rename the source package so it does not shadow the installed wheel
244+
# when pytest runs from python/ (cwd is needed for the sbt server fixture).
245+
mv python/delta_sharing python/delta_sharing.src
246+
- name: Build Server
247+
run: ./build/sbt package
248+
- name: Run tests against installed wheels
249+
env:
250+
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
251+
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
252+
AZURE_TEST_ACCOUNT_KEY: ${{ secrets.AZURE_TEST_ACCOUNT_KEY }}
253+
GOOGLE_SERVICE_ACCOUNT_KEY: ${{ secrets.GOOGLE_SERVICE_ACCOUNT_KEY }}
254+
run: |
255+
cd python
256+
/tmp/release-venv/bin/python -m pytest \
257+
--verbose --showlocals --color=yes \
258+
--doctest-modules --pyargs delta_sharing \
259+
--ignore-glob='*/_yarl_patch.py' \
260+
-o log_cli=true -s

python/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ dev = [
5959
"flake8<=7.3.0",
6060
"black==26.3.1",
6161
"pytest<=9.0.3",
62-
"maturin<=1.12.6",
62+
"maturin[zig]<=1.12.6",
6363
"types-requests<=2.32.0.20260311",
6464
"setuptools>=64",
6565
"packaging",

python/uv.lock

Lines changed: 26 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)