Project

General

Profile

Task #2629

tracking: Rust 2018 edition

Added by Danny Browning about 1 year ago. Updated about 1 month 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.36.0 Yes Requires EPEL
Debian 9 1.24.1 Yes will be EOL ~2020, in LTS state until ~2022 (https://wiki.debian.org/DebianReleases)
Debian 10 1.34.2 Yes
Fedora 29+ 1.36.0 Yes
Ubuntu 14.04 1.31.0 Yes Will be EOL before Suricata 5
Ubuntu 16.04 1.35.0 Yes
Ubuntu 18.04 1.35.0 Yes
FreeBSD 11.2 1.35.0 Yes pkg install rustc cargo
FreeBSD 12.0 1.35.0 Yes pkg install rustc cargo
OpenBSD 6.4 1.29.2 Yes Rust is in ports; next OpenBSD will have 1.33+
OpenBSD 6.5 1.33 Yes
MinGW ?? 1.37.0 ?? Can be installed through pacman

Related issues

Related to Feature #2507: Make Rust mandatoryClosedActions
Related to Feature #2314: protocol parser: rdpClosedActions

History

#1

Updated by Jason Ish about 1 year ago

#2

Updated by Danny Browning 11 months ago

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

#3

Updated by Jason Ish 11 months 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?

#4

Updated by Danny Browning 11 months 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.

#5

Updated by Danny Browning 10 months ago

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

#6

Updated by Danny Browning 10 months ago

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

#7

Updated by Danny Browning 10 months 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.

#8

Updated by Danny Browning 10 months ago

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

#9

Updated by Victor Julien 7 months ago

  • Assignee set to OISF Dev
#10

Updated by Jason Ish 6 months ago

  • Description updated (diff)

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

#11

Updated by Andreas Herz 4 months ago

  • Target version set to TBD
#12

Updated by Victor Julien 4 months ago

  • Description updated (diff)
#13

Updated by Victor Julien 3 months ago

  • Description updated (diff)
#14

Updated by Victor Julien 3 months ago

  • Description updated (diff)
#15

Updated by Victor Julien 3 months 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.

#16

Updated by Jason Ish 3 months 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.

#17

Updated by Victor Julien 3 months ago

  • Tracker changed from Feature to Task
#18

Updated by Danny Browning 3 months 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.

#19

Updated by Victor Julien 3 months ago

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

Updated by Jason Ish 3 months 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?

#21

Updated by Shivani Bhardwaj 3 months 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.

#22

Updated by Victor Julien 2 months ago

  • Description updated (diff)
#23

Updated by Victor Julien 2 months ago

  • Description updated (diff)
#24

Updated by Victor Julien about 2 months 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.

#25

Updated by Victor Julien about 2 months ago

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

Updated by Victor Julien about 2 months ago

  • Description updated (diff)
#27

Updated by Victor Julien about 2 months ago

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

#28

Updated by Zach Kelly about 2 months ago

#29

Updated by Victor Julien about 2 months ago

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

#30

Updated by Zach Kelly about 2 months 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.

#31

Updated by Jason Ish about 1 month 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

Also available in: Atom PDF