Skip to content
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

Closed
brson opened this issue Nov 4, 2015 · 9 comments
Closed

Bootstrap Cargo without Cargo #2110

brson opened this issue Nov 4, 2015 · 9 comments

Comments

@brson
Copy link
Contributor

brson commented Nov 4, 2015

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.

@dhuseby
Copy link

dhuseby commented Nov 4, 2015

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.

@brson
Copy link
Contributor Author

brson commented Nov 16, 2015

For the distro case its not clear this is needed. Cargo can build with a local cargo using the --local-cargo flag, and is compatible with some very old revisions. Once they've got Cargo packaged initially it should be simple to keep it building.

@dhuseby
Copy link

dhuseby commented Nov 16, 2015

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.

@dhuseby
Copy link

dhuseby commented Nov 16, 2015

@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?

@dhuseby
Copy link

dhuseby commented Dec 31, 2015

So it didn't happen at mozlando, but I'm doing it now.

@Cyberunner23
Copy link

Cyberunner23 commented Nov 1, 2016

Might want to bring to your attention that there seems to be a successful bootstrap in OpenBSD 6.0 ports (devel/cargo)

@semarie
Copy link
Contributor

semarie commented Nov 1, 2016

@Cyberunner23 the initial bootstrap (building the first cargo binary) was done using @dhuseby script.

@alexcrichton
Copy link
Member

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.

@galexander1
Copy link

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants