Skip to content

Commit

Permalink
win, musl, macOS 15 artifact jobs
Browse files Browse the repository at this point in the history
  • Loading branch information
ijl committed Nov 23, 2024
1 parent 8ece0d4 commit b4ae388
Show file tree
Hide file tree
Showing 10 changed files with 124 additions and 311 deletions.
148 changes: 120 additions & 28 deletions .github/workflows/artifact.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ jobs:

sdist:
runs-on: ubuntu-22.04
timeout-minutes: 10
strategy:
fail-fast: false
env:
Expand Down Expand Up @@ -77,25 +78,25 @@ jobs:
{
cc: "clang",
cflags: "-Os -fstrict-aliasing -fno-plt -flto=full -emit-llvm",
features: "avx512,no-panic,unstable-simd,yyjson",
features: "avx512,unstable-simd,yyjson",
ldflags: "-fuse-ld=lld -Wl,-plugin-opt=also-emit-llvm -Wl,--as-needed -Wl,-zrelro,-znow",
rustflags: "-C linker=clang -C link-arg=-fuse-ld=lld -C linker-plugin-lto -C lto=fat -C link-arg=-Wl,-zrelro,-znow -Z mir-opt-level=4 -Z threads=4 -D warnings",
tag: null,
target: "x86_64-unknown-linux-gnu",
},
]
env:
PYTHON: "${{ matrix.python.interpreter }}"
PYTHON_PACKAGE: "${{ matrix.python.package }}"
TARGET: "${{ matrix.arch.target }}"
CARGO_TARGET_DIR: "/tmp/orjson"
CC: "${{ matrix.arch.cc }}"
VENV: ".venv"
FEATURES: "${{ matrix.arch.features }}"
CFLAGS: "${{ matrix.arch.cflags }}"
COMPATIBILITY: "${{ matrix.python.compatibility }}"
FEATURES: "${{ matrix.arch.features }}"
LDFLAGS: "${{ matrix.arch.ldflags }}"
PYTHON: "${{ matrix.python.interpreter }}"
PYTHON_PACKAGE: "${{ matrix.python.package }}"
RUSTFLAGS: "${{ matrix.arch.rustflags }}"
CARGO_TARGET_DIR: "/tmp/orjson"
COMPATIBILITY: "${{ matrix.python.compatibility }}"
TARGET: "${{ matrix.arch.target }}"
VENV: ".venv"
steps:

- name: cpuinfo
Expand Down Expand Up @@ -167,25 +168,25 @@ jobs:
{
cc: "clang",
cflags: "-Os -fstrict-aliasing -fno-plt -flto=full -emit-llvm",
features: "no-panic,unstable-simd,yyjson",
features: "unstable-simd,yyjson",
ldflags: "-fuse-ld=lld -Wl,-plugin-opt=also-emit-llvm -Wl,--as-needed -Wl,-zrelro,-znow",
rustflags: "-C linker=clang -C link-arg=-fuse-ld=lld -C linker-plugin-lto -C lto=fat -C link-arg=-Wl,-zrelro,-znow -Z mir-opt-level=4 -Z threads=4 -D warnings",
tag: "aarch64",
target: "aarch64-unknown-linux-gnu",
},
]
env:
PYTHON: "${{ matrix.python.interpreter }}"
PYTHON_PACKAGE: "${{ matrix.python.package }}"
TARGET: "${{ matrix.arch.target }}"
CARGO_TARGET_DIR: "/tmp/orjson"
CC: "${{ matrix.arch.cc }}"
VENV: ".venv"
FEATURES: "${{ matrix.arch.features }}"
CFLAGS: "${{ matrix.arch.cflags }}"
COMPATIBILITY: "${{ matrix.python.compatibility }}"
FEATURES: "${{ matrix.arch.features }}"
LDFLAGS: "${{ matrix.arch.ldflags }}"
PYTHON: "${{ matrix.python.interpreter }}"
PYTHON_PACKAGE: "${{ matrix.python.package }}"
RUSTFLAGS: "${{ matrix.arch.rustflags }}"
CARGO_TARGET_DIR: "/tmp/orjson"
COMPATIBILITY: "${{ matrix.python.compatibility }}"
TARGET: "${{ matrix.arch.target }}"
VENV: ".venv"
steps:

- name: cpuinfo
Expand Down Expand Up @@ -241,6 +242,7 @@ jobs:

musllinux:
runs-on: ubuntu-24.04
timeout-minutes: 10
strategy:
fail-fast: false
matrix:
Expand All @@ -256,11 +258,19 @@ jobs:
- target: aarch64-unknown-linux-musl
arch: aarch64
platform: linux/arm64
features: no-panic,unstable-simd,unwind,yyjson
features: unstable-simd,unwind,yyjson
- target: armv7-unknown-linux-gnueabihf
arch: armv7l
platform: linux/amd64
features: unstable-simd,unwind,yyjson
- target: x86_64-unknown-linux-musl
arch: x86_64
platform: linux/amd64
features: avx512,no-panic,unstable-simd,unwind,yyjson
features: avx512,unstable-simd,unwind,yyjson
- target: i686-unknown-linux-musl
arch: i686
platform: linux/amd64
features: unstable-simd,unwind,yyjson
steps:
- uses: actions/checkout@v4

Expand Down Expand Up @@ -317,6 +327,7 @@ jobs:

manylinux_non_amd64:
runs-on: ubuntu-24.04
timeout-minutes: 20
strategy:
fail-fast: false
matrix:
Expand All @@ -331,28 +342,35 @@ jobs:
{
arch: 'aarch64',
cflags: '-Os -flto=full -fstrict-aliasing',
features: 'no-panic,unstable-simd,yyjson',
features: 'unstable-simd,yyjson',
rustflags: '-Z mir-opt-level=4 -C lto=fat -D warnings',
target: 'aarch64-unknown-linux-gnu',
},
{
arch: 'i686',
cflags: '-Os -flto -fstrict-aliasing',
features: 'unstable-simd,yyjson',
rustflags: '-Z mir-opt-level=4 -C lto=fat -D warnings',
target: 'i686-unknown-linux-gnu',
},
{
arch: 'armv7',
cflags: '-Os -flto=full -fstrict-aliasing',
features: 'no-panic,yyjson', # no SIMD
features: 'yyjson', # no SIMD
rustflags: '-Z mir-opt-level=4 -C lto=fat -D warnings -C opt-level=s',
target: 'armv7-unknown-linux-gnueabihf',
},
{
arch: 'ppc64le',
cflags: '-Os -flto=full -fstrict-aliasing',
features: 'no-panic,unstable-simd,yyjson',
features: 'unstable-simd,yyjson',
rustflags: '-Z mir-opt-level=4 -C lto=fat -D warnings',
target: 'powerpc64le-unknown-linux-gnu',
},
{
arch: 's390x',
cflags: '-Os -flto=full -fstrict-aliasing -march=z10',
features: 'no-panic,yyjson',
features: 'yyjson',
rustflags: '-Z mir-opt-level=4 -C lto=fat -D warnings -C target-cpu=z10',
target: 's390x-unknown-linux-gnu',
},
Expand Down Expand Up @@ -389,7 +407,8 @@ jobs:
retention-days: 1

macos_aarch64:
runs-on: macos-14
runs-on: macos-15
timeout-minutes: 10
strategy:
fail-fast: false
matrix:
Expand All @@ -414,7 +433,6 @@ jobs:
- uses: actions/setup-python@v5
with:
python-version: "${{ matrix.python.version }}"
allow-prereleases: true

- uses: dtolnay/rust-toolchain@master
with:
Expand All @@ -426,6 +444,8 @@ jobs:
run: |
cargo fetch --target aarch64-apple-darwin &
export PATH=$HOME/.cargo/bin:$HOME/.local/bin:$PATH
curl -LsSf https://astral.sh/uv/install.sh | sh
uv venv --python python${{ matrix.python.version }}
uv pip install --upgrade "maturin>=1,<2" -r test/requirements.txt -r integration/requirements.txt
Expand All @@ -435,11 +455,12 @@ jobs:
- name: maturin
run: |
PATH=$HOME/.cargo/bin:$PATH \
export PATH=$HOME/.cargo/bin:$HOME/.local/bin:$PATH
MACOSX_DEPLOYMENT_TARGET="${{ matrix.python.macosx_target }}" \
PYO3_CROSS_LIB_DIR=$(python -c "import sysconfig;print(sysconfig.get_config_var('LIBDIR'))") \
maturin build --release --strip \
--features=no-panic,unstable-simd,yyjson \
--features=unstable-simd,yyjson \
--interpreter python${{ matrix.python.version }} \
--target=universal2-apple-darwin
uv pip install target/wheels/orjson*.whl
Expand All @@ -463,6 +484,7 @@ jobs:

macos_amd64:
runs-on: macos-13
timeout-minutes: 10
strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -496,6 +518,8 @@ jobs:
run: |
cargo fetch --target aarch64-apple-darwin &
export PATH=$HOME/.cargo/bin:$HOME/.local/bin:$PATH
curl -LsSf https://astral.sh/uv/install.sh | sh
uv venv --python python${{ matrix.python.version }}
uv pip install --upgrade "maturin>=1,<2" -r test/requirements.txt -r integration/requirements.txt
Expand All @@ -505,11 +529,12 @@ jobs:
- name: maturin
run: |
PATH=$HOME/.cargo/bin:$PATH \
export PATH=$HOME/.cargo/bin:$HOME/.local/bin:$PATH
MACOSX_DEPLOYMENT_TARGET="${{ matrix.python.macosx_target }}" \
PYO3_CROSS_LIB_DIR=$(python -c "import sysconfig;print(sysconfig.get_config_var('LIBDIR'))") \
maturin build --release --strip \
--features=no-panic,unstable-simd,yyjson \
--features=unstable-simd,yyjson \
--interpreter python${{ matrix.python.version }} \
--target=universal2-apple-darwin
uv pip install target/wheels/orjson*.whl
Expand All @@ -531,9 +556,75 @@ jobs:
overwrite: true
retention-days: 1

windows:
runs-on: windows-2022
timeout-minutes: 10
strategy:
fail-fast: false
matrix:
python: [
{ version: '3.13' },
{ version: '3.12' },
{ version: '3.11' },
{ version: '3.10' },
{ version: '3.9' },
{ version: '3.8' },
]
platform: [
{ arch: "x64", target: "x86_64-pc-windows-msvc" },
{ arch: "x86", target: "i686-pc-windows-msvc" },
]
env:
CFLAGS: "-Os"
LDFLAGS: "-Wl,--as-needed"
RUSTFLAGS: "-C lto=fat -Z mir-opt-level=4 -D warnings"
steps:

- uses: actions/checkout@v4

- uses: actions/setup-python@v5
with:
python-version: "${{ matrix.python.version }}"
architecture: "${{ matrix.platform.arch }}"

- uses: dtolnay/rust-toolchain@master
with:
toolchain: "${{ env.RUST_TOOLCHAIN }}"
targets: "${{ matrix.platform.target }}"
components: "rust-src"

- name: Build environment
run: |
cargo fetch --target "${{ matrix.platform.target }}" &
python.exe -m pip install --upgrade pip "maturin>=1,<2" wheel
python.exe -m pip install -r test\requirements.txt -r integration\requirements.txt
mkdir .cargo
cp ci\config.toml .cargo\config.toml
- name: maturin
run: |
maturin.exe build --release --strip --features=unstable-simd,yyjson --target="${{ matrix.platform.target }}"
python.exe -m pip install orjson --no-index --find-links target\wheels
- run: python.exe -m pytest -s -rxX -v test
env:
PYTHONMALLOC: "debug"

- name: Store wheels
if: "startsWith(github.ref, 'refs/tags/')"
uses: actions/upload-artifact@v4
with:
name: orjson_windows_${{ matrix.platform.arch }}_${{ matrix.python.version }}
path: target\wheels
overwrite: true
retention-days: 1

pypi:
name: PyPI
runs-on: ubuntu-24.04
timeout-minutes: 10
if: "startsWith(github.ref, 'refs/tags/')"
needs: [
macos_aarch64,
Expand All @@ -543,6 +634,7 @@ jobs:
manylinux_non_amd64,
musllinux,
sdist,
windows,
]
environment:
name: pypi
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/debug.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ jobs:
profile: [
{ rust: "1.72", features: "" },
{ rust: "1.72", features: "--features=yyjson" },
{ rust: "nightly-2024-09-25", features: "--features=yyjson,unstable-simd" },
{ rust: "nightly-2024-09-25", features: "--features=avx512,yyjson,unstable-simd" },
]
python: [
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/stale.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
stale:
runs-on: ubuntu-latest
steps:
- uses: actions/stale@v8
- uses: actions/stale@v9
with:
days-before-stale: 7
days-before-close: 1
17 changes: 0 additions & 17 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 0 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,6 @@ unstable-simd = []
# Include runtime-detected functions that use AVX512VL. Requires unstable-simd and amd64.
avx512 = []

no-panic = [
"itoa/no-panic",
"ryu/no-panic",
]

# Avoid bundling libgcc on musl.
unwind = ["unwinding"]

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ file-like objects

orjson supports CPython 3.8, 3.9, 3.10, 3.11, 3.12, 3.13, and 3.14.

It distributes amd64/x86_64, aarch64/armv8, arm7, POWER/ppc64le, and s390x
wheels for Linux, amd64 and aarch64 wheels for macOS, and amd64
It distributes amd64/x86_64, i686/x86, aarch64/armv8, arm7, POWER/ppc64le,
and s390x wheels for Linux, amd64 and aarch64 wheels for macOS, and amd64
and i686/x86 wheels for Windows.

orjson does not and will not support PyPy, embedded Python builds for
Expand Down
Loading

0 comments on commit b4ae388

Please sign in to comment.