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

Trivial example requires python-headers feature to build #175

Closed
cdata opened this issue Jul 26, 2023 · 2 comments · Fixed by #183
Closed

Trivial example requires python-headers feature to build #175

cdata opened this issue Jul 26, 2023 · 2 comments · Fixed by #183
Assignees
Labels
K-bug Kind: existing code isn’t behaving as expected

Comments

@cdata
Copy link

cdata commented Jul 26, 2023

Hello, one of my projects makes extensive use of safer-ffi. Thank you so much for making it available for general consumption; we love it.

Recently I compiled against v0.1.2 of the safer-ffi package and noticed a regression compared to the version we had been using (v0.1.0-rc.1). Specifically, we were seeing this compiler error on a number of our exports:

error[E0425]: cannot find value `Python` in module `languages`
 --> src/main.rs:3:1
  |
3 | #[ffi_export]
  | ^^^^^^^^^^^^^ not found in `languages`
  |
  = note: this error originates in the attribute macro `ffi_export` (in Nightly builds, run with -Z macro-backtrace for more info)

Poking around, I noticed that the codegen was indeed referencing a variant that was only available in safer-ffi conditionally. Adding the python-headers feature flag to safer-ffi "fixed" the problem by making the variant available.

I have made a reduced test case of this problem here: https://github.com/cdata/safer-ffi-fail-case

The test case is currently in a broken state. If you add the python-headers feature to the safer-ffi dependency, you will see that the package can build.

We do intend to write Python bindings eventually so this isn't a blocker for us or anything, but it smelled like unintended behavior so I figured I should report it.

@danielhenrymantilla danielhenrymantilla added the K-bug Kind: existing code isn’t behaving as expected label Jul 26, 2023
@danielhenrymantilla
Copy link
Collaborator

Thanks for the report! Will look into this in the following days; although I'm pretty busy atm so the fix may take until Monday. Is downgrading to the previous version an option for you to stall in the meantime, or is this urgent?

@cdata
Copy link
Author

cdata commented Jul 26, 2023

It's not urgent at all; we are not blocked by this issue AFAICT. I'll let you know if I realize we are 😅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
K-bug Kind: existing code isn’t behaving as expected
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants