Skip to content

Commit

Permalink
Build maintenance, python-source
Browse files Browse the repository at this point in the history
  • Loading branch information
ijl committed Jan 4, 2023
1 parent 45ad4a4 commit 57497ff
Show file tree
Hide file tree
Showing 19 changed files with 343 additions and 502 deletions.
31 changes: 18 additions & 13 deletions .github/workflows/linux-cross.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,25 +19,30 @@ jobs:
{ version: '3.11', abi: 'cp311-cp311' },
]
target: [
armv7,
aarch64,
{ arch: 'armv7', flags: '--features=yyjson -Z build-std=std,panic_abort -Z build-std-features=panic_immediate_abort' },
{ arch: 'aarch64', flags: '--features=yyjson' }, # build-std: aarch64-linux-gnu.so: undefined symbol: __aarch64_swp4_rel, likely QEMU?
]
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Build Wheels
uses: messense/maturin-action@v1
uses: PyO3/maturin-action@v1
env:
PYO3_CROSS_LIB_DIR: /opt/python/${{ matrix.python.abi }}
PYO3_CROSS_LIB_DIR: "/opt/python/${{ matrix.python.abi }}"
CC: "gcc"
CFLAGS: "-O2 -fno-plt"
LDFLAGS: "-O2 -flto -Wl,--as-needed"
CARGO_UNSTABLE_SPARSE_REGISTRY: "true"
with:
maturin-version: v0.14.1
target: ${{ matrix.target }}
rust-toolchain: nightly-2022-11-20
maturin-version: v0.14.8
target: ${{ matrix.target.arch }}
rust-toolchain: nightly-2023-01-03
rustup-components: rust-src
manylinux: auto
args: -i python3.9 --release --strip --out dist
args: --release --strip --out dist -i python${{ matrix.python.version }} ${{ matrix.target.flags }}
- uses: uraimo/run-on-arch-action@v2
name: Install built wheel
with:
arch: ${{ matrix.target }}
arch: ${{ matrix.target.arch }}
distro: ubuntu20.04
githubToken: ${{ github.token }}
install: |
Expand All @@ -54,7 +59,7 @@ jobs:
venv/bin/pip install orjson --no-index --find-links dist/ --force-reinstall
venv/bin/python -m pytest -s -rxX -v test
- name: Upload wheels
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: wheels
path: dist
Expand All @@ -65,10 +70,10 @@ jobs:
if: "startsWith(github.ref, 'refs/tags/')"
needs: [ linux-cross ]
steps:
- uses: actions/download-artifact@v2
- uses: actions/download-artifact@v3
with:
name: wheels
- uses: actions/setup-python@v2
- uses: actions/setup-python@v4
with:
python-version: "3.10"
- run: pip install "maturin>=0.14,<0.15"
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/manylinux2014.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@ jobs:
env:
PATH: /github/home/.local/bin:/github/home/.cargo/bin:/opt/python/${{ matrix.python.abi }}/bin:/opt/rh/devtoolset-10/root/usr/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
CC: "gcc"
CFLAGS: "-O2 -fno-plt -flto"
CFLAGS: "-O2 -fno-plt"
LDFLAGS: "-O2 -flto -Wl,--as-needed"
CARGO_UNSTABLE_SPARSE_REGISTRY: "true"
container:
image: quay.io/pypa/manylinux2014_x86_64:latest
options: --user 0
steps:
- run: curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain nightly-2022-11-20 --profile minimal -y
- uses: actions/checkout@v2
- run: curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain nightly-2023-01-03 --profile minimal -y
- uses: actions/checkout@v3
- run: python3 -m pip install --user --upgrade pip "maturin>=0.14,<0.15" wheel
- run: maturin build --release --strip --features=unstable-simd,yyjson --compatibility manylinux2014 --interpreter python${{ matrix.python.version }}
- run: python3 -m pip install --user target/wheels/orjson*.whl
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/manylinux_2_28.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ jobs:
options: --user 0
steps:
- run: yum install -y clang lld
- run: curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain nightly-2022-11-20 --profile minimal -y
- run: rustup component add rust-src --toolchain nightly-2022-11-20-x86_64-unknown-linux-gnu
- uses: actions/checkout@v2
- run: curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain nightly-2023-01-03 --profile minimal -y
- run: rustup component add rust-src --toolchain nightly-2023-01-03-x86_64-unknown-linux-gnu
- uses: actions/checkout@v3
- run: python3 -m pip install --user --upgrade pip "maturin>=0.14,<0.15" wheel
- run: |
maturin build --release --strip \
Expand Down
26 changes: 16 additions & 10 deletions .github/workflows/musllinux.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,23 +23,29 @@ jobs:
- target: x86_64-unknown-linux-musl
arch: x86_64
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python.version }}
- name: Build wheels
uses: messense/maturin-action@v1
uses: PyO3/maturin-action@v1
env:
CC: "gcc"
CFLAGS: "-O2 -fno-plt"
LDFLAGS: "-O2 -flto -Wl,--as-needed"
CARGO_UNSTABLE_SPARSE_REGISTRY: "true"
with:
maturin-version: v0.14.1
rust-toolchain: nightly-2022-11-20
maturin-version: v0.14.8
rust-toolchain: nightly-2023-01-03
rustup-components: rust-src
target: ${{ matrix.platform.target }}
manylinux: musllinux_1_1
args: --release --strip --out dist --features=unstable-simd,yyjson -i python${{ matrix.python.version }}
args: --release --strip --out dist --features=unstable-simd,yyjson -i python${{ matrix.python.version }} -Z build-std=std,panic_abort -Z build-std-features=panic_immediate_abort
- name: Set up QEMU
if: matrix.platform.arch != 'x86_64'
uses: docker/setup-qemu-action@v2
with:
image: tonistiigi/binfmt:qemu-v6.2.0
image: tonistiigi/binfmt:qemu-v7.0.0
platforms: all
- name: Install built wheel
uses: addnab/docker-run-action@v3
Expand All @@ -61,7 +67,7 @@ jobs:
venv/bin/pip install orjson --no-index --find-links dist/ --force-reinstall
venv/bin/python -m pytest -s -rxX -v test
- name: Upload wheels
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: wheels
path: dist
Expand All @@ -72,10 +78,10 @@ jobs:
if: "startsWith(github.ref, 'refs/tags/')"
needs: [ musllinux ]
steps:
- uses: actions/download-artifact@v2
- uses: actions/download-artifact@v3
with:
name: wheels
- uses: actions/setup-python@v2
- uses: actions/setup-python@v4
with:
python-version: "3.10"
- run: pip install "maturin>=0.14,<0.15"
Expand Down
28 changes: 14 additions & 14 deletions Cargo.lock

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

