Skip to content
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

Compile with stable Rust #19

Open
SergioBenitez opened this Issue Oct 21, 2016 · 35 comments

Comments

Projects
None yet
@SergioBenitez
Copy link
Owner

SergioBenitez commented Oct 21, 2016

The following features need to be stabilized before Rocket can compile on stable:

The following features are currently used by Rocket but do not need to be stabilized before Rocket can compile on stable because their use in Rocket can somewhat easily be removed:

Update (Feb 07, 2017): Added list of features used by Rocket.
Update (Feb 28, 2017): Added lookup_host feature.
Update (Mar 21, 2017): pub_restricted was stabilized!
Update (Mar 30, 2017): Added never_type feature.
Update (Apr 16, 2017): Added concat_idents feature.
Update (May 19, 2017): Added struct_field_attributes and more_io_inner_methods features.
Update (May 19, 2017): concat_idents is no longer used.
Update (May 19, 2017): Added links to tracking issues.
Update (May 20, 2017): type_ascription is no longer used.
Update (Jun 19, 2017): struct_field_attributes was stabilized!
Update (Jun 24, 2017): Added try_trait feature.
Update (Jul 1, 2017): more_io_inner_methods was stabilized!
Update (Jul 9, 2017): associated_consts was stabilized!
Update (Sep 7, 2017): lookup_host is no longer used.
Update (Sep 14, 2017): drop_types_in_const was stabilized!
Update (Sep 14, 2017): Added decl_macro feature.
Update (Mar 26, 2018): conservative_impl_trait, never_type, and i128_type were stabilized!
Update (Apr 22, 2018): Added fnbox feature.
Update (Apr 26, 2018): never_type stabilization was reverted (rust-lang/rust#50121).
Update (May 5, 2018): Swapped macro_reexport for use_extern_macros.
Update (Jul 29, 2018): Added crate_visibility_modifier and try_from features.
Update (Aug 5, 2018): custom_derive is no longer used.
Update (Aug 17, 2018): use_extern_macros was stabilized!
Update (Sep 3, 2018): const_fn is no longer used
Update (Sep 26, 2018): Added label_break_value feature.
Update (Oct 9, 2018): Removed compiler plugin features (custom_attribute, plugin).
Update (Oct 9, 2018): Updated proc_macro features.
Update (Mar 9, 2019): try_from was stabilized!

@SergioBenitez SergioBenitez added this to the 0.1.0 milestone Oct 21, 2016

@SergioBenitez SergioBenitez modified the milestones: 1.0, 0.1.0 Dec 6, 2016

@steveklabnik

This comment has been minimized.

Copy link

steveklabnik commented Dec 23, 2016

Looks like this primarily depends on rust-lang/rust#38356

(Or syntex)

@rrichardson

This comment has been minimized.

Copy link

rrichardson commented Dec 23, 2016

Syntex should get this onto stable much more quickly, since the macros > 1.1 effort seems to be just beginning to congeal.

https://news.ycombinator.com/item?id=13245975

@steveklabnik

This comment has been minimized.

Copy link

steveklabnik commented Dec 23, 2016

since the macros > 1.1 effort seems to be just beginning to congeal.

This needs more than macros 1.1, it needs 2.0. (If it only needed 1.1, then it could go stable in 1.15)

@rrichardson

This comment has been minimized.

Copy link

rrichardson commented Dec 23, 2016

I intended > 1.1 to indicate "after 1.1" but that wasn't very clear.
I've seen the procedural macros effect referenced as 1.2 as well as 2.0. 2.0 does make more sense, since it is a much broader scope, as I understand it.

@mgattozzi

This comment has been minimized.

Copy link

mgattozzi commented Dec 23, 2016

I've started working on getting syntex to work with this until macros are stabilized (which might be a while). I've got time over the holidays from work so I'll post any progress I make!

@SergioBenitez

This comment has been minimized.

Copy link
Owner Author

SergioBenitez commented Dec 23, 2016

Rocket uses much more than just plugins from nightly. The set of features Rocket currently uses are:

#![feature(plugin)]
#![feature(custom_derive)]
#![feature(custom_attribute)]
#![feature(specialization)]
#![feature(conservative_impl_trait)]
#![feature(drop_types_in_const)]
#![feature(associated_consts)]
#![feature(const_fn)]

These uses are important and contribute to the pithiness of the API, so they will stick around until they're stabilized. Until then, I don't believe Rocket will run on stable.

With that being said, I believe that the ergonomics of syntex are very poor, and I don't want to recommend a subpar solution to users. I'm all for getting Rocket to work on stable as soon as possible, but I'm not willing to compromise ergonomics and usability to make that happen.

@beefsack

This comment has been minimized.

Copy link

beefsack commented Dec 24, 2016

I'm all for getting Rocket to work on stable as soon as possible, but I'm not willing to compromise ergonomics and usability to make that happen.

I'd love to see it go stable as soon as possible, but I feel you've got the right values for the project. Accessibility is arguably more important for web frameworks than it is for other frameworks and libraries.

@mgattozzi

This comment has been minimized.

Copy link

mgattozzi commented Dec 24, 2016

Just from trying to get it to work with syntex it's hard. I might try some more this week but you're right. It might just be worth it to wait till those features stabilize.

@tbu-

This comment has been minimized.

Copy link

tbu- commented Apr 6, 2017

The lookup_host feature can be replaced by the ToSocketAddrs implementation of &str.

@FractalMatt

This comment has been minimized.

Copy link

FractalMatt commented May 1, 2017

Perhaps you could use something like:
https://github.com/Kimundi/rustc-version-rs

In order to allow stable features to compile using stable, but features that require nightly or beta could be used only when compiling from that branch.

Currently using Iron myself and would love to switch but it's a high security project and for security reasons, I want to avoid Rust nightly.

@FractalMatt

This comment has been minimized.

Copy link

FractalMatt commented Oct 21, 2017

It's been a year since this post originally... seems the check boxes in the original post are accurate?

Seems to me like getting Rocket out of nightly would be a huge boost for Rust in general but especially for Rocket.. the Rocket team or Rust team should really focus on stabilizing these functions (or finding alternatives?).

Why so slow to get there? Have you run this by the Rust higher ups and pushed them a little bit?

@est31

This comment has been minimized.

Copy link

est31 commented Mar 27, 2018

i128 just got stabilized will ship in Rust 1.27.0.

@tsal

This comment has been minimized.

Copy link

tsal commented Apr 18, 2018

I'm really looking forward to using Rocket in production some day, I'm glad to see there's been some progress recently. :)

@messense

This comment has been minimized.

Copy link
Contributor

messense commented May 2, 2018

macro_reexport is now removed(not in nightly yet, incoming breaking change) and subsumed by feature(use_extern_macros) and pub use

rust-lang/rust#49982

@maxdeviant

This comment has been minimized.

Copy link
Contributor

maxdeviant commented May 3, 2018

@messense PR #624 should handle those changes.

@mentalbrew

This comment has been minimized.

Copy link

mentalbrew commented Jul 8, 2018

The Rust community is currently in a major push toward releasing the Rust 2018 Edition. Has anybody investigated whether enough features that Rocket depends on in nightly will be available in that edition that the Rocket community could target that release for stable? It seems like it would be a win-win for both efforts if it was remotely feasible.

@jebrosen

This comment has been minimized.

Copy link
Collaborator

jebrosen commented Jul 8, 2018

I glanced at the 2018 feature status and most of the important ones for Rocket are not listed:

  • const_fn
  • decl_macro
  • never_type
  • proc_macro, and several related features such as proc_macro_non_items
  • specialization, which can apparently be worked around, but might be problematic to drop for existing rocket users

That does not necessarily mean that these features will not be stabilized this year, just that they are not being targeted as part of the Edition. async/await, however, is listed, and says 2018 will be the minimum edition. Depending on what async solution is implemented, Rocket might target the 2018 edition to make use of those ergonomics.

That being said, editions are cross-crate compatible. Whether Rocket ends up targeting the 2015 or 2018 edition should not significantly affect projects that use it.

@est31

This comment has been minimized.

Copy link

est31 commented Jul 8, 2018

Just noting, proc_macro is in the process of being stabilized: rust-lang/rust#52081

@SergioBenitez

This comment has been minimized.

Copy link
Owner Author

SergioBenitez commented Jul 9, 2018

@est31 Unfortunately, the stabilizing subset is extremely limited and insufficient for Rocket's needs.

@cauebs

This comment has been minimized.

Copy link

cauebs commented Jul 13, 2018

Now there's an easier way to keep track of these things: https://forge.rust-lang.org/state-of-rust.html

@bestouff

This comment has been minimized.

Copy link

bestouff commented Jul 27, 2018

Either way it'd be nice to have a "tentative ETA" for stable Rocket. Even if it's "don't expect less than 2 years" that could help a lot people who might want to select it but wonder about how long they have to suffer in nightly.

@FractalMatt

This comment has been minimized.

Copy link

FractalMatt commented Aug 26, 2018

@SergioBenitez You should really reach out to the Rust team and ask for them to prioritize these issues, tell them it's holding up release of Rocket. Or maybe someone can volunteer to help fix these issues if they'll help point you in the right direction?

I know that getting Rocket-like web servers was being listed as a high priority for getting Rust adoption and Rocket looks like an otherwise amazing one.

Team can be found here:
https://www.rust-lang.org/en-US/team.html

Have communicated with Brian in the past who seemed particularly good at responding and helping us out on a far less important issue:
https://github.com/brson

@0xcaff

This comment has been minimized.

Copy link

0xcaff commented Aug 26, 2018

FYI, if you don't want to wait to build web services in rust, check out actix. It works on stable rust.

@dataf3l

This comment has been minimized.

Copy link

dataf3l commented Sep 28, 2018

@0xcaff After trying multiple web frameworks, I have to say really like Rocket.
Iron, unfortunately, didn't do it for me...

I'm grateful for the efforts made by the iron team, and I value open source contributor's time as much as the next guy, but for me, I think Rocket suits fits my needs better.

@ErichDonGubler

This comment has been minimized.

Copy link

ErichDonGubler commented Oct 1, 2018

proc_macro has been split into several subtasks -- which one(s) does Rocket depend on?

EDIT: Thanks!

@Xaeroxe

This comment has been minimized.

Copy link

Xaeroxe commented Nov 2, 2018

The following workaround has been used by the Amethyst game engine for the absence of a never type

pub enum Never {}

This type can't be instantiated and thus fills the same purpose.

@BanjoFox

This comment has been minimized.

Copy link

BanjoFox commented Nov 3, 2018

Very happy to see this progressing!
Team Aardwolf appreciates your hard work :D

@jhpratt

This comment has been minimized.

Copy link

jhpratt commented Dec 9, 2018

Given the recent blogpost, shouldn't the milestone on this be 0.5?

@est31

This comment has been minimized.

Copy link

est31 commented Dec 19, 2018

@incubus8 see this blog post for details on the plans: https://rocket.rs/v0.4/news/2018-12-08-version-0.4/

@incubus8

This comment has been minimized.

Copy link

incubus8 commented Dec 20, 2018

gotcha, sorry for the fuzz

@incubus8 see this blog post for details on the plans: https://rocket.rs/v0.4/news/2018-12-08-version-0.4/

@macpp

This comment has been minimized.

Copy link

macpp commented Jan 13, 2019

Just noting: on the latest nightly uniform_paths were stabilised, together with ability to export macro_rules from modules:

mod foo {
    macro_rules! bar123 { () => {} }
    pub(crate) use bar123 as bar;
}
foo::bar!();

It seems that it may be possible to remove decl_macro feature ( when targeting 2018 edition)

@jebrosen

This comment has been minimized.

Copy link
Collaborator

jebrosen commented Jan 13, 2019

It seems that it may be possible to remove decl_macro feature ( when targeting 2018 edition)

I played with the new export functionality you mention; it's unfortunate that it only works when the application crate targets 2018. I think it would be acceptable to implement the change if 2018 is required for another reason (e.g. async/await). But I wouldn't want to break compatibility with 2015 edition just to avoid decl_macro unless it's the only feature blocking stable, and maybe not even then.

@Centril

This comment has been minimized.

Copy link

Centril commented Mar 8, 2019

@jebrosen I would suggest avoiding long term reliance on decl_macro; I don't think the language team has any bandwidth to devote the substantial time that decl_macro requires to stabilize it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.