Repository navigation
Compile with stable Rust #19
Description
The following features need to be stabilized before Rocket can compile on stable:
- proc_macro_hygiene (Tracking issue for procedural macros and "hygiene 2.0" rust-lang/rust#54727)
- associated_consts (Tracking issue for
associated_constsfeature rust-lang/rust#29646) - conservative_impl_trait (Tracking issue for
impl Trait(RFC 1522, RFC 1951, RFC 2071) rust-lang/rust#34511) - drop_types_in_const (permit
Droptypes in constants (tracking issue for RFC #1440) rust-lang/rust#33156) - more_io_inner_methods (Tracking issue for 'more_io_inner_methods' rust-lang/rust#41519)
- pub_restricted (Tracking issue for
pub(restricted)privacy (RFC #1422) rust-lang/rust#32409) - struct_field_attributes (Tracking issue for struct_field_attributes rust-lang/rust#41681)
- use_extern_macros (Tracking issue for "macro naming and modularisation" (RFC #1561) rust-lang/rust#35896)
- fn_box (Tracking issue for FnBox() rust-lang/rust#28796)
- try_from (Tracking issue for TryFrom/TryInto traits rust-lang/rust#33417)
The following dependencies rely on nightly features and must be updated before Rocket can compile on stable:
-
pear(SergioBenitez/Pear@333c9bf)
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!
Update (Apr 13, 2019): fnbox is no longer used.
Update (Jul 9, 2019): never_type is no longer used.
Update (Jul 19, 2019): decl_macro is no longer used.
Update (Sep 9, 2019): specialization is no longer used.
Update (Sep 10, 2019): label_break_value is no longer used.
Update (Sep 18, 2019): try_trait is no longer used.
Update (Sep 21, 2019): crate_visibility_modifier is no longer used.
Update (May 19, 2020): proc_macro_hygiene was stabilized!
Update (Jul 16, 2020): proc_macro_diagnostics is no longer used.
Update (Jul 16, 2020): proc_macro_span is no longer used.
Update (Jul 21, 2020): pear was updated to be stable-compatible.
Activity
steveklabnik commentedon Dec 23, 2016
Looks like this primarily depends on rust-lang/rust#38356
(Or syntex)
rrichardson commentedon 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 commentedon Dec 23, 2016
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 commentedon Dec 23, 2016
I intended
> 1.1to 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 commentedon Dec 23, 2016
I've started working on getting
syntexto 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 commentedon Dec 23, 2016
Rocket uses much more than just plugins from nightly. The set of features Rocket currently uses are:
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
syntexare 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 commentedon Dec 24, 2016
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 commentedon 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- commentedon Apr 6, 2017
The
lookup_hostfeature can be replaced by theToSocketAddrsimplementation of&str.FlogramMatt commentedon 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.
FlogramMatt commentedon 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?
messense commentedon Mar 23, 2018
never_type will be stabilized in Rust 1.26.0.95 remaining items
PAStheLoD commentedon Dec 1, 2020
An IT system doesn't become "production ready" just because it has the name stable, nor does it become non-prod ready just because some component has "nightly" in its version string somewhere.
Inquiring about "when something will be done" or "why it's not done already" in a free & open source project will almost always result in someone (in this instance it's me) responding with "when someone does it" or "patches welcome".
jcbritobr commentedon Dec 1, 2020
This is only a hispster project XD. Just for fun. I was wrong.
schrieveslaach commentedon Dec 1, 2020
@jcbritobr, in the chat people are talking about the next release that is coming soon. So if we are a little bit patient, everything is fine.
viniciusd commentedon Dec 1, 2020
Chill @jcbritobr, there is no need to be [passive-]aggressive here, dude.
I understand you might be confused by the naming of the toolchains (stable vs nightly). I acknowledge they are indeed misleading.
Feel free to check the Rust release process at https://forge.rust-lang.org/release/process.html
Nightly indeed comes from the master branch and it may introduce regressions (and it sporadically does), but the nightly "instability" is not about this. Stability is about the APIs, not about the compiler introducing bugs or breaking someone's code.
If your application compiles in a specific nightly version, there should not be any problem just because it is nightly. As long as it compiles, in general, you should be safe.
— Oh, but if it runs on nightly, my build will not be reproducible and it will change every day, oh noes!
Yeah,
nightlyitself will change, but it is completely possible to pin a specific nightly version, e.g., 2020-11-30's nightly version! There is no need to be afraid of your toolchain changing without you knowing.Finally, I am aware of a multitude of projects running Rocket in production. Using nightly does not make a project unstable, nor not-production-ready nor hipster as you said.
Feel free to reach out via the chat or other means if you require further clarification :)
P.S.: I am not aware of any of the contributors being paid to develop Rocket, so it is rough to impose priorities
jcbritobr commentedon Dec 1, 2020
Hello. I'm not being passive/agressive. Look up these answers above. I only think bugs and stability comes first of new features. Postpone rocket on stable rust doesn't seems to be an intelligent decision. Nightly rust isn't stable rust, but if you guys think so very well. For me, its a hispter atitude. Just like for fun. Nothing to really help or agreggate the project.
blackghost1987 commentedon Dec 1, 2020
@jcbritobr the latest version of Rocket is already using Stable Rust! This is done already, that's why this issue is Closed, you are knocking on open doors. We are just waiting for the next Rocket release (0.5), because this is a breaking change.
It will be done shortly, the release depends on a couple more stuff though, compiling on Stable is just ONE of the new features, the list of the in-progress things can be found here:
https://github.com/SergioBenitez/Rocket/issues?q=is%3Aopen+is%3Aissue+milestone%3A0.5.0
Also there's another question about the expected time of the release here: #1476
As you can see SergioBenitez commented in November that he expects an RC for 0.5 to be released by the end of the month. It's only the 1st of December, so I think we can all be a little more patient with this.
In the meantime you can use Rocket from the master branch with Stable Rust. Or maybe help with one of the ongoing issues in the Milestones section to make the release happen faster.
montdidier commentedon Feb 26, 2021
I kind of understand your point, but the reality is that that point of view is not widely shared, or even considered. The nomenclature is no doubt intended to have semantic meaning, and packaging crew working on numerous linux and BSD distributions see it exactly this way (i.e. nightly is not intended for production). For somebody trying to get projects based on rocket into packages destined for various distributions this is a significant hurdle. I've had this problem with Alpine Linux and with OpenBSD just this month.
PAStheLoD commentedon Mar 2, 2021
Could you give examples of those projects?
Are many people using those projects with OpenBSD? OpenBSD is a very security-focused project, it's conservative in its scope, prefers simple instead of fast and fancy. If the OpenBSD maintainers feel they don't want to take something in then they'll keep coming up with excuses anyway. (Packaging policies are "premade excuses", they are not a guarantee for inclusion.)
So, even if that view is not shared, then I think a simpler version of that is probably applies here, which is even if something is "stable" it doesn't make it production ready. (Bugs happen. Ensuring quality is a process, determining fitness for a purpose requires a deliberation by someone who understands the needs and requirements of that purpose. A simple version sticker will never be able to do that.)
That said I completely understand distros' problem with managing "nightly", as it means an endless stream of packages. (Thus busy work.) It takes up space, it bloats the repository metadata, etc, etc. The solution is probably for those projects that depend on Rocket to do the packaging themselves and offer a repo that users can add, or a setup/update script. (I have no idea how that works on OpenBSD though. For Alpine it's pretty straightforward to host a repo, put APKs there and for users to set it up via /etc/apk/repositories and /etc/apk/keys .)
TeXitoi commentedon Mar 2, 2021
I think the main problem for OpenBSD is that the package manager provide the latest stable, but not the nightly rust. Thus, you'll have to compile the compiler yourself if you want nightly as the rust project do not distribute rust for OpenBSD.
TeXitoi commentedon Mar 2, 2021
Note that, as a workaround, you can use a stable compiler with
RUSTC_BOOTSTRAP=1, and I think you'll have a rustc with feature gates usable.est31 commentedon Mar 2, 2021
@TeXitoi please don't do that outside of local testing. It will cause issues the moment the compiler is updated.
montdidier commentedon Mar 3, 2021
The best example in my opinion is bitwarden_rs. It is quite a popular project and seems to be increasingly so.
Since the packages don't yet exist officially or via contrib as far as I know, I don't have a clear signal how who is using them on those platforms. I personally believe there is latent demand for them. I myself am trying to package them because I want to use them.
I admit I don't know if they will accept a package before I present it, and the reason they fail to be accepted I don't always agree with but even for my own use I still prefer the formal packaging system, and in the past I have experienced maintaining it this way it may eventually get accepted. My personal experiences with OpenBSD have been more positive, I suspect, based on your view expressed here.
I can see how this is true but is it really useful or good advice or a packagist? The fact is that stable, nightly and packaging policies are all systems to try to distill very complex things down to abstractions about which you can try to make reasonable decisions about. You're not claiming that nightly is just as stable as stable. It probably isn't on the whole. For a packagist trying to make the best decisions to further the interests of their chosen distribution, and probably with only casual knowledge about he myriad things over which they have purview, they will resort to leaning on these abstractions and for the most part that is completely reasonable and understandable.
Absolutely. All good reasons that many will just want to keep it simple and stick with stable.
Yes, and no doubt some will choose to do that, but many projects will not be able to cover all that ground and there are packagists willing to do some of that lifting. Sticking with stable immediately lowers the bar for them, from a complexity point of view and from a distribution policy point of view. Neither of the challenges are insurmountable or even significant, but it is friction none the less.
In summary, all I argue is that relying on stable has more significant upside for rocket and projects that depend on it than I think has been acknowledged so far in this thread. I personally think rocket has a bright future and I'm looking forward to using it more myself.
montdidier commentedon Mar 3, 2021
Yes this is correct and the packaging system also only will formally support crates from crates.io not from git directly. Perhaps that happens in the future, but not currently. There are workarounds but nothing that invokes pride in ones work.
TeXitoi commentedon Mar 3, 2021
@est31 no more than updating a nightly, no? Note that the build infrastructure of firefox just do that.
But I agree that it is a workaround, and quite dirty one.
Enable compilation with stable Rust.