forked from ijl/orjson
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdevelop
More file actions
executable file
·27 lines (18 loc) · 1018 Bytes
/
Copy pathdevelop
File metadata and controls
executable file
·27 lines (18 loc) · 1018 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/bin/sh -e
rm -f target/wheels/*
export UNSAFE_PYO3_BUILD_FREE_THREADED=1
export UNSAFE_PYO3_SKIP_VERSION_CHECK=1
mkdir -p .cargo
cp ci/config.toml .cargo/config.toml
export CC="${CC:-clang}"
export LD="${LD:-lld}"
export TARGET="${TARGET:-x86_64-unknown-linux-gnu}"
export CARGO_TARGET_DIR="${CARGO_TARGET_DIR:-target}"
export ORJSON_COMPATIBILITY="${ORJSON_COMPATIBILITY:-manylinux_2_17}"
echo "CC: ${CC}, LD: ${LD}, LD_LIBRARY_PATH: ${LD_LIBRARY_PATH}"
export CFLAGS="-O2 -fstrict-aliasing -fno-plt -emit-llvm"
export LDFLAGS="-fuse-ld=${LD} -Wl,-plugin-opt=also-emit-llvm -Wl,--as-needed -Wl,-zrelro,-znow"
export RUSTFLAGS="-Z unstable-options -C panic=immediate-abort -C linker=${CC} -C link-arg=-fuse-ld=${LD} -C linker-plugin-lto -C link-arg=-Wl,-zrelro,-znow -Z mir-opt-level=4 -Z threads=8"
rm -f ${CARGO_TARGET_DIR}/wheels/*.whl
maturin build --target="${TARGET}" --features=no_panic --compatibility="${ORJSON_COMPATIBILITY}" "$@"
uv pip install --link-mode=copy ${CARGO_TARGET_DIR}/wheels/*.whl