Skip to content

Add note to FAQ about failing integration tests #1336

New issue

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

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

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

OrangeTux
Copy link
Contributor

@OrangeTux OrangeTux commented Dec 22, 2020

Integration tests of a PyO3 project can't be put inside a tests/
directory. Due to a known problem Cargo fails to import the crate.

Fixes: #1321

Integration tests of a PyO3 project can't be put inside a `tests/`
directory. Due to a known problem Cargo fails to import the crate.

Fixes: PyO3#1321
Copy link
Member

@davidhewitt davidhewitt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR! I think there might be one other alternative...


This is not a bug in PyO3. But it's a [known problem of Cargo](https://github.com/rust-lang/cargo/issues/6659).

For now you can work around it by putting the integration tests inside the `src/` directory.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think an alternative workaround is also to add rlib to the crate-types in your Cargo.toml?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is also what a colleague suggested. However that yielded a new error:

  = note: /usr/bin/ld: /home/developer/projects/pyo3-ftp/target/debug/deps/libpyo3-9f95204c15f7bad5.rlib(ceval.o): relocation R_X86_64_PC32 against symbol `stderr@@GLIBC_2.2.5' can not be used when making a shared object; recompile with -fPIC
          /usr/bin/ld: final link failed: Bad value
          collect2: error: ld returned 1 exit status

Any idea if this could that also happen to others? Or is this problem isolated for my project?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, I understand, thanks.
It looks like that we cannot link Python with rlib.
How about lib?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GLIBC 2.2.5 is apparently from 2002... what OS are you using / where did you get the python interpreter from?

https://sourceware.org/glibc/wiki/Glibc%20Timeline

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Integration tests can't find crate
3 participants