PyO3 / PyO3/pyo3

Fail to run cargo test.

Open
#2,591 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

documentation needs-design
Dominant language
Rust
Stars
16.2k
Forks
1k
Avg merge
2d 6h
Merged PRs (30d)
66

Description

Bug Description

When I ran cargo test command, it failed with the following errors:

cargo test
   Compiling target-lexicon v0.12.4
   Compiling autocfg v1.1.0
   Compiling once_cell v1.13.1
   Compiling proc-macro2 v1.0.43
   Compiling libc v0.2.132
   Compiling quote v1.0.21
   Compiling unicode-ident v1.0.3
   Compiling syn v1.0.99
   Compiling parking_lot_core v0.9.3
   Compiling scopeguard v1.1.0
   Compiling cfg-if v1.0.0
   Compiling smallvec v1.9.0
   Compiling unindent v0.1.10
   Compiling indoc v1.0.7
   Compiling lock_api v0.4.7
   Compiling num-traits v0.2.15
   Compiling pyo3-build-config v0.16.6
   Compiling parking_lot v0.12.1
   Compiling ordered-float v3.0.0
   Compiling pyo3-ffi v0.16.6
   Compiling pyo3 v0.16.6
   Compiling pyo3-macros-backend v0.16.6
   Compiling pyo3-macros v0.16.6
   Compiling itemcf v1.0.0 (/Users/Myname/Desktop/Myname/Work/Github/itemcf/itemcf)
    Finished test [unoptimized + debuginfo] target(s) in 34.05s
     Running unittests src/lib.rs (target/debug/deps/itemcf-dc85442e1cd8d29b)
dyld: Library not loaded: @rpath/libpython3.8.dylib
  Referenced from: /Users/Myname/Desktop/Myname/Work/Github/itemcf/itemcf/target/debug/deps/itemcf-dc85442e1cd8d29b
  Reason: image not found
error: test failed, to rerun pass '--lib'

Caused by:
  process didn't exit successfully: `/Users/Myname/Desktop/Myname/Work/Github/itemcf/itemcf/target/debug/deps/itemcf-dc85442e1cd8d29b` (signal: 6, SIGABRT: process abort signal)

### Steps to Reproduce

1. git clone git@github.com:tushushu/itemcf.git
2. check out wip-heap branch
3. cd yourdir/itemcf
4. cargo test

### Backtrace

_No response_

### Your operating system and version

MacOS big sur 11.6.8

### Your Python version (`python --version`)

Python 3.8

### Your Rust version (`rustc --version`)

1.61.0

### Your PyO3 version

0.16.4

### How did you install python? Did you use a virtualenv?

conda create -n py38 python=3.8

### Additional Info

_No response_

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the failure by checking out the wip-heap branch on macOS Big Sur with conda Python 3.8 and running cargo test in itemcf. Start by tracing the build and linking configuration for libpython3.8.dylib; done means the test binary launches and cargo test completes successfully.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, rust
Domain
build-system
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.