-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Rust 1.43 fails to compile itself #71502
Comments
Do you need this for anything? This is not a supported configuration |
yes, Linux distributions often need to recompile a (compiler) package with some patches applied or after a major LLVM / glibc / other major update. See #69953 for the discussion on the Rust 1.42.0 release. |
Really? I thought this has been an attempted guarantee since years ago. (Even though it was broken for various previous releases.) Debian certainly needs this guarantee and I will have to figure out how to fix this when packaging 1.43 for Debian. This one seems like a new case not similar to the previous cases, gah. |
Well, we don't test this at all, so it's not surprising that it breaks almost every release. Why can't Debian just use the previous release to bootstrap? |
We do, but the porters (for tier-2 architectures like riscv64) and other people occasionally need to rebuild stuff afterwards, when the old version is no longer available (has been moved to archives). |
It's not really unsupported so much as not tested. I would ask that if Debian (or others) want this to work we find out before the stable release -- ideally when beta is cut, or earlier -- that way we can do much more to fix it. I'll try to take a look at this specific failure soon and see if there's a simple patch. |
Bootstrapping rustc twice would make merging PRs much slower than it's today. However, maybe one could add it only to the beta branch's CI. Or, alternatively, add rustc to crater. The "old state" would serve as check whether it can bootstrap normally, the "new state" would check whether it can bootstrap itself. There's a proposal to add servo already: rust-lang/crater#133 |
I don't think there's been any proposal that we test this in PR CI? To be clear, I don't currently believe that's something we want to do, though we'd generally be willing to accept PRs that make self-bootstrapping possible, which is why I suggested testing on beta releases (instead of stable releases, where we can't do much so all patches must be downstream). |
It wasn't in response to any proposal or such, just about how to stop regressions like this from happening. It has been mentioned in the thread that it's not being tested. So naturally one would wonder how the testing would look like so I wrote down my thoughts. Also, yes, optimally the users would test beta releases (question to @thomasjfox have you tested 1.44 beta yet?), and I've filed a pr for rav1e today to do precisely this, but the entire premise of CI as well as crater is to be proactive about breakage. |
Understood, I will make some more effort to test the beta releases! We had done so a few times in the past but not really made it a regular part of the process. |
I agree it would be too onerous for regular PRs, but perhaps it could be done when anointing nightly as beta, and then on all PRs to beta, that sounds not too expensive. |
Have you found this yet? Maybe something wrong with your FWIW, the automatic rebuild in Fedora rawhide was just fine: |
Yesterday evening I continued with the investigation. I managed to recompile the Fedora 31 source rpm on my Fedora 31 workstation. So it must be something triggered by my "custom distro" setup. The plan for today is to limit the number of parallel build jobs to one and run "forkstat" in the background. I want to isolate the exact command invocation that triggers the error. The /dev/null device should be fine, the build process is not running inside a container or chroot. |
I think we might be onto something here. After I had another failed Rust 1.43.0 re-compile attempt, I noticed /dev/null was broken:
(tmux crashed on startup, that's how I noticed) I've rebooted the devbox, /dev/null is fine again and I will now compile the previous Rust 1.42.0 twice. If /dev/null stays fine, I'll re-try with Rust 1.43.0 and see if /dev/null gets replaced. |
the only remotely related change to /dev/null handling from 1.42.0 to 1.43.0 is this c2bbe33 |
That kind of error usually occurs when one uses something like
|
When I run that test manually as root, I do indeed get a clobbered
|
Running tests as root is indeed very trusting :) But it seems like in this case we should probably write to e.g. /dev/rust-nonexistent-path instead of null to avoid the accidental breakage? Alternatively maybe we can move this test to a make test and chmod our permissions away... |
I don't know if a nonexistent path will exercise the intended failure mode, but a simple chmod is insufficient to stop root. |
There's the immutable xattr, even root can't delete those files. This is how Android malware persists across factory resets: But requiring filesystem xattrs just for one unit test is a no no. May be a read only place in proc like /proc/version would do:
I've started a build without the unit test in question for the night, results will be in tomorrow. |
with the mentioned unit test disabled, I can finally build Rust 1.43.0 with itself. Rustception all the way, thanks! I've verified again it didn't blow up with Rust 1.42.0, even though the unit test was part of it already. I've tested the /proc/version approach:
Using an existing directory as output file gives a different error message:
|
I think |
I'd be happy to review a PR here, FWIW, it sounds like it should be a pretty simple update to the UI test. |
Just wanted to say thank you for the quick fix and happy birthday to Rust! Also Rust 1.43.1 compiled itself without problems. |
Hi all,
my usual test: Can Rust compile itself after a compiler upgrade.
Rust 1.43 dies at this stage:
I didn't identify the problematic code yet, I just wanted to create a tracking issue first.
Rust 1.43 can compile other crates fine, I quickly tested rust-zip or rust-askama.
The text was updated successfully, but these errors were encountered: