-
Notifications
You must be signed in to change notification settings - Fork 7.3k
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
bugfix in v4.4 adds semver incompatible change to wifi_scan_config_t (IDFGH-10699) #11921
Comments
Hi @MG-96, Unfortunately we can't give stronger compatibility guarantees at the moment, such that would be sufficient for the purpose of stable Rust bindings. The best I can offer is that we could set up a scheduled CI pipeline in https://github.com/esp-rs/esp-idf-sys to get notified of any breakage quickly. (cc @ivmarkov, please comment if you have any opinion about this.) |
If indeed ESP IDF is consistently following the "if you zero-initialize the remaining (or all) fields of a configuration structure - that's OK" rule, then we have a (relatively easy way) to keep the Rust bindings (not Bindgen generates for us a What that means is that when the user (or we - in the higher level let config = esp_idf_sys::wifi_scan_config_t {
foo: 1,
bar: true,
..Default::default()
}; ... or if I understand you correctly, even this all-zeros initialization let config: esp_idf_sys::wifi_scan_config_t = Default::default(); ... would be correct and would result in ESP IDF picking meaningful defaults for all fields. The thing is - I just wasn't aware that ESP IDF is following the "0 is OK" rule consistently everywhere. Specifically for the |
@igrr ^^^ |
@ivmarkov I'm running into this as well. Is there a corresponding issue open against esp-rs/esp-idf-svc for this? |
No but there is this fix: esp-rs/esp-idf-svc@42e60e8 Can you test with latest |
@igrr I think we should close this. If you could only confirm my question here. |
I think we always handle newly introduced fields this way, but some existing fields may not support 0 as default value. As a contrived example, esp_timer_create won't be happy if we pass 0 as a value of |
I was going to suggest marking all structs in esp_idf_sys as non-exhaustive, but unfortunately that forbids constructing them with a StructExpression (including with functional update syntax). (Does Bindgen have functionality to do the non-exhaustive declaration?) Making it clear, that one always has to do a functional update to initialize structs from esp_idf_sys, or finding another solution to prevent such bugs from occurring would be nice. Thanks @igrr for clarifying things. |
My thoughts exactly, as I found out this edge case as well. And bindgen anyway does not seem to support Well, I guess the only thing we can do is put a documentation note in the |
Is there a Issue or something other to track this in Then I would close this issue here. |
Your original problem is fixed since a month or so in And yes, I think this one should be closed. |
Answers checklist.
IDF version.
v4.4
Operating System used.
Linux
How did you build your project?
Other (please specify in More Information)
If you are using Windows, please specify command line type.
None
What is the expected behavior?
(Building esp-idf with rust esp-idf-sys and esp-idf-svc in a rust project, see details below.)
Expected behavior: Building the esp-idf-sys and esp-idf-svc libary successfully.
What is the actual behavior?
Build fails because the last bugfix (4fc8964) on v4.4 introduced a breaking change.
The added field
home_chan_dwell_time
inwifi_scan_config_t
breaks the build and doesn't seem to be semver compatible.Steps to reproduce.
$ cargo build
wifi_scan_config_t
Build or installation Logs.
More Information.
No response
The text was updated successfully, but these errors were encountered: