Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: increase range of python FFI support #870

Merged
merged 23 commits into from
Aug 8, 2024
Merged
Show file tree
Hide file tree
Changes from 15 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 38 additions & 16 deletions .github/workflows/build-python-release.reusable.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ name: Release language_client_python

on:
workflow_call: {}
push:
branches: [sam/glibc-aarch64]

concurrency:
# suffix is important to prevent a concurrency deadlock with the calling workflow
Expand All @@ -14,28 +16,44 @@ jobs:
fail-fast: false
matrix:
_:
- runs_on: ubuntu-latest
- name: x86_64-unknown-linux-gnu
runs_on: ubuntu-latest
target: x86_64
name: x86_64-unknown-linux-gnu
manylinux: 'auto'

- runs_on: ubuntu-latest
- name: aarch64-unknown-linux-gnu
runs_on: ubuntu-latest
target: aarch64
name: aarch64-unknown-linux-gnu
manylinux: '2_28'
env:
# Workaround ring 0.17 build issue
# see https://github.com/briansmith/ring/issues/1728#issuecomment-1758180655
# see https://github.com/astral-sh/uv/pull/3444
CFLAGS_aarch64_unknown_linux_gnu: "-D__ARM_ARCH=8"

- runs_on: macos-latest
- name: x86_64-unknown-linux-musl
runs_on: ubuntu-latest
target: x86_64
name: x86_64-apple-darwin
# see https://github.com/astral-sh/uv/blob/9bb55c4ac0582e05d1a7a5bbd99cc7b2c82f1847/.github/workflows/build-binaries.yml#L594
manylinux: musllinux_1_1

- runs_on: macos-latest
- name: aarch64-unknown-linux-musl
runs_on: ubuntu-latest
target: aarch64
name: aarch64-apple-darwin
# see https://github.com/astral-sh/uv/blob/9bb55c4ac0582e05d1a7a5bbd99cc7b2c82f1847/.github/workflows/build-binaries.yml#L594
manylinux: musllinux_1_1

- runs_on: windows-latest
- name: x86_64-apple-darwin
runs_on: macos-latest
target: x86_64

- name: aarch64-apple-darwin
runs_on: macos-latest
target: aarch64

- name: x86_64-pc-windows-msvc
runs_on: windows-latest
target: x64
name: x86_64-pc-windows-msvc


name: ${{ matrix._.name }}
runs-on: ${{ matrix._.runs_on }}
steps:
- uses: actions/checkout@v4
Expand All @@ -46,23 +64,27 @@ jobs:

- name: Build wheels
uses: PyO3/maturin-action@v1
env: ${{ matrix._.env || fromJSON('{}') }}
with:
target: ${{ matrix._.target }}
command: build
args: --release --out engine/language_client_python/dist --manifest-path engine/language_client_python/Cargo.toml
# building in engine/ ensures that we pick up .cargo/config.toml
working-directory: engine
args: --release --out language_client_python/dist --manifest-path language_client_python/Cargo.toml
sccache: "true"
manylinux: ${{ matrix._.manylinux }}
before-script-linux: |
if command -v yum &> /dev/null; then
yum update -y && yum install -y perl-core openssl openssl-devel pkgconfig libatomic
else
# If we're running on debian-based system.
apt update -y && apt-get install -y libssl-dev openssl pkg-config
# sudo apt update -y && apt-get install -y libssl-dev openssl pkg-config
:
fi

- name: Upload wheels
uses: actions/upload-artifact@v4
with:
name: wheels-${{ matrix._.name }}
path: engine/language_client_python/dist
if-no-files-found: error
if-no-files-found: error
4 changes: 3 additions & 1 deletion engine/.cargo/config.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# https://github.com/rust-lang/cargo/issues/8607
[target.x86_64-unknown-linux-musl]
rustflags = ["-C", "target-feature=-crt-static"]
[target.aarch64-unknown-linux-musl]
linker = "aarch64-linux-musl-gcc"
rustflags = ["-C", "target-feature=-crt-static"]
Loading