Skip to content

Commit

Permalink
cargo update, misc
Browse files Browse the repository at this point in the history
  • Loading branch information
ijl committed Jun 10, 2024
1 parent ac8d90e commit c96351f
Show file tree
Hide file tree
Showing 14 changed files with 89 additions and 80 deletions.
24 changes: 13 additions & 11 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-04-30"
RUST_TOOLCHAIN: "nightly-2024-06-10"
CARGO_UNSTABLE_SPARSE_REGISTRY: "true"
UNSAFE_PYO3_SKIP_VERSION_CHECK: "1"
jobs:
Expand Down Expand Up @@ -38,7 +38,7 @@ jobs:

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

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

Expand Down Expand Up @@ -72,7 +72,7 @@ jobs:
CC: "clang"
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=4 -D warnings"
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
Expand Down Expand Up @@ -108,7 +108,7 @@ jobs:
--target=x86_64-unknown-linux-gnu
uv pip install target/wheels/orjson*.whl
- run: pytest -s -rxX -v -n 4 test
- run: pytest -s -rxX -v -n 2 test
env:
PYTHONMALLOC: "debug"

Expand Down Expand Up @@ -146,9 +146,11 @@ jobs:
- target: aarch64-unknown-linux-musl
arch: aarch64
platform: linux/arm64
features: no-panic,unstable-simd,unwind,yyjson
- target: x86_64-unknown-linux-musl
arch: x86_64
platform: linux/amd64
features: avx512,no-panic,unstable-simd,unwind,yyjson
steps:
- uses: actions/checkout@v4

Expand All @@ -163,13 +165,13 @@ jobs:
CC: "gcc"
CFLAGS: "-Os"
LDFLAGS: "-Wl,--as-needed"
RUSTFLAGS: "-Z mir-opt-level=4 -Z threads=4 -D warnings -C target-feature=-crt-static"
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-04-30
rust-toolchain: nightly-2024-06-10
rustup-components: rust-src
target: ${{ matrix.platform.target }}
manylinux: musllinux_1_2
args: --release --strip --out=dist --features=no-panic,unstable-simd,unwind,yyjson -i python${{ matrix.python.version }}
args: --release --strip --out=dist --features=${{ matrix.platform.features }} -i python${{ matrix.python.version }}

- name: QEMU
if: matrix.platform.arch != 'x86_64'
Expand All @@ -192,7 +194,7 @@ jobs:
venv/bin/pip install -U pip wheel
venv/bin/pip install -r test/requirements.txt
venv/bin/pip install orjson --no-index --find-links dist/ --force-reinstall
venv/bin/python -m pytest -s -rxX -v -n 4 test
venv/bin/python -m pytest -s -rxX -v -n 2 test
- name: Store wheels
if: "startsWith(github.ref, 'refs/tags/')"
Expand Down Expand Up @@ -254,7 +256,7 @@ jobs:
RUSTFLAGS: "${{ matrix.target.rustflags }}"
with:
target: ${{ matrix.target.target }}
rust-toolchain: nightly-2024-04-30
rust-toolchain: nightly-2024-06-10
rustup-components: rust-src
manylinux: auto
args: --release --strip --out=dist --features=${{ matrix.target.features }} -i python${{ matrix.python.version }}
Expand Down Expand Up @@ -317,7 +319,7 @@ jobs:

- uses: dtolnay/rust-toolchain@master
with:
toolchain: "nightly-2024-04-30"
toolchain: "nightly-2024-06-10"
targets: "aarch64-apple-darwin, x86_64-apple-darwin"
components: "rust-src"

Expand Down Expand Up @@ -387,7 +389,7 @@ jobs:

- uses: dtolnay/rust-toolchain@master
with:
toolchain: "nightly-2024-04-30"
toolchain: "nightly-2024-06-10"
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-04-30", features: "--features=yyjson,unstable-simd"},
{ rust: "nightly-2024-04-30", features: "--features=avx512,yyjson,unstable-simd"},
{ rust: "nightly-2024-06-10", features: "--features=yyjson,unstable-simd"},
{ rust: "nightly-2024-06-10", features: "--features=avx512,yyjson,unstable-simd"},
]
python: [
{ version: '3.13' },
Expand Down
60 changes: 30 additions & 30 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1205,7 +1205,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-04-30` and stable 1.72. It
The project's own CI tests against `nightly-2024-06-10` and stable 1.72. It
is prudent to pin the nightly version because that channel can introduce
breaking changes.

Expand Down
5 changes: 5 additions & 0 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ fn main() {
println!("cargo:rerun-if-env-changed=CC");
println!("cargo:rerun-if-env-changed=CFLAGS");
println!("cargo:rerun-if-env-changed=LDFLAGS");
println!("cargo:rerun-if-env-changed=ORJSON_DISABLE_AVX512");
println!("cargo:rerun-if-env-changed=ORJSON_DISABLE_SIMD");
println!("cargo:rerun-if-env-changed=ORJSON_DISABLE_YYJSON");
println!("cargo:rerun-if-env-changed=RUSTFLAGS");
Expand Down Expand Up @@ -40,6 +41,10 @@ fn main() {
if env::var("ORJSON_DISABLE_SIMD").is_err() {
if let Some(true) = version_check::supports_feature("portable_simd") {
println!("cargo:rustc-cfg=feature=\"unstable-simd\"");
#[cfg(all(target_arch = "x86_64", target_feature = "avx512vl"))]
if env::var("ORJSON_DISABLE_AVX512").is_err() {
println!("cargo:rustc-cfg=feature=\"avx512\"");
}
}
}

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-04-30
toolchain: nightly-2024-06-10

jobs:

Expand Down
3 changes: 2 additions & 1 deletion src/deserialize/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ pub struct DeserializeError<'a> {
#[cfg(not(feature = "yyjson"))]
pub column: usize, // start at 1
pub data: Option<&'a str>,
#[cfg(feature = "yyjson")]
pub pos: i64,
}

Expand All @@ -22,6 +23,7 @@ impl<'a> DeserializeError<'a> {
#[cfg(not(feature = "yyjson"))]
column: 0,
data: None,
#[cfg(feature = "yyjson")]
pos: 0,
}
}
Expand All @@ -34,7 +36,6 @@ impl<'a> DeserializeError<'a> {
line,
column,
data: Some(data),
pos: 0,
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/deserialize/json.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ impl<'de> DeserializeSeed<'de> for JsonValue {
impl<'de> Visitor<'de> for JsonValue {
type Value = NonNull<pyo3_ffi::PyObject>;

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

fn visit_unit<E>(self) -> Result<Self::Value, E> {
Expand Down
Loading

0 comments on commit c96351f

Please sign in to comment.