4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1164,7 +1164,7 @@ It benefits from also having a C build environment to compile a faster
deserialization backend. See this project's `manylinux_2_28` builds for an
example using clang and LTO.

The project's own CI tests against `nightly-2022-11-20` and stable 1.60. It
The project's own CI tests against `nightly-2023-01-03` and stable 1.60. It
is prudent to pin the nightly version because that channel can introduce
breaking changes.

Expand All @@ -1181,5 +1181,5 @@ tests should be run as part of the build. It can be run with

## License

orjson was written by ijl <<ijl@mailbox.org>>, copyright 2018 - 2022, licensed
orjson was written by ijl <<ijl@mailbox.org>>, copyright 2018 - 2023, licensed
under both the Apache 2 and MIT licenses.
1 change: 0 additions & 1 deletion ci/azure-debug.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ steps:

- bash: PATH=$(path) maturin build --strip $(extra) --compatibility $(compatibility) --interpreter $(interpreter)
env:
ORJSON_DISABLE_PYDICTITER: 1
ORJSON_DISABLE_YYJSON: 1
displayName: build debug with disabled features
- bash: PATH=$(path) $(interpreter) -m pip install --user target/wheels/orjson*.whl
Expand Down
4 changes: 2 additions & 2 deletions ci/azure-macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ parameters:

steps:
- bash: curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain $(toolchain) --profile minimal -y
- bash: rustup component add rust-src --toolchain nightly-2022-11-20-x86_64-apple-darwin
- bash: rustup component add rust-src --toolchain $(toolchain)-x86_64-apple-darwin
- bash: rustup target add aarch64-apple-darwin

- bash: pip install --upgrade pip "maturin>=0.14,<0.15" wheel
Expand All @@ -18,7 +18,7 @@ steps:
CC: "clang"
CFLAGS: "-O2 -fno-plt -flto=thin"
LDFLAGS: "-O2 -flto=thin -fuse-ld=lld -Wl,--as-needed"
RUSTFLAGS: "-C linker=clang"
RUSTFLAGS: "-C linker=clang -C target-feature=+sse4.2"
CARGO_UNSTABLE_SPARSE_REGISTRY: "true"
displayName: build
- bash: pip install target/wheels/orjson*.whl
Expand Down
2 changes: 1 addition & 1 deletion ci/azure-pipelines.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
variables:
toolchain: nightly-2022-11-20
toolchain: nightly-2023-01-03

jobs:

Expand Down
Loading

0 comments on commit 57497ff

Please sign in to comment.