Skip to content

Commit

Permalink
cargo update, vendor pyo3-ffi
Browse files Browse the repository at this point in the history
  • Loading branch information
ijl committed Oct 15, 2024
1 parent 3640a30 commit 2ad3143
Show file tree
Hide file tree
Showing 115 changed files with 14,755 additions and 160 deletions.
56 changes: 24 additions & 32 deletions .github/workflows/artifact.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: artifact
on: push
env:
RUST_TOOLCHAIN: "nightly-2024-08-05"
RUST_TOOLCHAIN: "nightly-2024-09-25"
CARGO_UNSTABLE_SPARSE_REGISTRY: "true"
UNSAFE_PYO3_BUILD_FREE_THREADED: "1"
UNSAFE_PYO3_SKIP_VERSION_CHECK: "1"
Expand Down Expand Up @@ -71,54 +71,45 @@ jobs:
{ interpreter: 'python3.8', package: 'python3.8' },
]
env:
PYTHON: "${{ matrix.python.interpreter }}"
PYTHON_PACKAGE: "${{ matrix.python.package }}"
CC: "clang"
VENV: ".venv"
CFLAGS: "-Os -fstrict-aliasing -fno-plt -flto=full -emit-llvm"
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 virtual-function-elimination -Z threads=2 -D warnings"
PATH: "/__w/orjson/orjson/.venv/bin:/github/home/.cargo/bin:/root/.local/bin:/root/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
container:
image: fedora:41
image: fedora:42
steps:

- name: cpuinfo
run: cat /proc/cpuinfo

- name: Build environment pre-clone
run: |
dnf copr enable -y @fedora-llvm-team/llvm19
dnf install -y rustup clang lld ${{ matrix.python.package }} git
rustup-init --default-toolchain "${RUST_TOOLCHAIN}-x86_64-unknown-linux-gnu" --profile minimal --component rust-src -y
run: dnf install -y git

- uses: actions/checkout@v4

- name: Build environment post-clone
run: |
cargo fetch --target=x86_64-unknown-linux-gnu &
mkdir .cargo
cp ci/config.toml .cargo/config.toml
./install-fedora
curl -LsSf https://astral.sh/uv/install.sh | sh
uv venv --python ${{ matrix.python.interpreter }}
uv pip install --upgrade "maturin>=1,<2" -r test/requirements.txt -r integration/requirements.txt
# source "${HOME}/.cargo/env"
# source "${VENV}/bin/activate"
- name: maturin
run: |
source .venv/bin/activate
maturin build --release --strip \
--features=avx512,no-panic,unstable-simd,yyjson \
--compatibility manylinux_2_17 \
--interpreter ${{ matrix.python.interpreter }} \
--target=x86_64-unknown-linux-gnu
uv pip install target/wheels/orjson*.whl
--compatibility=manylinux_2_17 \
--interpreter="${PYTHON}" \
--target="${TARGET}"
- run: source .venv/bin/activate && pytest -s -rxX -v -n 2 test
env:
PYTHONMALLOC: "debug"
uv pip install target/wheels/orjson*.whl
- run: source .venv/bin/activate && ./integration/run thread
- run: source .venv/bin/activate && ./integration/run http
- run: source .venv/bin/activate && ./integration/run init
pytest -s -rxX -v -n 2 test
./integration/run thread
./integration/run http
./integration/run init
- name: Store wheels
if: "startsWith(github.ref, 'refs/tags/')"
Expand Down Expand Up @@ -167,9 +158,9 @@ jobs:
LDFLAGS: "-Wl,--as-needed"
RUSTFLAGS: "-C lto=fat -Z mir-opt-level=4 -Z virtual-function-elimination -Z threads=2 -D warnings -C target-feature=-crt-static"
with:
rust-toolchain: nightly-2024-08-05
rust-toolchain: "${{ env.RUST_TOOLCHAIN }}"
rustup-components: rust-src
target: ${{ matrix.platform.target }}
target: "${{ matrix.platform.target }}"
manylinux: musllinux_1_2
args: --release --strip --out=dist --features=${{ matrix.platform.features }} -i python${{ matrix.python.version }}

Expand Down Expand Up @@ -211,6 +202,7 @@ jobs:
fail-fast: false
matrix:
python: [
{ version: '3.13', abi: 'cp313-cp313' },
{ version: '3.12', abi: 'cp312-cp312' },
{ version: '3.11', abi: 'cp311-cp311' },
{ version: '3.10', abi: 'cp310-cp310' },
Expand Down Expand Up @@ -262,8 +254,8 @@ jobs:
LDFLAGS: "-Wl,--as-needed"
RUSTFLAGS: "${{ matrix.target.rustflags }}"
with:
target: ${{ matrix.target.target }}
rust-toolchain: nightly-2024-08-05
target: "${{ matrix.target.target }}"
rust-toolchain: "${{ env.RUST_TOOLCHAIN }}"
rustup-components: rust-src
manylinux: auto
args: --release --strip --out=dist --features=${{ matrix.target.features }} -i python${{ matrix.python.version }}
Expand Down Expand Up @@ -328,7 +320,7 @@ jobs:

- uses: dtolnay/rust-toolchain@master
with:
toolchain: "nightly-2024-08-05"
toolchain: "${{ env.RUST_TOOLCHAIN }}"
targets: "aarch64-apple-darwin, x86_64-apple-darwin"
components: "rust-src"

Expand Down Expand Up @@ -398,7 +390,7 @@ jobs:

- uses: dtolnay/rust-toolchain@master
with:
toolchain: "nightly-2024-08-05"
toolchain: "${{ env.RUST_TOOLCHAIN }}"
targets: "aarch64-apple-darwin, x86_64-apple-darwin"
components: "rust-src"

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/debug.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ jobs:
profile: [
{ rust: "1.72", features: "" },
{ rust: "1.72", features: "--features=yyjson" },
{ rust: "nightly-2024-08-05", features: "--features=yyjson,unstable-simd"},
{ rust: "nightly-2024-08-05", features: "--features=avx512,yyjson,unstable-simd"},
{ rust: "nightly-2024-09-25", features: "--features=yyjson,unstable-simd"},
{ rust: "nightly-2024-09-25", features: "--features=avx512,yyjson,unstable-simd"},
]
python: [
{ version: '3.13' },
Expand Down
91 changes: 43 additions & 48 deletions Cargo.lock

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

Loading

0 comments on commit 2ad3143

Please sign in to comment.