Project

General

Profile

Actions

Task #2629

closed

tracking: Rust 2018 edition

Added by Danny Browning over 5 years ago. Updated over 3 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Target version:
Effort:
Difficulty:
Label:

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.


Related issues 3 (0 open3 closed)

Related to Suricata - Feature #2507: Make Rust mandatoryClosedJason IshActions
Related to Suricata - Feature #2314: protocol parser: rdpClosedZach KellyActions
Related to Suricata - Task #4163: rust: set new minimum Rust version for 7ClosedJason IshActions
Actions #1

Updated by Jason Ish over 5 years ago

Actions #2

Updated by Danny Browning over 5 years ago

Rust 2018 (version 1.31.0) will be available 12/6

Actions #3

Updated by Jason Ish over 5 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?

Actions #4

Updated by Danny Browning over 5 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.

Actions #5

Updated by Danny Browning about 5 years ago

Rust 1.30.0 is the first rust version that supports the edition keyword.

Actions #6

Updated by Danny Browning about 5 years ago

Rust 1.31.0 is the first rust version that edition is stable in.

Actions #7

Updated by Danny Browning about 5 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.

Actions #8

Updated by Danny Browning about 5 years ago

PR indiating required changes: https://github.com/OISF/suricata/pull/3604

Actions #9

Updated by Victor Julien about 5 years ago

  • Assignee set to OISF Dev
Actions #10

Updated by Jason Ish almost 5 years ago

  • Description updated (diff)

Copied in the Rust version chart from #2507. I think its useful for noting which distributions support Rust 2018.

Actions #11

Updated by Andreas Herz almost 5 years ago

  • Target version set to TBD
Actions #12

Updated by Victor Julien almost 5 years ago

  • Description updated (diff)
Actions #13

Updated by Victor Julien over 4 years ago

  • Description updated (diff)
Actions #14

Updated by Victor Julien over 4 years ago

  • Description updated (diff)
Actions #15

Updated by Victor Julien over 4 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.

Actions #16

Updated by Jason Ish over 4 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.

Actions #17

Updated by Victor Julien over 4 years ago

  • Tracker changed from Feature to Task
Actions #18

Updated by Danny Browning over 4 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.

Actions #19

Updated by Victor Julien over 4 years ago

  • Subject changed from Rust2018 Tracking to tracking: Rust 2018 edition
Actions #20

Updated by Jason Ish over 4 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?

Actions #21

Updated by Shivani Bhardwaj over 4 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.

Actions #22

Updated by Victor Julien over 4 years ago

  • Description updated (diff)
Actions #23

Updated by Victor Julien over 4 years ago

  • Description updated (diff)
Actions #24

Updated by Victor Julien over 4 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.

Actions #25

Updated by Victor Julien over 4 years ago

  • Status changed from New to Assigned
  • Assignee changed from OISF Dev to Jason Ish
  • Target version changed from TBD to 5.0rc1
Actions #26

Updated by Victor Julien over 4 years ago

  • Description updated (diff)
Actions #27

Updated by Victor Julien over 4 years ago

Update: FreeBSD 12 is on 1.35, so we could go for 1.34 as the minimum.

Actions #28

Updated by Zach Kelly over 4 years ago

Actions #29

Updated by Victor Julien over 4 years ago

OpenBSD 6.5 has 1.33, so I think we should consider taking 1.33 as the minimum.

Actions #30

Updated by Zach Kelly over 4 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.

Actions #31

Updated by Jason Ish over 4 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

Actions #32

Updated by Victor Julien about 4 years ago

  • Description updated (diff)
Actions #33

Updated by Victor Julien almost 4 years ago

  • Description updated (diff)
Actions #34

Updated by Victor Julien over 3 years ago

  • Description updated (diff)
Actions #35

Updated by Victor Julien over 2 years ago

  • Related to Task #4163: rust: set new minimum Rust version for 7 added
Actions

Also available in: Atom PDF