Skip to content

Commit

Permalink
build, clippy, edition misc
Browse files Browse the repository at this point in the history
  • Loading branch information
ijl committed Dec 13, 2024
1 parent e5ddb0b commit e85322a
Show file tree
Hide file tree
Showing 30 changed files with 716 additions and 331 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/artifact.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
- uses: actions/checkout@v4

- run: python3 -m pip install --user --upgrade pip "maturin>=1,<2" wheel
- run: python3 -m pip install --user --upgrade pip "maturin==1.7.5" wheel

- name: Vendor dependencies
run: |
Expand Down Expand Up @@ -262,7 +262,7 @@ jobs:
- target: armv7-unknown-linux-musleabihf
arch: armv7l
platform: linux/arm/v7
features: unstable-simd,yyjson
features: yyjson
- target: x86_64-unknown-linux-musl
arch: x86_64
platform: linux/amd64
Expand Down Expand Up @@ -448,7 +448,7 @@ jobs:
curl -LsSf https://astral.sh/uv/install.sh | sh
uv venv --python python${{ matrix.python.version }}
uv pip install --upgrade "maturin>=1,<2" -r test/requirements.txt -r integration/requirements.txt
uv pip install --upgrade "maturin==1.7.5" -r test/requirements.txt -r integration/requirements.txt
mkdir .cargo
cp ci/config.toml .cargo/config.toml
Expand Down Expand Up @@ -522,7 +522,7 @@ jobs:
curl -LsSf https://astral.sh/uv/install.sh | sh
uv venv --python python${{ matrix.python.version }}
uv pip install --upgrade "maturin>=1,<2" -r test/requirements.txt -r integration/requirements.txt
uv pip install --upgrade "maturin==1.7.5" -r test/requirements.txt -r integration/requirements.txt
mkdir .cargo
cp ci/config.toml .cargo/config.toml
Expand Down Expand Up @@ -597,7 +597,7 @@ jobs:
run: |
cargo fetch --target "${{ matrix.platform.target }}" &
python.exe -m pip install --upgrade pip "maturin>=1,<2" wheel
python.exe -m pip install --upgrade pip "maturin==1.7.5" wheel
python.exe -m pip install -r test\requirements.txt -r integration\requirements.txt
mkdir .cargo
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/debug.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
with:
python-version: '${{ matrix.python.version }}'

- run: python -m pip install --user --upgrade pip "maturin>=1,<2" wheel
- run: python -m pip install --user --upgrade pip "maturin==1.7.5" wheel

- uses: actions/checkout@v4

Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/stale.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@ permissions:

jobs:
stale:
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
steps:
- uses: actions/stale@v9
with:
days-before-stale: 7
days-before-close: 1
exempt-issue-labels: planned
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.

29 changes: 14 additions & 15 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ 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");
println!("cargo:rustc-check-cfg=cfg(intrinsics)");
Expand All @@ -28,6 +26,8 @@ fn main() {
println!("{cfg}");
}

let is_64bit_python = matches!(python_config.pointer_width, Some(64));

if let Some(true) = version_check::supports_feature("core_intrinsics") {
println!("cargo:rustc-cfg=feature=\"intrinsics\"");
}
Expand All @@ -36,23 +36,22 @@ fn main() {
println!("cargo:rustc-cfg=feature=\"optimize\"");
}

#[cfg(any(target_arch = "x86_64", target_arch = "aarch64"))]
if env::var("ORJSON_DISABLE_SIMD").is_err() {
// auto build unstable SIMD on nightly
if let Some(true) = version_check::supports_feature("portable_simd") {
println!("cargo:rustc-cfg=feature=\"unstable-simd\"");
}
// auto build AVX512 on x86-64-v4 or supporting native targets
#[cfg(all(target_arch = "x86_64", target_feature = "avx512vl"))]
if let Some(true) = version_check::supports_feature("stdarch_x86_avx512") {
if env::var("ORJSON_DISABLE_AVX512").is_err() {
println!("cargo:rustc-cfg=feature=\"avx512\"");
}
// auto build unstable SIMD on nightly
#[cfg(any(target_arch = "x86_64", target_arch = "x86", target_arch = "aarch64"))]
if let Some(true) = version_check::supports_feature("portable_simd") {
println!("cargo:rustc-cfg=feature=\"unstable-simd\"");
}

// auto build AVX512 on nightly
#[cfg(target_arch = "x86_64")]
if let Some(true) = version_check::supports_feature("stdarch_x86_avx512") {
if is_64bit_python {
println!("cargo:rustc-cfg=feature=\"avx512\"");
}
}

#[cfg(any(target_arch = "x86_64", target_arch = "aarch64"))]
if let Some(64) = python_config.pointer_width {
if is_64bit_python {
println!("cargo:rustc-cfg=feature=\"inline_int\"");
}

Expand Down
Loading

0 comments on commit e85322a

Please sign in to comment.