-
Notifications
You must be signed in to change notification settings - Fork 898
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
Support RUSTC_BOOTSTRAP
#4884
Comments
Thank you for reaching out but I'm going to close this. There's really two core parts here: whether we can enable the ability for folks to opt in to unstable config options on stable, and if so, then how. As far as the "how", we definitely would not want to do that via This is a capability we'd like to be able to provide and the most likely mechanism would be via a separate config option which folks could function as a buyer-beware of sorts if they're willing to accept potentially broken/invalid code, dropped comments, etc. Unfortunately though the first part really is the bigger blocker as we received a ton of push back, including from folks on the core team, about letting permitting the usage of unstable opts on stable. I don't anticipate that changing any time soon as "unstable on stable" tends to be anathema in the Rust ecosystem. |
I do not follow why
Please note that if a feature is buggy or untested (to the point of losing data), then it should be definitely labeled as "alpha" or "experimental" or similar, not just as unstable. For me, as a user, "unstable" (in the context of Rust) means a feature that may change or go away entirely. It does not automatically mean it is dangerous to use. In fact,
Preventing unstable features from being used in stable compiler by mistake (or by newcomers etc.) is a very good thing. However, not having any way of overriding it is a mistake, because some projects/companies require official releases or stable tags to be used. And that is not a bad thing: those projects get early access to some features and, for you as a maintainer, is another feedback channel. On top of that, Now, your concern about buggy features is understandable (and commendable!), but those should be labeled as such (with a warning like In any case, please note that, at least for |
If you change the policy that developers should use the nightly rustc toolchain, and the stable toolchain should be used by downstream users, in CI, etc, there is not really a need for You can unlock all the advantages you mention of early access and testing, and in fact being on nightly gives even more direct feedback to developers: you'll be filing bugs a few days after they get merged to master, not 40-80 days. |
I must say, I resent the frequent suggestion that projects wanting to use unstable feature should also be using nightly compilers. Wanting unstable features (interfaces) != wanting an unstable implementation. Because the Rust compiler and the standard library use numerous unstable features, it is perfectly valid to say while released versions unstable features are no less subject to future change, they are at least better tested. It is perfectly reasonable for some to want an unstable feature, knowingly consent to that feature changing in the future, and still want the most battle-tested implementation of that feature. Let me just remind all of you who @ojeda is too -- the point person on Rust for Linux. If getting Rust support in Linux requires unstable features, that is not ideal but perfectly acceptable --- after all it uses tons of C extensions, obscure assembly directives etc. etc., and e.g. the "clang-built Linux" folks already are pinning specific version as they try to match the long tail of underspecified GNU tool functionality. Rust unstable features are indeed analogous to this. However, if Linux devs, to format their Rust code, are being pushed to grab arbitrary nightly Rust toolchains, we run the risk of kernels crashing not because these features are unstable, but because the compiler implementation is --- indeed, it is not unreasonable for nightly compiler to have an issue with stable-only code too; no testsuite is perfect. IMO this would extremely unfortunate collaborative damage, which does nothing to help the case for Rust in Linux, and also does nothing to avoid yes, pernicious "de facto stability" , since the Linux devs are already with full consent opting into using into unstable features. I thus see this prudishness around the |
There are no ICE/etc backports going on for nightly features. Partially that's because usually if there is a breakage it also affects stable features, but partially because nightly features are little used anyways so issues specific to nightly features will not be discovered anyways. In general, if you want stable implementations, stay away from nightly features, nightly compiler or not.
I fully agree about those obscure extensions that only a kernel would need... say some option that disables float formatting in libcore because the kernel doesn't touch the FPU. But these are not rustfmt options. If you scan through the tracking issue for rustfmt the only unstable things the kernel wants from rustfmt are options to format comments and impl items... none of that should be a blocker for a kernel, at least not with that argument. IMO the best argument for
Linux devs are not distributing the kernel in binary form, but in source form. Distributors are not bound to the kernel's rustfmt policies so they can just not use it for their local patches. Even if they do, most distros still have the individual packager not upload binaries any more but instead just the patch files, and it's then built by CI. I think it's been a common suggestion for a long time to use nightly clippy together with stable rustc, as bugfixes arrive more quickly (recently there has been some distancing from that though). So using nightly rustfmt together with stable rustc shouldn't be that uncommon. In general for kernel development, given that the newest rustc doesn't work with the mainline kernel, it might make sense to use rustup anyways. |
Thanks @Ericson2314 for reviving this issue!
Asking every kernel developer to use nightly releases will not work. We did use nightly a long time ago and moved to stable releases for a reason.
That seems orthogonal to me -- we could still test beta/nightlies or stable pre-releases to catch bugs sooner. In fact, I did that sometimes pre-merge. We also discussed with upstream Rust about eventually including the kernel in crater runs.
How so? There are use cases for it.
We don't want to force everyone to use In any case, please note that the goal is to declare a minimum Rust version as soon as possible. Also, I agree this issue is not critical or a blocker for the kernel. But it is painful for no good reason. |
I suppose the fear is always https://xkcd.com/1172/ type stuff with "but I didn't know |
It would be nice to be able to use nightly features in stable releases. The particular mechanism or name for the escape hatch is not important (although I would say using the same one as
rustc
and the other tools would be nice).This is a follow-up of #3900 since that did not get merged.
The text was updated successfully, but these errors were encountered: