Skip to content
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

wasmtime-py doesn't build with cargo test #468

Closed
joshtriplett opened this issue Oct 30, 2019 · 4 comments
Closed

wasmtime-py doesn't build with cargo test #468

joshtriplett opened this issue Oct 30, 2019 · 4 comments

Comments

@joshtriplett
Copy link
Member

wasmtime-py uses pyo3's "extension-module" feature flag, which makes it not link libpython directly, so that it works in whatever python or libpython the address space already has loaded.

This seems perfectly reasonable, but as far as I can tell, that means that cargo test --package=wasmtime-py can't work, as it tries to link a binary. That link results in unresolved symbol errors for all the Python symbols.

@sunfishcode suggested filing this as an issue. cc @fitzgen and @alexcrichton.

@bjorn3
Copy link
Contributor

bjorn3 commented Oct 30, 2019

Would this work?

#[cfg(test)]
#[link(name = "python")]
extern "C" {}

@joshtriplett
Copy link
Member Author

joshtriplett commented Oct 30, 2019

@bjorn3 Linking Python is not quite as simple as #[link(name = "python")]; pyo3 has some logic in its build script to figure that out.

Apparently pyo3 documents this issue, and recommends disabling the extension-module feature when testing.

Unfortunately, that would break things like cargo test --all. I'm currently trying to figure out if there's some way to automatically disable extension-module when doing cargo test. @alexcrichton?

@konstin
Copy link

konstin commented Oct 31, 2019

Afaik the only proper solution to this problem would be introducing something like rustc-bin-link-arg as bin equivalent to rustc-cdylib-link-arg introduced in rust-lang/cargo#6298, thereby solving rust-lang/cargo#5928

@alexcrichton
Copy link
Member

This was sinced moved to https://github.com/bytecodealliance/wasmtime-py, so closing.

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

No branches or pull requests

4 participants