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

maturin build --target x86_64-pc-windows-gnu --zig results in a broken module #922

Open
2 tasks done
ravenexp opened this issue May 17, 2022 · 1 comment
Open
2 tasks done
Labels
bug Something isn't working cross-compile Something related to cross compilation

Comments

@ravenexp
Copy link
Contributor

Bug Description

Running the above command succeeds, but shown a warning:

⚠️  Warning: Couldn't find the symbol `PyInit_testmodule` in the native library. Python will fail to import this module. If you're using pyo3, check that `#[pymodule]` uses `testmodule` as module name

I've checked the extension module with objdump, and it indeed does not export any symbols.

Building the same extension without --zig results in a working module exporting PyInit_testmodule.

Your Python version (python -V)

Python 3.10.4

Your pip version (pip -V)

pip 21.0

What bindings you're using

pyo3

Does cargo build work?

  • Yes, it works

If on windows, have you checked that you aren't accidentally using unix path (those with the forward slash /)?

  • Yes

Steps to Reproduce

  1. Build with maturin build --target x86_64-pc-windows-gnu --zig
  2. Build with maturin build --target x86_64-pc-windows-gnu
  3. The first command results in a broken module, the second command works.
@ravenexp ravenexp added the bug Something isn't working label May 17, 2022
@messense
Copy link
Member

Might be a zig issue, try search in zig's issue tracker: https://github.com/ziglang/zig/issues

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working cross-compile Something related to cross compilation
Projects
None yet
Development

No branches or pull requests

2 participants