Skip to content

Commit

Permalink
cargo update, build misc
Browse files Browse the repository at this point in the history
  • Loading branch information
ijl committed Mar 26, 2024
1 parent a348f59 commit 5b47d17
Show file tree
Hide file tree
Showing 14 changed files with 79 additions and 69 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/debug.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
profile: [
{ rust: "1.72", features: "" },
{ rust: "1.72", features: "--features=yyjson" },
{ rust: "nightly-2024-02-13", features: "--features=yyjson,unstable-simd" },
{ rust: "nightly-2024-03-25", features: "--features=yyjson,unstable-simd" },
]
python: [
{ version: '3.13' },
Expand All @@ -19,9 +19,10 @@ jobs:
]
env:
CC: "gcc"
CFLAGS: "-O2"
CFLAGS: "-Os -fstrict-aliasing"
LDFLAGS: "-Wl,--as-needed"
CARGO_UNSTABLE_SPARSE_REGISTRY: "true"
UNSAFE_PYO3_SKIP_VERSION_CHECK: "1"
steps:
- run: curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain ${{ matrix.profile.rust }} --profile minimal -y

Expand Down
59 changes: 29 additions & 30 deletions .github/workflows/linux.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:

- run: python3 -m pip install --user -r test/requirements.txt -r integration/requirements.txt mypy

- run: pytest -s -rxX -v test
- run: pytest -s -rxX -v -n 4 test
env:
PYTHONMALLOC: "debug"

Expand All @@ -41,7 +41,7 @@ jobs:

- name: Store sdist
if: "startsWith(github.ref, 'refs/tags/')"
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: wheels
path: dist
Expand All @@ -62,17 +62,18 @@ jobs:
env:
PATH: /github/home/.local/bin:/github/home/.cargo/bin:/opt/python/${{ matrix.python.abi }}/bin:/opt/rh/gcc-toolset-12/root/usr/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
CC: "clang"
CFLAGS: "-O2 -fstrict-aliasing -emit-llvm -flto=full"
LDFLAGS: "-O2 -fstrict-aliasing -emit-llvm -flto=full -fuse-ld=lld -Wl,--as-needed -Wl,-plugin-opt=also-emit-llvm"
RUSTFLAGS: "-C linker=clang -C linker-plugin-lto -C lto=fat -C link-arg=-fuse-ld=lld -Z mir-opt-level=4 -Z virtual-function-elimination -D warnings"
CFLAGS: "-Os -fstrict-aliasing -flto=full"
LDFLAGS: "-fuse-ld=lld -Wl,--as-needed"
RUSTFLAGS: "-C linker=clang -C lto=fat -C link-arg=-fuse-ld=lld -Z mir-opt-level=4 -Z virtual-function-elimination -D warnings"
CARGO_UNSTABLE_SPARSE_REGISTRY: "true"
UNSAFE_PYO3_SKIP_VERSION_CHECK: "1"
container:
image: quay.io/pypa/manylinux_2_28_x86_64:latest
options: --user 0
steps:
- run: yum install -y clang lld
- run: curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain nightly-2024-02-13 --profile minimal -y
- run: rustup component add rust-src --toolchain nightly-2024-02-13-x86_64-unknown-linux-gnu
- run: curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain nightly-2024-03-25 --profile minimal -y
- run: rustup component add rust-src --toolchain nightly-2024-03-25-x86_64-unknown-linux-gnu
- uses: actions/checkout@v4

- name: build-std
Expand All @@ -91,7 +92,7 @@ jobs:
- run: python3 -m pip install --user dist/orjson*.whl
- run: python3 -m pip install --user -r test/requirements.txt -r integration/requirements.txt

- run: pytest -s -rxX -v test
- run: pytest -s -rxX -v -n 4 test
env:
PYTHONMALLOC: "debug"

Expand All @@ -101,7 +102,7 @@ jobs:

- name: Store wheels
if: "startsWith(github.ref, 'refs/tags/')"
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: wheels
path: dist
Expand Down Expand Up @@ -138,12 +139,13 @@ jobs:
uses: PyO3/maturin-action@v1
env:
CC: "gcc"
CFLAGS: "-O2"
LDFLAGS: "-O2 -flto -Wl,--as-needed"
RUSTFLAGS: "-C target-feature=-crt-static -Z mir-opt-level=4"
CFLAGS: "-Os -flto=full"
LDFLAGS: "-Wl,--as-needed"
RUSTFLAGS: "-Z mir-opt-level=4 -C lto=fat -D warnings -C target-feature=-crt-static"
CARGO_UNSTABLE_SPARSE_REGISTRY: "true"
UNSAFE_PYO3_SKIP_VERSION_CHECK: "1"
with:
rust-toolchain: nightly-2024-02-13
rust-toolchain: nightly-2024-03-25
rustup-components: rust-src
target: ${{ matrix.platform.target }}
manylinux: musllinux_1_2
Expand Down Expand Up @@ -174,7 +176,7 @@ jobs:
- name: Store wheels
if: "startsWith(github.ref, 'refs/tags/')"
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: wheels
path: dist
Expand All @@ -195,31 +197,31 @@ jobs:
target: [
{
arch: 'aarch64',
cflags: '-O2 -flto',
cflags: '-Os -flto=full -fstrict-aliasing',
features: 'no-panic,unstable-simd,yyjson',
rustflags: '-Z mir-opt-level=4 -D warnings',
rustflags: '-Z mir-opt-level=4 -C lto=fat -D warnings',
target: 'aarch64-unknown-linux-gnu',
},
{
arch: 'armv7',
cflags: '-Os -flto -fstrict-aliasing',
cflags: '-Os -flto=full -fstrict-aliasing',
features: 'no-panic,yyjson', # no SIMD
rustflags: '-C opt-level=s -Z mir-opt-level=4 -D warnings',
rustflags: '-Z mir-opt-level=4 -C lto=fat -D warnings -C opt-level=s',
target: 'armv7-unknown-linux-gnueabihf',
},
{
arch: 'ppc64le',
cflags: '-O2 -flto',
cflags: '-Os -flto=full -fstrict-aliasing',
features: 'no-panic,unstable-simd,yyjson',
rustflags: '-Z mir-opt-level=4 -D warnings',
rustflags: '-Z mir-opt-level=4 -C lto=fat -D warnings',
target: 'powerpc64le-unknown-linux-gnu',
},
{
arch: 's390x',
cflags: '-O2 -flto -march=z10',
cflags: '-Os -flto=full -fstrict-aliasing -march=z10',
# no unstable-simd as rotate_elements_left() causes exit 125 in at least QEMU
features: 'no-panic,yyjson',
rustflags: '-Z mir-opt-level=4 -C target-cpu=z10 -D warnings',
rustflags: '-Z mir-opt-level=4 -C lto=fat -D warnings -C target-cpu=z10',
target: 's390x-unknown-linux-gnu',
},
]
Expand All @@ -235,12 +237,13 @@ jobs:
env:
PYO3_CROSS_LIB_DIR: "/opt/python/${{ matrix.python.abi }}"
CFLAGS: "${{ matrix.target.cflags }}"
LDFLAGS: "${{ matrix.target.cflags }} -Wl,--as-needed"
LDFLAGS: "-Wl,--as-needed"
CARGO_UNSTABLE_SPARSE_REGISTRY: "true"
RUSTFLAGS: "${{ matrix.target.rustflags }}"
UNSAFE_PYO3_SKIP_VERSION_CHECK: "1"
with:
target: ${{ matrix.target.target }}
rust-toolchain: nightly-2024-02-13
rust-toolchain: nightly-2024-03-25
rustup-components: rust-src
manylinux: auto
args: --release --strip --out=dist --features=${{ matrix.target.features }} -i python${{ matrix.python.version }}
Expand Down Expand Up @@ -268,23 +271,19 @@ jobs:
- name: Store wheels
if: "startsWith(github.ref, 'refs/tags/')"
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: wheels
path: dist
retention-days: 1

pypi:
name: PyPI
permissions:
# trusted publisher
id-token: write
contents: write
runs-on: ubuntu-22.04
if: "startsWith(github.ref, 'refs/tags/')"
needs: [ manylinux_2_17_amd64, manylinux_2_17_non_amd64, musllinux_1_2, sdist ]
steps:
- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
with:
name: wheels
- uses: actions/setup-python@v5
Expand Down
44 changes: 22 additions & 22 deletions Cargo.lock

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

6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,13 @@ arrayvec = { version = "0.7", default_features = false, features = ["std", "serd
associative-cache = { version = "2", default_features = false }
beef = { version = "0.5", default_features = false, features = ["impl_serde"] }
bytecount = { version = "^0.6.7", default_features = false, features = ["runtime-dispatch-simd"] }
chrono = { version = "^0.4.31", default_features = false }
chrono = { version = "=0.4.34", default_features = false }
compact_str = { version = "0.7", default_features = false, features = ["serde"] }
encoding_rs = { version = "0.8", default_features = false }
itoa = { version = "1", default_features = false }
itoap = { version = "1", features = ["std", "simd"] }
once_cell = { version = "1", default_features = false, features = ["race"] }
pyo3-ffi = { version = "^0.20.2", default_features = false, features = ["extension-module"]}
pyo3-ffi = { version = "^0.21", default_features = false, features = ["extension-module"]}
ryu = { version = "1", default_features = false }
serde = { version = "1", default_features = false }
serde_json = { version = "1", default_features = false, features = ["std", "float_roundtrip"] }
Expand All @@ -65,7 +65,7 @@ smallvec = { version = "^1.11", default_features = false, features = ["union", "

[build-dependencies]
cc = { version = "1" }
pyo3-build-config = { version = "^0.20.2" }
pyo3-build-config = { version = "^0.21" }
version_check = { version = "0.9" }

[profile.dev]
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1199,7 +1199,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-2024-02-13` and stable 1.65. It
The project's own CI tests against `nightly-2024-03-25` and stable 1.65. It
is prudent to pin the nightly version because that channel can introduce
breaking changes.

Expand Down
5 changes: 3 additions & 2 deletions ci/azure-macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,13 @@ steps:
maturin build --release --strip --features=no-panic,unstable-simd,yyjson --interpreter $(interpreter) --target=universal2-apple-darwin
env:
CC: "clang"
CFLAGS: "-O2 -fstrict-aliasing -flto=full"
LDFLAGS: "-O2 -fstrict-aliasing -flto=full -Wl,--as-needed"
CFLAGS: "-Os -fstrict-aliasing -flto=full"
LDFLAGS: "-Wl,--as-needed"
CFLAGS_x86_64_apple_darwin: "-O2 -fstrict-aliasing -flto=full -march=x86-64-v2 -mtune=generic"
CFLAGS_aarch64_apple_darwin: "-O2 -fstrict-aliasing -flto=full -mcpu=apple-m1 -mtune=generic"
RUSTFLAGS: "-C lto=fat -Z mir-opt-level=4 -Z virtual-function-elimination -D warnings"
CARGO_UNSTABLE_SPARSE_REGISTRY: "true"
UNSAFE_PYO3_SKIP_VERSION_CHECK: "1"
displayName: build universal2

- bash: pip install target/wheels/orjson*universal2.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-2024-02-13
toolchain: nightly-2024-03-25

jobs:

Expand Down
6 changes: 5 additions & 1 deletion ci/azure-win.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,11 @@ steps:
- script: maturin.exe build --release --features=no-panic,unstable-simd,yyjson --strip --interpreter $(interpreter) --target $(target)
displayName: build
env:
RUSTFLAGS: "-Z mir-opt-level=4"
CFLAGS: "-Os -fstrict-aliasing -flto=full"
LDFLAGS: "-Wl,--as-needed"
RUSTFLAGS: "-C lto=fat -Z mir-opt-level=4 -Z virtual-function-elimination -D warnings"
CARGO_UNSTABLE_SPARSE_REGISTRY: "true"
UNSAFE_PYO3_SKIP_VERSION_CHECK: "1"
- script: python.exe -m pip install orjson --no-index --find-links=D:\a\1\s\target\wheels
displayName: install
- script: python.exe -m pytest -s -rxX -v test
Expand Down
Loading

0 comments on commit 5b47d17

Please sign in to comment.