-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Cargo (rust release version) can't bootstrap itself #1223
Comments
OTOH, it looks like current master builds with 1.0.0-alpha because all the crates have been updated and some code in cargo itself amended. I think this is mostly by chance, as no other breaking changes occurred in the middle. I could just package this (once I have a clearer plan on how to handle all the dep-crates) and call it a day. However in the long term this seems a bit unfortunate, as I'll be always providing a newer-than-released cargo instead of the same version you ship in rust installer. I think that, if you don't plan/want to change how your (upstream) packaging machinery works, it would be great to at least fork off a branch at the same time of the release and cherry-pick there the Cargo.toml updates and minor code fixes needed to build with the corresponding rustc release. I think that this may simplify (downstream) packaging quite a bit. |
I'm not sure how relevant this is but I want to mention that latest cargo master builds with this:
^ that is, after you run
|
@emanueLczirai yes, see also my comment above. The report is mostly about currently released version (as shipped in -alpha installer) and how to get the next (-beta) release easier to package. |
This is largely intended as-is today as Cargo pins itself to a particular Cargo snapshot (like rustc) as well as a particular rustc version. It is intended that Cargo builds with entirely stable code at the 1.0 release of Rust at which point I believe that the necessity of a pinned compiler (or a pinned Cargo) will become much less pressing. For now though the two are in enough flux that I think we need to continue the current strategy for the near future though. As a data point though I didn't have to update the Cargo snapshot for a month and I have a feeling that will only get longer (rustc is another story though!). |
Sure, understandable. The point of the report was for downstream packager to be aware of this issue and for you to avoid it for 1.0.0 stable (which is the whole reasons of having beta releases). Otherwise we may end up with a stable cargo which is a hell to sanely build downstream :) |
Yeah definitely, I'm certainly quite keen to fix issues like this! I'd definitely be willing to touch base closer to when Rust itself is stable to make sure Cargo is easily package-able |
I think that this is bug I hit is the other half of #1178, but I'm an unsure, so please read through the logs.
So, imagine that you are packaging the version of cargo released with rust-1.0.0alpha, and you need to bootstrap it. From #1178, you learn that you want cargo at revision
23ed197
. So you locally install rustc/cargo from 1.0.0-alpha, and prepare to build a system version of cargo with that:Then you try to build via make, and that's what you get:
I was puzzled for a brief moment by this, but then I think I started understanding what's going on here.
Cargo, like rustc, has a circular dependency on itself. Additionally to that, cargo has two external dependencies: rustc and several crates. Obviously, those crates have an implicit dependencies on some specific rustc (nightly) version, due to syntax/libs evolution.
As such, cargo and those crates are locked to a specific nightly version. It may happen (and I think this is the case here) that breaking changes exist between that nightly and the released alpha/beta/stable. In that case, cargo and crates will build with the nightly, but fail with the alpha/beta/stable.
I think you'll never experience this, as your cargo and rust CI toolchains are tightly locked and just download the nightly versions they want (or, if you do, you just bump the snapshots). However, from a distribution POV, this means that in order to simply locally build a released version of rustc+cargo, I have to go digging through rust+cargo history, fetch several stage0 and nightlies, build at least two different copies of rust and hope for the best.
This is my first encounter with cargo packaging (RIP rustpkg) so I hope that my analysis is wrong somewhere. And I'm still unsure how to proceed from here on.
The text was updated successfully, but these errors were encountered: