Task #2629
closedtracking: Rust 2018 edition
Description
Rust 2018 Edition will be stabilized/finalized at some point in the next few months. This issue is meant to be a tracking issue to determine what support is available for Rust 2018 in OS's supported by Suricata, to determine when it is appropriate to move to 2018 edition.
More information on editions: https://rust-lang-nursery.github.io/edition-guide/editions/index.html
Rust 2018 RC Milestone: https://github.com/rust-lang/rust/milestone/54
Rust 2018 Release Milestone: https://github.com/rust-lang/rust/milestone/55
Rust 2018 Tracking Issue: https://internals.rust-lang.org/t/rust-2018-the-home-stretch/7810
Current target is 10/25 for Rust 2018 (Rust 1.30)
One of the most significant changes for 2018 is changes to how crates, modules, and macros are found. Although much easier to use, this will produce a bit of churn in the Suricata rust code. Commit representing the churn involved: https://github.com/dbcfd/suricata/commit/33694e63dbbfc221ffda2882727b4fe431d9375e
The borrow checker has been improved as well, so some things that were safe before but compiler errors will now work with the NLL based borrow checker. Other things that may have worked but were unsafe should now be caught.
OS/Distribution | Version | Rust Version | Supported | Notes |
---|---|---|---|---|
CentOS | 6 | -- | No | Rust can be install manually |
CentOS | 7 | 1.43.1 | Yes | Requires EPEL |
CentOS | 8 | 1.39.0 | Yes | |
Debian | 9 | 1.34.2 | Yes | will be EOL ~2020, in LTS state until ~2022 (https://wiki.debian.org/DebianReleases) |
Debian | 10 | 1.34.2 | Yes | |
Fedora | 30+ | 1.43.1 | Yes | |
Ubuntu | 16.04 | 1.41.0 | Yes | |
Ubuntu | 18.04 | 1.41.0 | Yes | |
FreeBSD | 11.2 | 1.42.0 | Yes | pkg install rustc cargo |
FreeBSD | 12.0 | 1.42.0 | Yes | pkg install rustc cargo |
OpenBSD | 6.6 | 1.38 | Yes | |
OpenBSD | 6.7 | 1.42 | Yes | |
MinGW | ?? | 1.43.0 | ?? | Can be installed through pacman |
Note #4163 contains a more up to date version of this table.
Updated by Jason Ish about 6 years ago
- Related to Feature #2507: Make Rust mandatory added
Updated by Danny Browning almost 6 years ago
Rust 2018 (version 1.31.0) will be available 12/6
Updated by Jason Ish almost 6 years ago
Danny Browning wrote:
One of the most significant changes for 2018 is changes to how crates, modules, and macros are found. Although much easier to use, this will produce a bit of churn in the Suricata rust code. Commit representing the churn involved: https://github.com/dbcfd/suricata/commit/33694e63dbbfc221ffda2882727b4fe431d9375e
I wonder if any of these changes can be made while also support Rust 1.24.1, the oldest we currently should still support?
Updated by Danny Browning almost 6 years ago
I'm hoping that minimum version will go higher with the release of 2018 edition. But after making the 2018 edition changes, I will attempt with older compiler versions (up to 1.24.1) and see at what version it breaks.
Updated by Danny Browning almost 6 years ago
Rust 1.30.0 is the first rust version that supports the edition keyword.
Updated by Danny Browning almost 6 years ago
Rust 1.31.0 is the first rust version that edition is stable in.
Updated by Danny Browning almost 6 years ago
When using `cargo fix --edition` the first rustc that will work is 1.30.0. If we want to enable edition features, users needs 1.31.0.
Updated by Danny Browning almost 6 years ago
PR indiating required changes: https://github.com/OISF/suricata/pull/3604
Updated by Victor Julien over 5 years ago
With Debian 10s release Rust 2018 is available on all major distros. We do need to decide how long Debian 9 remains important. We know that no 5.0 will be made available for it through its own channels, so the question is if/when we think its reasonable to either push ppl to 10 or to tell them to install Rust from other channels like rustup.
Updated by Jason Ish over 5 years ago
Victor Julien wrote:
With Debian 10s release Rust 2018 is available on all major distros. We do need to decide how long Debian 9 remains important. We know that no 5.0 will be made available for it through its own channels, so the question is if/when we think its reasonable to either push ppl to 10 or to tell them to install Rust from other channels like rustup.
If it will never be made available through proper Debian channels, I'm of the opinion we don't have to worry about it.
Updated by Danny Browning over 5 years ago
The current rust version looks to be a blocker for https://github.com/OISF/suricata/pull/3971 since the toml crate uses the edition keyword.
Updated by Victor Julien over 5 years ago
- Subject changed from Rust2018 Tracking to tracking: Rust 2018 edition
Updated by Jason Ish over 5 years ago
Danny Browning wrote:
The current rust version looks to be a blocker for https://github.com/OISF/suricata/pull/3971 since the toml crate uses the edition keyword.
It might be OK to require newer versions to build from git, where cbindgen is required, and make a dist. But then could 1.24 still build it assuming the generated headers were included already?
Updated by Shivani Bhardwaj over 5 years ago
Keeping a note: Got to remove the "ellipsis_inclusive_range_pattern" mentioned in https://redmine.openinfosecfoundation.org/issues/3072 when we switch to the 2018 edition.
Done.
Updated by Victor Julien about 5 years ago
It looks like all the major OS' we care about either updated Rust to a 2018 capable version, or released a new OS version that contains a 2018 capable version. Other than CentOS6 which doesn't support Rust at all through their packaging, only OpenBSD 6.4 and Debian 9 would have to switch from their own packaged Rust to rustup. Both have a newer version out that is new enough (Debian 10 and OpenBSD 6.5 respectively).
So I guess for Suricata 5.0 it is time to bump the minimal Rust version. Probably to 1.33 as that is the current version on FreeBSD 12 it seems.
Updated by Victor Julien about 5 years ago
- Status changed from New to Assigned
- Assignee changed from OISF Dev to Jason Ish
- Target version changed from TBD to 5.0rc1
Updated by Victor Julien about 5 years ago
Update: FreeBSD 12 is on 1.35, so we could go for 1.34 as the minimum.
Updated by Zach Kelly about 5 years ago
- Related to Feature #2314: protocol parser: rdp added
Updated by Victor Julien about 5 years ago
OpenBSD 6.5 has 1.33, so I think we should consider taking 1.33 as the minimum.
Updated by Zach Kelly about 5 years ago
As a side note, I have had trouble generally building 2018 code with rustc 1.31.1, including some of the dependencies in PR 4131 https://github.com/OISF/suricata/pull/4131. rustc 1.33 was mentioned as a candidate minimum, which is comfortably above that.
Updated by Jason Ish about 5 years ago
- Status changed from Assigned to Closed
The minimum Rust version has been updated to 1.33 allowing us to make use of Rust 2018. Additionally, a "cargo fix" has been run for an initial conversion to Rust 2018.
Rust update PR:
https://github.com/OISF/suricata/pull/4141
Cargo fix commit:
https://github.com/OISF/suricata/commit/42e5065ab888e6a7624f40cf7d09dd415401a990
Updated by Victor Julien almost 3 years ago
- Related to Task #4163: rust: set new minimum Rust version for 7 added