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

Building with MSRV on PyO3 0.12.2 fails on wrap_pyfunction! #1232

Closed
mtreinish opened this issue Oct 12, 2020 · 2 comments
Closed

Building with MSRV on PyO3 0.12.2 fails on wrap_pyfunction! #1232

mtreinish opened this issue Oct 12, 2020 · 2 comments

Comments

@mtreinish
Copy link
Contributor

🐛 Bug Reports

When reporting a bug, please provide the following information. If this is not a bug report you can just discard this template.

🌍 Environment

  • Your operating system and version: Linux
  • Your python version: 3.8
  • How did you install python (e.g. apt or pyenv)? Did you use a virtualenv?: distro package
  • Your Rust version (rustc --version): 1.39.0
  • Your PyO3 version: 0.12.2
  • Have you tried using latest PyO3 master (replace version = "0.x.y" with git = "https://github.com/PyO3/pyo3")?: No (since the release came out just a few minutes ago)

💥 Reproducing

Trying to upgrade my project to use the latest pyo3 and rust-numpy in Qiskit/rustworkx#139 I'm hitting a failure on the MSRV job:

https://github.com/Qiskit/retworkx/pull/139/checks?check_run_id=1244122021#step:6:255

error[E0658]: procedural macros cannot be expanded to expressions
   --> src/generators.rs:527:19
    |
527 |     m.add_wrapped(wrap_pyfunction!(cycle_graph))?;
    |                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: for more information, see https://github.com/rust-lang/rust/issues/54727
    = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)

All the uses of m.add_wrapped(wrap_pyfunction!( is failing to compile with the same error. This works fine on rust 1.47.0, and only fails in the msrv job. I've not changed any code in the module setup around wrapping pyfunctions and it works fine on 0.11.1 with 1.39.0.

@mtreinish mtreinish changed the title Building with MSRV fails on wrap_pyfunction! Building with MSRV on PyO3 0.12.2 fails on wrap_pyfunction! Oct 12, 2020
@davidhewitt
Copy link
Member

davidhewitt commented Oct 12, 2020

Hmm, thanks for reporting. This is almost certainly caused by #1204, which passes on our CI. Let me see if I can figure out why, and release a fix...

@davidhewitt
Copy link
Member

Fixed in #1234

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

2 participants