-
Notifications
You must be signed in to change notification settings - Fork 2
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
Bump Rustler to 0.34.0 in Cargo.toml (not 0.35.0), IOW, downgrade in mix.exs #69
Conversation
Since we use NIF version to 2.15 (default of Rustler) and does not use `enif_get_type`, the option `default-features = false` is not needed. See: https://hexdocs.pm/rustler/upgrade.html#0-29-0-30 ``` 4. The default NIF version is raised to 2.15 to make use of enif_get_type. To use a compiled NIF with an older version than OTP22, disable the default features and expliictly use the nif_version_2_14 feature in the library's Cargo.toml: ```
…ler 0.34.0 See: https://hexdocs.pm/rustler/upgrade.html#0-33-0-34 ``` 2. The functionality related to the derive feature is now unconditionally active. The feature flag is kept for compatibility for now but will be removed in the future. ```
I have confirmed that bump to 0.34.0 works fine. However, some warnings have occurred.
|
I guess the resource registration method may be changed, but cannot find how to upgrade,,, |
See: https://hexdocs.pm/rustler/upgrade.html#0-33-0-34 ``` 1. NIF implementations are now discovered automatically, the respective argument in the rustler::init! macro should be removed. If a NIF implementation should not be exported, it must be disabled with a #[cfg] marker. ``` Compilation log to be removed: ``` warning: use of deprecated constant `rustler_init::explicit_nif_functions`: Passing NIF functions explicitly is deprecated and this argument is ignored, please remove it --> src/lib.rs:59:5 | 59 | / [ 60 | | zenoh_open, 61 | | session::declare_publisher, 62 | | session::declare_subscriber, ... | 83 | | keyexpr::key_expr_intersects, 84 | | ], | |_____^ | = note: `#[warn(deprecated)]` on by default ```
9a0fc7e
to
9b22da8
Compare
With the help of the following various information, I have made modifications to 1b87285. As a result, I succeeded in removing the compile-time warning message in Rustler 0.34.0. I initially thought L55 in lib.rs should be written as follows.
However, another warning message appeared.
By following this, I decided to write using For now, we use However, we have already used OTP 26, so I think it is better to use |
You are right. You need to use them like followings, fn load(env: Env, _term: Term) -> bool {
env.register::<SessionRef>().is_ok()
&& env.register::<PublisherRef>().is_ok()
&& env.register::<SubscriberRef>().is_ok()
&& env.register::<PullSubscriberRef>().is_ok()
&& env.register::<QueryableRef>().is_ok()
&& env.register::<ReplyReceiverRef>().is_ok()
&& env.register::<QueryRef>().is_ok()
&& env.register::<SampleRef>().is_ok()
}
|
I'd like to conclude that bumping Rustler to 0.35.0 is not cost-effective and difficult at this time, and that a response to 0.34.0 is sufficient for this PR (now). Bumping Rustler to 0.35.0 caused many inexplicable compile errors. I guess that these are probably due to that the transition from async-std to Tokio was not yet complete in Zenoh 0.11.0. I have experimentally tried Zenoh 1.0.0 along with Rustler 0.35.0; most of the errors seemed not appear at that time (although many other compile errors happened, so we will have to work on resolving them). IOW, please review @s-hosoai if this PR is acceptable or not 🙏 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@takasehideki Thank you for the PR. The modifications you made are fine.
Additionally, please update the Rustler version in mix.exs. If this PR is upgrading to v0.3.1, please adjust the version accordingly.
@s-hosoai sorry I can’t catch up what you want me to do,,, Rustler in mix.lock has already bumped to 0.3.5 by dependabot. You mean this should adjust to 0.3.4? I agree with your this suggestion and will treat it. Line 23 in c3f45e7
#61 Or you mean Zenohex should bump to 0.3.1 in this PR too? I don’t think so, The bump to this library itself should be treated in the separate PR like the below. |
e288e6c
to
240edf8
Compare
240edf8
to
d64faa0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The intention was to lock the version to 0.34. Your fix is perfect!
I also agree with handling the Zenohex version upgrade in a separate PR.
go merging! I will create another PR to release Zenohex 0.3.1. |
This version is compatible [with Zenoh 0.11.0](https://github.com/eclipse-zenoh/zenoh/releases/tag/0.11.0) * Add cargo of NIF module to dependabot target by @takasehideki in #62 * Bump Rustler to 0.34.0 in Cargo.toml (not 0.35.0), IOW, downgrade in mix.exs by @takasehideki in #69 * Bump credo from 1.7.7 to 1.7.8 by @dependabot in #63 * Bump dialyxir from 1.4.3 to 1.4.4 by @dependabot in #65 * Bump futures from 0.3.30 to 0.3.31 in /native/zenohex_nif by @dependabot in #64 * Bump rustler_precompiled from 0.7.1 to 0.8.2 by @dependabot in #60 * Bump ex_doc from 0.34.1 to 0.34.2 by @dependabot in #55 * Bump flume from 0.11.0 to 0.11.1 in /native/zenohex_nif by @dependabot in #66 * Bump credo from 1.7.8 to 1.7.10 by @dependabot in #72 **Full Changelog**: v0.3.0...v0.3.1
This PR is trying to bump Rustler in Cargo.toml to 0.35.0. Also see #68Note that this is now working in progress, since we are trying to bump it step by step by referring upgrade guide of Rustler.
As a result, we decided to bump Rustler in Cargo.toml to 0.34.0, not 0.35.0, in this PR.
The bump to 0.35.0, the current latest version, will be made after Zenoh's update to v1.0.0 first (#59), and then continued in #68.