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
Bootstrap Cargo without Cargo #2110
Comments
My script is written in python and has successfully bootstrapped Cargo on OpenBSD, DragonflyBSD, FreeBSD, and Bitrig. It also happens to work on Linux and Mac OS X. It sometimes requires a little attention when cargo dependencies change, but it has been mostly stable. I'd be willing to merge it into a "contrib" folder of the cargo repo and hook it into the build system with some unit tests. |
For the distro case its not clear this is needed. Cargo can build with a local cargo using the |
You're right, there's no need to hook it into the build system really. My bootstrap script actually takes advantage of the --local-cargo thing. It's mostly used to compile and link a bare minimum cargo, that might not be perfect, and then use that as the --local-cargo to compile cargo from source properly. Still, it might be nice to have this script mentioned in the documentation on porting. |
@brson so the buildbots for the BSD's currently don't build cargo. but i have bootstrapped cargo on all of those platforms and could set up cargo snapshot building. i just haven't put much time into it lately. maybe something we could do in mozlando? |
So it didn't happen at mozlando, but I'm doing it now. |
Might want to bring to your attention that there seems to be a successful bootstrap in OpenBSD 6.0 ports (devel/cargo) |
@Cyberunner23 the initial bootstrap (building the first cargo binary) was done using @dhuseby script. |
This is unlikely to happen any time soon, and the script mentioned in the OP should suffice for now if needed. In general Cargo for new platforms should always be cross-compiled, as all dependent crates are very well equipped for handling this scenario. |
A catch 22 in the installation process significantly limits cargo's appeal to new users. This bug has tripped up every single distribution that has attempted to package rust. To this day, cargo is unavailable on most debian targets. Rust is still a very young and obscure language - the overwhelming majority of users are new users. Speaking as a new user myself, I take this inability to bootstrap from traditional build systems as a bad omen, a warning that arrogance has outweighed pragmatism. If @dhuseby 's script is sufficient (and I believe it is), then it should be integrated into the cargo repository and maintained and tested as an integral part of cargo, as @brson suggested in the first post. I mean, come on, guys, everyone has gcc and even so maintaining a stage0 build process to bootstrap gcc from proprietary compilers is something they officially support. Thanks! |
Cargo is self-hosting and difficult to bootstrap on new platforms, moreso than rustc. This causes the most problems for systems that upstream doesn't directly provide binaries for, like the BSDs.
Create some mechanism that can reliably bootstrap Cargo without running Cargo itself and add testing to validate that it continues to work. Needs design.
@dhuseby has a script he uses to bootstrap on OpenBSD that may be useful.
The text was updated successfully, but these errors were encountered: