From 6c3faec5550d6db83a12b9b7ac0cb2e70ebb2384 Mon Sep 17 00:00:00 2001 From: ijl Date: Sat, 23 Nov 2024 18:24:52 +0000 Subject: [PATCH] win, musl, i686, macOS 15 artifact jobs --- .github/workflows/artifact.yaml | 150 +++++++++++++++++++----- .github/workflows/debug.yaml | 3 +- .github/workflows/stale.yaml | 2 +- Cargo.lock | 61 ++++------ Cargo.toml | 7 +- README.md | 6 +- build.rs | 9 +- ci/azure-pipelines.yml | 196 -------------------------------- ci/azure-win.yml | 41 ------- ci/deploy | 18 --- script/install-fedora | 5 +- 11 files changed, 155 insertions(+), 343 deletions(-) delete mode 100644 ci/azure-pipelines.yml delete mode 100644 ci/azure-win.yml delete mode 100755 ci/deploy diff --git a/.github/workflows/artifact.yaml b/.github/workflows/artifact.yaml index eae5339d..f3974525 100644 --- a/.github/workflows/artifact.yaml +++ b/.github/workflows/artifact.yaml @@ -3,7 +3,7 @@ on: push env: CARGO_UNSTABLE_SPARSE_REGISTRY: "true" PIP_DISABLE_PIP_VERSION_CHECK: "1" - RUST_TOOLCHAIN: "nightly-2024-09-25" + RUST_TOOLCHAIN: "nightly-2024-11-22" UNSAFE_PYO3_BUILD_FREE_THREADED: "1" UNSAFE_PYO3_SKIP_VERSION_CHECK: "1" UV_LINK_MODE: "copy" @@ -11,6 +11,7 @@ jobs: sdist: runs-on: ubuntu-22.04 + timeout-minutes: 10 strategy: fail-fast: false env: @@ -77,7 +78,7 @@ jobs: { cc: "clang", cflags: "-Os -fstrict-aliasing -fno-plt -flto=full -emit-llvm", - features: "avx512,no-panic,unstable-simd,yyjson", + features: "avx512,unstable-simd,yyjson", 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 threads=4 -D warnings", tag: null, @@ -85,17 +86,17 @@ jobs: }, ] env: - PYTHON: "${{ matrix.python.interpreter }}" - PYTHON_PACKAGE: "${{ matrix.python.package }}" - TARGET: "${{ matrix.arch.target }}" + CARGO_TARGET_DIR: "/tmp/orjson" CC: "${{ matrix.arch.cc }}" - VENV: ".venv" - FEATURES: "${{ matrix.arch.features }}" CFLAGS: "${{ matrix.arch.cflags }}" + COMPATIBILITY: "${{ matrix.python.compatibility }}" + FEATURES: "${{ matrix.arch.features }}" LDFLAGS: "${{ matrix.arch.ldflags }}" + PYTHON: "${{ matrix.python.interpreter }}" + PYTHON_PACKAGE: "${{ matrix.python.package }}" RUSTFLAGS: "${{ matrix.arch.rustflags }}" - CARGO_TARGET_DIR: "/tmp/orjson" - COMPATIBILITY: "${{ matrix.python.compatibility }}" + TARGET: "${{ matrix.arch.target }}" + VENV: ".venv" steps: - name: cpuinfo @@ -167,7 +168,7 @@ jobs: { cc: "clang", cflags: "-Os -fstrict-aliasing -fno-plt -flto=full -emit-llvm", - features: "no-panic,unstable-simd,yyjson", + features: "unstable-simd,yyjson", 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 threads=4 -D warnings", tag: "aarch64", @@ -175,17 +176,17 @@ jobs: }, ] env: - PYTHON: "${{ matrix.python.interpreter }}" - PYTHON_PACKAGE: "${{ matrix.python.package }}" - TARGET: "${{ matrix.arch.target }}" + CARGO_TARGET_DIR: "/tmp/orjson" CC: "${{ matrix.arch.cc }}" - VENV: ".venv" - FEATURES: "${{ matrix.arch.features }}" CFLAGS: "${{ matrix.arch.cflags }}" + COMPATIBILITY: "${{ matrix.python.compatibility }}" + FEATURES: "${{ matrix.arch.features }}" LDFLAGS: "${{ matrix.arch.ldflags }}" + PYTHON: "${{ matrix.python.interpreter }}" + PYTHON_PACKAGE: "${{ matrix.python.package }}" RUSTFLAGS: "${{ matrix.arch.rustflags }}" - CARGO_TARGET_DIR: "/tmp/orjson" - COMPATIBILITY: "${{ matrix.python.compatibility }}" + TARGET: "${{ matrix.arch.target }}" + VENV: ".venv" steps: - name: cpuinfo @@ -241,6 +242,7 @@ jobs: musllinux: runs-on: ubuntu-24.04 + timeout-minutes: 10 strategy: fail-fast: false matrix: @@ -256,11 +258,19 @@ jobs: - target: aarch64-unknown-linux-musl arch: aarch64 platform: linux/arm64 - features: no-panic,unstable-simd,unwind,yyjson + features: unstable-simd,unwind,yyjson + - target: armv7-unknown-linux-musleabihf + arch: armv7l + platform: linux/arm/v7 + features: unstable-simd,yyjson - target: x86_64-unknown-linux-musl arch: x86_64 platform: linux/amd64 - features: avx512,no-panic,unstable-simd,unwind,yyjson + features: avx512,unstable-simd,unwind,yyjson + - target: i686-unknown-linux-musl + arch: i686 + platform: linux/386 + features: unstable-simd,unwind,yyjson steps: - uses: actions/checkout@v4 @@ -317,6 +327,7 @@ jobs: manylinux_non_amd64: runs-on: ubuntu-24.04 + timeout-minutes: 20 strategy: fail-fast: false matrix: @@ -331,28 +342,35 @@ jobs: { arch: 'aarch64', cflags: '-Os -flto=full -fstrict-aliasing', - features: 'no-panic,unstable-simd,yyjson', + features: 'unstable-simd,yyjson', rustflags: '-Z mir-opt-level=4 -C lto=fat -D warnings', target: 'aarch64-unknown-linux-gnu', }, + { + arch: 'i686', + cflags: '-Os -flto -fstrict-aliasing', + features: 'unstable-simd,yyjson', + rustflags: '-Z mir-opt-level=4 -C lto=fat -D warnings', + target: 'i686-unknown-linux-gnu', + }, { arch: 'armv7', cflags: '-Os -flto=full -fstrict-aliasing', - features: 'no-panic,yyjson', # no SIMD + features: 'yyjson', # no SIMD rustflags: '-Z mir-opt-level=4 -C lto=fat -D warnings -C opt-level=s', target: 'armv7-unknown-linux-gnueabihf', }, { arch: 'ppc64le', cflags: '-Os -flto=full -fstrict-aliasing', - features: 'no-panic,unstable-simd,yyjson', + features: 'unstable-simd,yyjson', rustflags: '-Z mir-opt-level=4 -C lto=fat -D warnings', target: 'powerpc64le-unknown-linux-gnu', }, { arch: 's390x', cflags: '-Os -flto=full -fstrict-aliasing -march=z10', - features: 'no-panic,yyjson', + features: 'yyjson', rustflags: '-Z mir-opt-level=4 -C lto=fat -D warnings -C target-cpu=z10', target: 's390x-unknown-linux-gnu', }, @@ -389,7 +407,8 @@ jobs: retention-days: 1 macos_aarch64: - runs-on: macos-14 + runs-on: macos-15 + timeout-minutes: 10 strategy: fail-fast: false matrix: @@ -414,7 +433,6 @@ jobs: - uses: actions/setup-python@v5 with: python-version: "${{ matrix.python.version }}" - allow-prereleases: true - uses: dtolnay/rust-toolchain@master with: @@ -426,6 +444,8 @@ jobs: run: | cargo fetch --target aarch64-apple-darwin & + export PATH=$HOME/.cargo/bin:$HOME/.local/bin:$PATH + 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 @@ -435,11 +455,12 @@ jobs: - name: maturin run: | - PATH=$HOME/.cargo/bin:$PATH \ + export PATH=$HOME/.cargo/bin:$HOME/.local/bin:$PATH + MACOSX_DEPLOYMENT_TARGET="${{ matrix.python.macosx_target }}" \ PYO3_CROSS_LIB_DIR=$(python -c "import sysconfig;print(sysconfig.get_config_var('LIBDIR'))") \ maturin build --release --strip \ - --features=no-panic,unstable-simd,yyjson \ + --features=unstable-simd,yyjson \ --interpreter python${{ matrix.python.version }} \ --target=universal2-apple-darwin uv pip install target/wheels/orjson*.whl @@ -463,6 +484,7 @@ jobs: macos_amd64: runs-on: macos-13 + timeout-minutes: 10 strategy: fail-fast: false matrix: @@ -496,6 +518,8 @@ jobs: run: | cargo fetch --target aarch64-apple-darwin & + export PATH=$HOME/.cargo/bin:$HOME/.local/bin:$PATH + 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 @@ -505,11 +529,12 @@ jobs: - name: maturin run: | - PATH=$HOME/.cargo/bin:$PATH \ + export PATH=$HOME/.cargo/bin:$HOME/.local/bin:$PATH + MACOSX_DEPLOYMENT_TARGET="${{ matrix.python.macosx_target }}" \ PYO3_CROSS_LIB_DIR=$(python -c "import sysconfig;print(sysconfig.get_config_var('LIBDIR'))") \ maturin build --release --strip \ - --features=no-panic,unstable-simd,yyjson \ + --features=unstable-simd,yyjson \ --interpreter python${{ matrix.python.version }} \ --target=universal2-apple-darwin uv pip install target/wheels/orjson*.whl @@ -531,9 +556,75 @@ jobs: overwrite: true retention-days: 1 + windows: + runs-on: windows-2022 + timeout-minutes: 10 + strategy: + fail-fast: false + matrix: + python: [ + { version: '3.13' }, + { version: '3.12' }, + { version: '3.11' }, + { version: '3.10' }, + { version: '3.9' }, + { version: '3.8' }, + ] + platform: [ + { arch: "x64", target: "x86_64-pc-windows-msvc" }, + { arch: "x86", target: "i686-pc-windows-msvc" }, + ] + env: + CFLAGS: "-Os" + LDFLAGS: "-Wl,--as-needed" + RUSTFLAGS: "-C lto=fat -Z mir-opt-level=4 -D warnings" + steps: + + - uses: actions/checkout@v4 + + - uses: actions/setup-python@v5 + with: + python-version: "${{ matrix.python.version }}" + architecture: "${{ matrix.platform.arch }}" + + - uses: dtolnay/rust-toolchain@master + with: + toolchain: "${{ env.RUST_TOOLCHAIN }}" + targets: "${{ matrix.platform.target }}" + components: "rust-src" + + - name: Build environment + run: | + cargo fetch --target "${{ matrix.platform.target }}" & + + python.exe -m pip install --upgrade pip "maturin>=1,<2" wheel + python.exe -m pip install -r test\requirements.txt -r integration\requirements.txt + + mkdir .cargo + cp ci\config.toml .cargo\config.toml + + - name: maturin + run: | + maturin.exe build --release --strip --features=unstable-simd,yyjson --target="${{ matrix.platform.target }}" + python.exe -m pip install orjson --no-index --find-links target\wheels + + - run: python.exe -m pytest -s -rxX -v test + env: + PYTHONMALLOC: "debug" + + - name: Store wheels + if: "startsWith(github.ref, 'refs/tags/')" + uses: actions/upload-artifact@v4 + with: + name: orjson_windows_${{ matrix.platform.arch }}_${{ matrix.python.version }} + path: target\wheels + overwrite: true + retention-days: 1 + pypi: name: PyPI runs-on: ubuntu-24.04 + timeout-minutes: 10 if: "startsWith(github.ref, 'refs/tags/')" needs: [ macos_aarch64, @@ -543,6 +634,7 @@ jobs: manylinux_non_amd64, musllinux, sdist, + windows, ] environment: name: pypi diff --git a/.github/workflows/debug.yaml b/.github/workflows/debug.yaml index 863135ac..1c49f8bb 100644 --- a/.github/workflows/debug.yaml +++ b/.github/workflows/debug.yaml @@ -10,8 +10,7 @@ jobs: profile: [ { rust: "1.72", features: "" }, { rust: "1.72", features: "--features=yyjson" }, - { rust: "nightly-2024-09-25", features: "--features=yyjson,unstable-simd" }, - { rust: "nightly-2024-09-25", features: "--features=avx512,yyjson,unstable-simd" }, + { rust: "nightly-2024-11-22", features: "--features=avx512,yyjson,unstable-simd" }, ] python: [ { version: '3.13' }, diff --git a/.github/workflows/stale.yaml b/.github/workflows/stale.yaml index ef9d5310..3dc0091d 100644 --- a/.github/workflows/stale.yaml +++ b/.github/workflows/stale.yaml @@ -10,7 +10,7 @@ jobs: stale: runs-on: ubuntu-latest steps: - - uses: actions/stale@v8 + - uses: actions/stale@v9 with: days-before-stale: 7 days-before-close: 1 diff --git a/Cargo.lock b/Cargo.lock index fde9db8d..b28197d8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -25,9 +25,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.1.31" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2e7962b54006dcfcc61cb72735f4d89bb97061dd6a7ed882ec6b8ee53714c6f" +checksum = "fd9de9f2205d5ef3fd67e685b0df337994ddd4495e2a28d185500d0e1edfea47" dependencies = [ "shlex", ] @@ -70,9 +70,9 @@ dependencies = [ [[package]] name = "gimli" -version = "0.30.0" +version = "0.31.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2e1d97fbe9722ba9bbd0c97051c2956e726562b61f86a25a4360398a40edfc9" +checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f" [[package]] name = "half" @@ -86,12 +86,9 @@ dependencies = [ [[package]] name = "itoa" -version = "1.0.11" +version = "1.0.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" -dependencies = [ - "no-panic", -] +checksum = "540654e97a3f4470a492cd30ff187bc95d89557a903a2bbf112e2fae98104ef2" [[package]] name = "itoap" @@ -107,9 +104,9 @@ checksum = "b9d9d414fc817d3e3d62b2598616733f76c4cc74fbac96069674739b881295c8" [[package]] name = "libc" -version = "0.2.161" +version = "0.2.164" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e9489c2807c139ffd9c1794f4af0ebe86a828db53ecdc7fea2111d0fed085d1" +checksum = "433bfe06b8c75da9b2e3fbea6e5329ff87748f0b144ef75306e674c3f6f7c13f" [[package]] name = "memchr" @@ -117,17 +114,6 @@ version = "2.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" -[[package]] -name = "no-panic" -version = "0.1.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8540b7d99a20166178b42a05776aef900cdbfec397f861dfc7819bf1d7760b3d" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - [[package]] name = "once_cell" version = "1.20.2" @@ -163,9 +149,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.89" +version = "1.0.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f139b0662de085916d1fb67d2b4169d1addddda1919e696f3252b740b629986e" +checksum = "37d3544b3f2748c54e147655edb5025752e2303145b5aefb3c3ea2c78b973bb0" dependencies = [ "unicode-ident", ] @@ -206,24 +192,21 @@ name = "ryu" version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" -dependencies = [ - "no-panic", -] [[package]] name = "serde" -version = "1.0.214" +version = "1.0.215" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f55c3193aca71c12ad7890f1785d2b73e1b9f63a0bbc353c08ef26fe03fc56b5" +checksum = "6513c1ad0b11a9376da888e3e0baa0077f1aed55c17f50e7b2397136129fb88f" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.214" +version = "1.0.215" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de523f781f095e28fa605cdce0f8307e451cc0fd14e2eb4cd2e98a355b147766" +checksum = "ad1e866f866923f252f05c889987993144fb74e722403468a4ebd70c3cd756c0" dependencies = [ "proc-macro2", "quote", @@ -232,9 +215,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.132" +version = "1.0.133" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d726bfaff4b320266d395898905d0eba0345aae23b54aee3a737e260fd46db03" +checksum = "c7fceb2473b9166b2294ef05efcb65a3db80803f0b03ef86a5fc88a2b85ee377" dependencies = [ "itoa", "memchr", @@ -268,9 +251,9 @@ checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" [[package]] name = "syn" -version = "2.0.86" +version = "2.0.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e89275301d38033efb81a6e60e3497e734dfcc62571f2854bf4b16690398824c" +checksum = "44d46482f1c1c87acd84dea20c1bf5ebff4c757009ed6bf19cfd36fb10e92c4e" dependencies = [ "proc-macro2", "quote", @@ -285,15 +268,15 @@ checksum = "61c41af27dd6d1e27b1b16b489db798443478cef1f06a660c96db617ba5de3b1" [[package]] name = "unicode-ident" -version = "1.0.13" +version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e91b56cd4cadaeb79bbf1a5645f6b4f8dc5bde8834ad5894a8db35fda9efa1fe" +checksum = "adb9e6ca4f869e1180728b7950e35922a7fc6397f7b641499e8f3ef06e50dc83" [[package]] name = "unwinding" -version = "0.2.2" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc55842d0db6329a669d55a623c674b02d677b16bfb2d24857d4089d41eba882" +checksum = "e2c6cb20f236dae10c69b0b45d82ef50af8b7e45c10e429e7901d26b49b4dbf3" dependencies = [ "gimli", ] diff --git a/Cargo.toml b/Cargo.toml index 516f4d0e..7f09aba4 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -38,11 +38,6 @@ unstable-simd = [] # Include runtime-detected functions that use AVX512VL. Requires unstable-simd and amd64. avx512 = [] -no-panic = [ - "itoa/no-panic", - "ryu/no-panic", -] - # Avoid bundling libgcc on musl. unwind = ["unwinding"] @@ -71,7 +66,7 @@ serde = { version = "1", default-features = false } serde_json = { version = "1", default-features = false, features = ["std", "float_roundtrip"] } simdutf8 = { version = "0.1", default-features = false, features = ["std", "public_imp", "aarch64_neon"] } smallvec = { version = "^1.11", default-features = false, features = ["union", "write"] } -unwinding = { version = "=0.2.2", default-features = false, features = ["unwinder"], optional = true } +unwinding = { version = "^0.2.4", default-features = false, features = ["unwinder"], optional = true } uuid = { version = "1", default-features = false } xxhash-rust = { version = "^0.8", default-features = false, features = ["xxh3"] } diff --git a/README.md b/README.md index 942597ef..398c1fd3 100644 --- a/README.md +++ b/README.md @@ -34,8 +34,8 @@ file-like objects orjson supports CPython 3.8, 3.9, 3.10, 3.11, 3.12, 3.13, and 3.14. -It distributes amd64/x86_64, aarch64/armv8, arm7, POWER/ppc64le, and s390x -wheels for Linux, amd64 and aarch64 wheels for macOS, and amd64 +It distributes amd64/x86_64, i686/x86, aarch64/armv8, arm7, POWER/ppc64le, +and s390x wheels for Linux, amd64 and aarch64 wheels for macOS, and amd64 and i686/x86 wheels for Windows. orjson does not and will not support PyPy, embedded Python builds for @@ -1224,7 +1224,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-09-25` and stable 1.72. It +The project's own CI tests against `nightly-2024-11-22` and stable 1.72. It is prudent to pin the nightly version because that channel can introduce breaking changes. diff --git a/build.rs b/build.rs index ad6d5b9c..b3fc40c9 100644 --- a/build.rs +++ b/build.rs @@ -51,11 +51,10 @@ fn main() { } } - #[cfg(all( - target_pointer_width = "64", - any(target_arch = "x86_64", target_arch = "aarch64") - ))] - println!("cargo:rustc-cfg=feature=\"inline_int\""); + #[cfg(any(target_arch = "x86_64", target_arch = "aarch64"))] + if let Some(64) = python_config.pointer_width { + println!("cargo:rustc-cfg=feature=\"inline_int\""); + } if env::var("ORJSON_DISABLE_YYJSON").is_ok() { if env::var("CARGO_FEATURE_YYJSON").is_ok() { diff --git a/ci/azure-pipelines.yml b/ci/azure-pipelines.yml deleted file mode 100644 index 8382734e..00000000 --- a/ci/azure-pipelines.yml +++ /dev/null @@ -1,196 +0,0 @@ -variables: - toolchain: nightly-2024-09-25 - -jobs: - -- job: win_python313_amd64 - pool: - vmImage: windows-2022 - variables: - interpreter: C:\hostedtoolcache\windows\Python\3.13.0\x64\python.exe - rustup: https://win.rustup.rs/x86_64 - target: x86_64-pc-windows-msvc - steps: - - task: UsePythonVersion@0 - inputs: - versionSpec: '3.13.0' - addToPath: true - architecture: 'x64' - - checkout: self - - template: ./azure-win.yml - -- job: win_python312_amd64 - pool: - vmImage: windows-2022 - variables: - interpreter: C:\hostedtoolcache\windows\Python\3.12.2\x64\python.exe - rustup: https://win.rustup.rs/x86_64 - target: x86_64-pc-windows-msvc - steps: - - task: UsePythonVersion@0 - inputs: - versionSpec: '3.12.2' - addToPath: true - architecture: 'x64' - - checkout: self - - template: ./azure-win.yml - -- job: win_python311_amd64 - pool: - vmImage: windows-2022 - variables: - interpreter: C:\hostedtoolcache\windows\Python\3.11.4\x64\python.exe - rustup: https://win.rustup.rs/x86_64 - target: x86_64-pc-windows-msvc - steps: - - task: UsePythonVersion@0 - inputs: - versionSpec: '3.11.4' - addToPath: true - architecture: 'x64' - - checkout: self - - template: ./azure-win.yml - -- job: win_python310_amd64 - pool: - vmImage: windows-2022 - variables: - interpreter: C:\hostedtoolcache\windows\Python\3.10.8\x64\python.exe - rustup: https://win.rustup.rs/x86_64 - target: x86_64-pc-windows-msvc - steps: - - task: UsePythonVersion@0 - inputs: - versionSpec: '3.10.8' - addToPath: true - architecture: 'x64' - - checkout: self - - template: ./azure-win.yml - -- job: win_python39_amd64 - pool: - vmImage: windows-2022 - variables: - interpreter: C:\hostedtoolcache\windows\Python\3.9.13\x64\python.exe - rustup: https://win.rustup.rs/x86_64 - target: x86_64-pc-windows-msvc - steps: - - task: UsePythonVersion@0 - inputs: - versionSpec: '3.9.13' - addToPath: true - architecture: 'x64' - - checkout: self - - template: ./azure-win.yml - -- job: win_python38_amd64 - pool: - vmImage: windows-2022 - variables: - interpreter: C:\hostedtoolcache\windows\Python\3.8.10\x64\python.exe - rustup: https://win.rustup.rs/x86_64 - target: x86_64-pc-windows-msvc - steps: - - task: UsePythonVersion@0 - inputs: - versionSpec: '3.8.10' - addToPath: true - architecture: 'x64' - - checkout: self - - template: ./azure-win.yml - -- job: win_python313_x86 - pool: - vmImage: windows-2022 - variables: - interpreter: C:\hostedtoolcache\windows\Python\3.13.0\x86\python.exe - rustup: https://win.rustup.rs/x86 - target: i686-pc-windows-msvc - steps: - - task: UsePythonVersion@0 - inputs: - versionSpec: '3.13.0' - addToPath: true - architecture: 'x86' - - checkout: self - - template: ./azure-win.yml - -- job: win_python312_x86 - pool: - vmImage: windows-2022 - variables: - interpreter: C:\hostedtoolcache\windows\Python\3.12.2\x86\python.exe - rustup: https://win.rustup.rs/x86 - target: i686-pc-windows-msvc - steps: - - task: UsePythonVersion@0 - inputs: - versionSpec: '3.12.2' - addToPath: true - architecture: 'x86' - - checkout: self - - template: ./azure-win.yml - -- job: win_python311_x86 - pool: - vmImage: windows-2022 - variables: - interpreter: C:\hostedtoolcache\windows\Python\3.11.4\x86\python.exe - rustup: https://win.rustup.rs/x86 - target: i686-pc-windows-msvc - steps: - - task: UsePythonVersion@0 - inputs: - versionSpec: '3.11.4' - addToPath: true - architecture: 'x86' - - checkout: self - - template: ./azure-win.yml - -- job: win_python310_x86 - pool: - vmImage: windows-2022 - variables: - interpreter: C:\hostedtoolcache\windows\Python\3.10.8\x86\python.exe - rustup: https://win.rustup.rs/x86 - target: i686-pc-windows-msvc - steps: - - task: UsePythonVersion@0 - inputs: - versionSpec: '3.10.8' - addToPath: true - architecture: 'x86' - - checkout: self - - template: ./azure-win.yml - -- job: win_python39_x86 - pool: - vmImage: windows-2022 - variables: - interpreter: C:\hostedtoolcache\windows\Python\3.9.13\x86\python.exe - rustup: https://win.rustup.rs/x86 - target: i686-pc-windows-msvc - steps: - - task: UsePythonVersion@0 - inputs: - versionSpec: '3.9.13' - addToPath: true - architecture: 'x86' - - checkout: self - - template: ./azure-win.yml - -- job: win_python38_x86 - pool: - vmImage: windows-2022 - variables: - interpreter: C:\hostedtoolcache\windows\Python\3.8.10\x86\python.exe - rustup: https://win.rustup.rs/x86 - target: i686-pc-windows-msvc - steps: - - task: UsePythonVersion@0 - inputs: - versionSpec: '3.8.10' - addToPath: true - architecture: 'x86' - - checkout: self - - template: ./azure-win.yml diff --git a/ci/azure-win.yml b/ci/azure-win.yml deleted file mode 100644 index 655eab96..00000000 --- a/ci/azure-win.yml +++ /dev/null @@ -1,41 +0,0 @@ -parameters: - interpreter: '' - rustup: '' - target: '' - toolchain: '' - -steps: -- script: | - curl $(rustup) -o rustup-init.exe - rustup-init.exe -y --default-host $(target) --default-toolchain $(toolchain)-$(target) --profile minimal - set PATH=%PATH%;%USERPROFILE%\.cargo\bin - rustup default $(toolchain)-$(target) - rustup component add rust-src - mkdir .cargo - cp ci/config.toml .cargo/config.toml - echo "##vso[task.setvariable variable=PATH;]%PATH%;%USERPROFILE%\.cargo\bin" - displayName: rustup -- script: python.exe -m pip install --upgrade pip "maturin>=1,<2" wheel - displayName: build dependencies -- script: python.exe -m pip install -r test\requirements.txt -r integration\requirements.txt - displayName: test dependencies -- script: maturin.exe build --release --features=no-panic,unstable-simd,yyjson --strip --interpreter $(interpreter) --target $(target) - displayName: build - env: - CFLAGS: "-Os -flto" - LDFLAGS: "-Wl,--as-needed" - RUSTFLAGS: "-C lto=fat -Z mir-opt-level=4 -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 - env: - PYTHONMALLOC: "debug" - displayName: pytest -- script: python.exe integration\thread - displayName: thread -- script: python.exe integration\init - displayName: init -- bash: ./ci/deploy /d/a/1/s/target/wheels/*.whl - displayName: deploy diff --git a/ci/deploy b/ci/deploy deleted file mode 100755 index 1b34b539..00000000 --- a/ci/deploy +++ /dev/null @@ -1,18 +0,0 @@ -#!/usr/bin/env bash - -set -eou pipefail - -if [ -z ${DRONE_TAG+x} ]; then - tag=$(git name-rev --tags --name-only $(git rev-parse HEAD)) -else - tag="$DRONE_TAG" -fi - -echo "$tag" - -if [[ "$tag" == "undefined" ]]; then - echo "not on a tag" - exit 0 -fi - -maturin upload --skip-existing "$1" diff --git a/script/install-fedora b/script/install-fedora index 19a5a455..9e8c1247 100755 --- a/script/install-fedora +++ b/script/install-fedora @@ -4,7 +4,7 @@ set -eou pipefail # export PYTHON=python3.11 # export PYTHON_PACKAGE=python3.11 -# export RUST_TOOLCHAIN=nightly-2024-09-25 +# export RUST_TOOLCHAIN=nightly-2024-11-22 # export TARGET=x86_64-unknown-linux-gnu # export VENV=.venv # export CARGO_TARGET_DIR=/tmp/orjson @@ -14,7 +14,7 @@ export CARGO_TARGET_DIR="${CARGO_TARGET_DIR:-target}" rm /etc/yum.repos.d/fedora-cisco-openh264.repo || true -dnf install --setopt=install_weak_deps=false -y rustup clang lld "${PYTHON_PACKAGE}" +dnf install --setopt=install_weak_deps=false -y rustup clang lld "${PYTHON_PACKAGE}" python3-uv rustup-init --default-toolchain "${RUST_TOOLCHAIN}-${TARGET}" --profile minimal --component rust-src -y source "${HOME}/.cargo/env" @@ -24,7 +24,6 @@ cp ci/config.toml .cargo/config.toml cargo fetch --target="${TARGET}" & -curl -LsSf https://astral.sh/uv/install.sh | sh rm -rf "${VENV}" uv venv --python "${PYTHON}" "${VENV}" source "${VENV}/bin/activate"