Skip to content

Commit

Permalink
Fix string copy test by using predictable struct memory layout for `A…
Browse files Browse the repository at this point in the history
…llocatedPyASCIIObject` (#574)

* Fix string copy test by using predictable struct memory layout for `AllocatedPyASCIIObject`

* handle deprecated --universal2 maturin option

PyO3/maturin#1620

---------

Co-authored-by: Ben Frederickson <github@benfrederickson.com>
  • Loading branch information
zanieb and benfred committed May 23, 2023
1 parent c325f41 commit e6053b5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ jobs:
run: |
rustup target add aarch64-apple-darwin
pip install --upgrade maturin
maturin build --release -o dist --universal2
maturin build --release -o dist --target universal2-apple-darwin
if: matrix.os == 'macos-latest'
- name: Rename Wheels
run: |
Expand Down
1 change: 1 addition & 0 deletions src/python_data_access.rs
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,7 @@ pub mod tests {
}

#[allow(dead_code)]
#[repr(C)] // Rust can optimize the layout of this struct and break our pointer arithmetic
pub struct AllocatedPyASCIIObject {
pub base: PyASCIIObject,
pub storage: [u8; 4096]
Expand Down

0 comments on commit e6053b5

Please sign in to comment.