Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Fix build #156

Merged
merged 4 commits into from
Sep 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ jobs:
LDFLAGS: "-O2 -flto=thin -fuse-ld=lld -Wl,--as-needed"
RUSTFLAGS: "-C linker=clang"
CARGO_UNSTABLE_SPARSE_REGISTRY: "true"
run: PATH=$HOME/.cargo/bin:$PATH PYO3_CROSS_LIB_DIR=$(python -c "import sysconfig;print(sysconfig.get_config_var('LIBDIR'))") maturin build --release --strip --features=unstable-simd --universal2
run: PATH=$HOME/.cargo/bin:$PATH PYO3_CROSS_LIB_DIR=$(python -c "import sysconfig;print(sysconfig.get_config_var('LIBDIR'))") maturin build --release --strip --features=unstable-simd --target universal2-apple-darwin
- if: startsWith(github.ref, 'refs/tags')
run: twine upload --non-interactive --skip-existing target/wheels/*
release_sdist:
Expand Down
22 changes: 10 additions & 12 deletions Cargo.lock

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

1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ default = ["unstable-simd"]

# Use SIMD intrinsics. This requires Rust on the nightly channel.
unstable-simd = [
"bytecount/generic-simd",
"bytecount/runtime-dispatch-simd",
"encoding_rs/simd-accel",
"simdutf8/aarch64_neon",
Expand Down
1 change: 1 addition & 0 deletions src/serialize/default.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ impl Serialize for DefaultSerializer {
if unlikely!(self.default_calls == RECURSION_LIMIT) {
err!("default serializer exceeds recursion limit")
}
#[allow(clippy::unnecessary_cast)]
let default_obj = ffi!(PyObject_CallFunctionObjArgs(
callable.as_ptr(),
self.ptr,
Expand Down
8 changes: 4 additions & 4 deletions src/serialize/writer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ impl BytesWriter {
self.cap = len;
unsafe {
_PyBytes_Resize(
std::ptr::addr_of_mut!(self.bytes) as *mut *mut PyBytesObject as *mut *mut PyObject,
std::ptr::addr_of_mut!(self.bytes) as *mut *mut PyObject,
len as isize,
);
}
Expand Down Expand Up @@ -82,7 +82,7 @@ impl std::io::Write for BytesWriter {
self.grow(end_length);
}
unsafe {
std::ptr::copy_nonoverlapping(buf.as_ptr() as *const u8, self.buffer_ptr(), to_write);
std::ptr::copy_nonoverlapping(buf.as_ptr(), self.buffer_ptr(), to_write);
};
self.len = end_length;
Ok(())
Expand Down Expand Up @@ -174,7 +174,7 @@ impl WriteExt for &mut BytesWriter {
unsafe {
let ptr = self.buffer_ptr();
std::ptr::write(ptr, b'"');
std::ptr::copy_nonoverlapping(val.as_ptr() as *const u8, ptr.add(1), to_write);
std::ptr::copy_nonoverlapping(val.as_ptr(), ptr.add(1), to_write);
std::ptr::write(ptr.add(to_write + 1), b'"');
};
self.len = end_length;
Expand All @@ -187,7 +187,7 @@ impl WriteExt for &mut BytesWriter {
) -> std::result::Result<(), std::io::Error> {
let to_write = val.len();
unsafe {
std::ptr::copy_nonoverlapping(val.as_ptr() as *const u8, self.buffer_ptr(), to_write);
std::ptr::copy_nonoverlapping(val.as_ptr(), self.buffer_ptr(), to_write);
};
self.len += to_write;
Ok(())
Expand Down
2 changes: 1 addition & 1 deletion tests/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ pytz
typing_extensions;python_version>="3.6" and python_version<"3.8"
xxhash==1.4.3;sys_platform!="windows" and python_version<"3.9" # creates non-compact ASCII for test_str_ascii
msgpack
pydantic
pydantic==1.10.12