Skip to content

Commit

Permalink
cargo update, build and tooling misc
Browse files Browse the repository at this point in the history
  • Loading branch information
ijl committed Jan 6, 2024
1 parent 399b36a commit 4a05a58
Show file tree
Hide file tree
Showing 42 changed files with 227 additions and 319 deletions.
16 changes: 8 additions & 8 deletions .github/workflows/debug.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ jobs:
strategy:
fail-fast: false
matrix:
rust: [
{ version: "1.65" }, # MSRV
{ version: "nightly-2023-10-10" },
profile: [
{ rust: "1.65", features: "" },
{ rust: "1.65", features: "--features=yyjson" },
{ rust: "nightly-2023-01-06", features: "--features=yyjson,unstable-simd" },
]
python: [
{ version: '3.12', abi: 'cp312-cp312' },
{ version: '3.11', abi: 'cp311-cp311' },
{ version: '3.8', abi: 'cp38-cp38' },
]
env:
Expand All @@ -22,9 +22,9 @@ jobs:
LDFLAGS: "-Wl,--as-needed"
CARGO_UNSTABLE_SPARSE_REGISTRY: "true"
steps:
- run: curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain ${{ matrix.rust.version }} --profile minimal -y
- run: curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain ${{ matrix.profile.rust }} --profile minimal -y

- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: '${{ matrix.python.version }}'
- run: python -m pip install --user --upgrade pip "maturin>=1,<2" wheel
Expand All @@ -36,9 +36,9 @@ jobs:
PATH="$HOME/.cargo/bin:$PATH" maturin build --release \
--out=dist \
--profile=dev \
--features=yyjson \
--interpreter python${{ matrix.python.version }} \
--target=x86_64-unknown-linux-gnu
--target=x86_64-unknown-linux-gnu \
--features ${{ matrix.profile.features }}
- run: python -m pip install --user dist/orjson*.whl
- run: python -m pip install --user -r test/requirements.txt -r integration/requirements.txt
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ jobs:
lint:
runs-on: ubuntu-22.04
steps:
- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: '3.11'
- run: curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain=stable --profile=default -y
Expand Down
36 changes: 20 additions & 16 deletions .github/workflows/linux.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,17 +62,17 @@ 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 -fno-plt -flto=thin"
LDFLAGS: "-O2 -flto=thin -fuse-ld=lld -Wl,--as-needed"
RUSTFLAGS: "-C linker=clang -C link-arg=-fuse-ld=lld"
CFLAGS: "-O2 -fno-plt -foffload-lto=full -fstrict-aliasing"
LDFLAGS: "-O2 -fno-plt -foffload-lto=full -fstrict-aliasing -fuse-ld=lld -Wl,--as-needed"
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"
CARGO_UNSTABLE_SPARSE_REGISTRY: "true"
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-2023-10-10 --profile minimal -y
- run: rustup component add rust-src --toolchain nightly-2023-10-10-x86_64-unknown-linux-gnu
- run: curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain nightly-2023-01-06 --profile minimal -y
- run: rustup component add rust-src --toolchain nightly-2023-01-06-x86_64-unknown-linux-gnu
- uses: actions/checkout@v4

- name: build-std
Expand Down Expand Up @@ -140,10 +140,10 @@ jobs:
CC: "gcc"
CFLAGS: "-O2 -fno-plt"
LDFLAGS: "-O2 -flto -Wl,--as-needed"
RUSTFLAGS: "-C target-feature=-crt-static"
RUSTFLAGS: "-C target-feature=-crt-static -Z mir-opt-level=4"
CARGO_UNSTABLE_SPARSE_REGISTRY: "true"
with:
rust-toolchain: nightly-2023-10-10
rust-toolchain: nightly-2023-01-06
rustup-components: rust-src
target: ${{ matrix.platform.target }}
manylinux: musllinux_1_1
Expand All @@ -153,7 +153,7 @@ jobs:
if: matrix.platform.arch != 'x86_64'
uses: docker/setup-qemu-action@v3
with:
image: tonistiigi/binfmt:qemu-v7.0.0
image: tonistiigi/binfmt:qemu-v8.0.4
platforms: ${{ matrix.platform.platform }}

- name: Test
Expand Down Expand Up @@ -195,27 +195,30 @@ jobs:
{
arch: 'aarch64',
target: 'aarch64-unknown-linux-gnu',
cflags: '-O2',
cflags: '-O2 -flto',
rustflags: '-Z mir-opt-level=4 -D warnings',
},
{
arch: 'armv7',
target: 'armv7-unknown-linux-gnueabihf',
cflags: '-Os -fstrict-aliasing',
cflags: '-Os -flto -fstrict-aliasing',
rustflags: '-C opt-level=s -Z mir-opt-level=4 -D warnings',
},
{
arch: 'ppc64le',
target: 'powerpc64le-unknown-linux-gnu',
cflags: '-O2',
cflags: '-O2 -flto',
rustflags: '-Z mir-opt-level=4 -D warnings',
},
{
arch: 's390x',
target: 's390x-unknown-linux-gnu',
cflags: '-O2 -march=z10',
cflags: '-O2 -flto -march=z10',
rustflags: '-Z mir-opt-level=4 -C target-cpu=z10 -D warnings',
},
]
steps:
- uses: actions/checkout@v4

- name: build-std
run: |
mkdir .cargo
Expand All @@ -226,11 +229,12 @@ jobs:
env:
PYO3_CROSS_LIB_DIR: "/opt/python/${{ matrix.python.abi }}"
CFLAGS: "${{ matrix.target.cflags }}"
LDFLAGS: "${{ matrix.target.cflags }} -flto -Wl,--as-needed"
LDFLAGS: "${{ matrix.target.cflags }} -Wl,--as-needed"
CARGO_UNSTABLE_SPARSE_REGISTRY: "true"
RUSTFLAGS: "${{ matrix.target.rustflags }}"
with:
target: ${{ matrix.target.target }}
rust-toolchain: nightly-2023-10-10
rust-toolchain: nightly-2023-01-06
rustup-components: rust-src
manylinux: auto
args: --release --strip --out=dist --features=no-panic,yyjson -i python${{ matrix.python.version }}
Expand Down Expand Up @@ -277,7 +281,7 @@ jobs:
- uses: actions/download-artifact@v3
with:
name: wheels
- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: "3.11"
- run: pip install pip "maturin>=1,<2"
Expand Down
75 changes: 36 additions & 39 deletions Cargo.lock

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

Loading

0 comments on commit 4a05a58

Please sign in to comment.