Skip to content

Commit c96351f

Browse files
committed
cargo update, misc
1 parent ac8d90e commit c96351f

File tree

14 files changed

+89
-80
lines changed

14 files changed

+89
-80
lines changed

.github/workflows/artifact.yaml

+13-11
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: artifact
22
on: push
33
env:
4-
RUST_TOOLCHAIN: "nightly-2024-04-30"
4+
RUST_TOOLCHAIN: "nightly-2024-06-10"
55
CARGO_UNSTABLE_SPARSE_REGISTRY: "true"
66
UNSAFE_PYO3_SKIP_VERSION_CHECK: "1"
77
jobs:
@@ -38,7 +38,7 @@ jobs:
3838

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

41-
- run: pytest -s -rxX -v -n 4 test
41+
- run: pytest -s -rxX -v -n 2 test
4242
env:
4343
PYTHONMALLOC: "debug"
4444

@@ -72,7 +72,7 @@ jobs:
7272
CC: "clang"
7373
CFLAGS: "-Os -fstrict-aliasing -fno-plt -flto=full -emit-llvm"
7474
LDFLAGS: "-fuse-ld=lld -Wl,-plugin-opt=also-emit-llvm -Wl,--as-needed -Wl,-zrelro,-znow"
75-
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=4 -D warnings"
75+
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"
7676
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"
7777
container:
7878
image: fedora:41
@@ -108,7 +108,7 @@ jobs:
108108
--target=x86_64-unknown-linux-gnu
109109
uv pip install target/wheels/orjson*.whl
110110
111-
- run: pytest -s -rxX -v -n 4 test
111+
- run: pytest -s -rxX -v -n 2 test
112112
env:
113113
PYTHONMALLOC: "debug"
114114

@@ -146,9 +146,11 @@ jobs:
146146
- target: aarch64-unknown-linux-musl
147147
arch: aarch64
148148
platform: linux/arm64
149+
features: no-panic,unstable-simd,unwind,yyjson
149150
- target: x86_64-unknown-linux-musl
150151
arch: x86_64
151152
platform: linux/amd64
153+
features: avx512,no-panic,unstable-simd,unwind,yyjson
152154
steps:
153155
- uses: actions/checkout@v4
154156

@@ -163,13 +165,13 @@ jobs:
163165
CC: "gcc"
164166
CFLAGS: "-Os"
165167
LDFLAGS: "-Wl,--as-needed"
166-
RUSTFLAGS: "-Z mir-opt-level=4 -Z threads=4 -D warnings -C target-feature=-crt-static"
168+
RUSTFLAGS: "-C lto=fat -Z mir-opt-level=4 -Z virtual-function-elimination -Z threads=2 -D warnings -C target-feature=-crt-static"
167169
with:
168-
rust-toolchain: nightly-2024-04-30
170+
rust-toolchain: nightly-2024-06-10
169171
rustup-components: rust-src
170172
target: ${{ matrix.platform.target }}
171173
manylinux: musllinux_1_2
172-
args: --release --strip --out=dist --features=no-panic,unstable-simd,unwind,yyjson -i python${{ matrix.python.version }}
174+
args: --release --strip --out=dist --features=${{ matrix.platform.features }} -i python${{ matrix.python.version }}
173175

174176
- name: QEMU
175177
if: matrix.platform.arch != 'x86_64'
@@ -192,7 +194,7 @@ jobs:
192194
venv/bin/pip install -U pip wheel
193195
venv/bin/pip install -r test/requirements.txt
194196
venv/bin/pip install orjson --no-index --find-links dist/ --force-reinstall
195-
venv/bin/python -m pytest -s -rxX -v -n 4 test
197+
venv/bin/python -m pytest -s -rxX -v -n 2 test
196198
197199
- name: Store wheels
198200
if: "startsWith(github.ref, 'refs/tags/')"
@@ -254,7 +256,7 @@ jobs:
254256
RUSTFLAGS: "${{ matrix.target.rustflags }}"
255257
with:
256258
target: ${{ matrix.target.target }}
257-
rust-toolchain: nightly-2024-04-30
259+
rust-toolchain: nightly-2024-06-10
258260
rustup-components: rust-src
259261
manylinux: auto
260262
args: --release --strip --out=dist --features=${{ matrix.target.features }} -i python${{ matrix.python.version }}
@@ -317,7 +319,7 @@ jobs:
317319

318320
- uses: dtolnay/rust-toolchain@master
319321
with:
320-
toolchain: "nightly-2024-04-30"
322+
toolchain: "nightly-2024-06-10"
321323
targets: "aarch64-apple-darwin, x86_64-apple-darwin"
322324
components: "rust-src"
323325

@@ -387,7 +389,7 @@ jobs:
387389

388390
- uses: dtolnay/rust-toolchain@master
389391
with:
390-
toolchain: "nightly-2024-04-30"
392+
toolchain: "nightly-2024-06-10"
391393
targets: "aarch64-apple-darwin, x86_64-apple-darwin"
392394
components: "rust-src"
393395

.github/workflows/debug.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ jobs:
1010
profile: [
1111
{ rust: "1.72", features: "" },
1212
{ rust: "1.72", features: "--features=yyjson" },
13-
{ rust: "nightly-2024-04-30", features: "--features=yyjson,unstable-simd"},
14-
{ rust: "nightly-2024-04-30", features: "--features=avx512,yyjson,unstable-simd"},
13+
{ rust: "nightly-2024-06-10", features: "--features=yyjson,unstable-simd"},
14+
{ rust: "nightly-2024-06-10", features: "--features=avx512,yyjson,unstable-simd"},
1515
]
1616
python: [
1717
{ version: '3.13' },

Cargo.lock

+30-30
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1205,7 +1205,7 @@ It benefits from also having a C build environment to compile a faster
12051205
deserialization backend. See this project's `manylinux_2_28` builds for an
12061206
example using clang and LTO.
12071207

1208-
The project's own CI tests against `nightly-2024-04-30` and stable 1.72. It
1208+
The project's own CI tests against `nightly-2024-06-10` and stable 1.72. It
12091209
is prudent to pin the nightly version because that channel can introduce
12101210
breaking changes.
12111211

build.rs

+5
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ fn main() {
88
println!("cargo:rerun-if-env-changed=CC");
99
println!("cargo:rerun-if-env-changed=CFLAGS");
1010
println!("cargo:rerun-if-env-changed=LDFLAGS");
11+
println!("cargo:rerun-if-env-changed=ORJSON_DISABLE_AVX512");
1112
println!("cargo:rerun-if-env-changed=ORJSON_DISABLE_SIMD");
1213
println!("cargo:rerun-if-env-changed=ORJSON_DISABLE_YYJSON");
1314
println!("cargo:rerun-if-env-changed=RUSTFLAGS");
@@ -40,6 +41,10 @@ fn main() {
4041
if env::var("ORJSON_DISABLE_SIMD").is_err() {
4142
if let Some(true) = version_check::supports_feature("portable_simd") {
4243
println!("cargo:rustc-cfg=feature=\"unstable-simd\"");
44+
#[cfg(all(target_arch = "x86_64", target_feature = "avx512vl"))]
45+
if env::var("ORJSON_DISABLE_AVX512").is_err() {
46+
println!("cargo:rustc-cfg=feature=\"avx512\"");
47+
}
4348
}
4449
}
4550

ci/azure-pipelines.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
variables:
2-
toolchain: nightly-2024-04-30
2+
toolchain: nightly-2024-06-10
33

44
jobs:
55

src/deserialize/error.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ pub struct DeserializeError<'a> {
99
#[cfg(not(feature = "yyjson"))]
1010
pub column: usize, // start at 1
1111
pub data: Option<&'a str>,
12+
#[cfg(feature = "yyjson")]
1213
pub pos: i64,
1314
}
1415

@@ -22,6 +23,7 @@ impl<'a> DeserializeError<'a> {
2223
#[cfg(not(feature = "yyjson"))]
2324
column: 0,
2425
data: None,
26+
#[cfg(feature = "yyjson")]
2527
pos: 0,
2628
}
2729
}
@@ -34,7 +36,6 @@ impl<'a> DeserializeError<'a> {
3436
line,
3537
column,
3638
data: Some(data),
37-
pos: 0,
3839
}
3940
}
4041

src/deserialize/json.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ impl<'de> DeserializeSeed<'de> for JsonValue {
4747
impl<'de> Visitor<'de> for JsonValue {
4848
type Value = NonNull<pyo3_ffi::PyObject>;
4949

50-
fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
51-
formatter.write_str("JSON")
50+
fn expecting(&self, _formatter: &mut fmt::Formatter) -> fmt::Result {
51+
Ok(())
5252
}
5353

5454
fn visit_unit<E>(self) -> Result<Self::Value, E> {

0 commit comments

Comments
 (0)