rust-lang / cargo

The Rust package manager
https://doc.rust-lang.org/cargo
Apache License 2.0
12.73k stars 2.42k forks source link

suggest new bootstrap technique #1026

Closed aidancully closed 8 years ago

aidancully commented 9 years ago

Can a "bootstrap" target be added that will create an installable package for cargo that does not rely on having a working cargo installation? Envisioned operation is:

The intention is that someone building cargo for the first time on a novel platform (and who doesn't have a supported platform available to run a cross-compile, (ahem) would be able to download a "bootstrap" tarball, run its contained shell script, and end up with a working cargo binary. And in case that didn't work, the shell script would at least contain a record of what a successful compilation process looks like, making it easier to recover from failures.

MattWindsor91 commented 9 years ago

:+1: for something like this. Tried to get cargo to install on FreeBSD recently, hit a world of pain, and gave up. I know FreeBSD etc. are not priority platforms at the moment, but as someone who does a lot of his development on a FreeBSD box it's vexing to be able to work on C/C++/Ruby projects but not Rust.

MattWindsor91 commented 9 years ago

Also, the rapid development cycle of Rust and Cargo means that the current approach of hoping and praying someone's managed to do it and posted a gist of instructions doesn't work out well.

ebfe commented 9 years ago

+1, keeping up with rust/cargo on FreeBSD is really painful at the moment.

aidancully commented 9 years ago

@ebfe @CaptainHayashi https://github.com/aidancully/fakeCargo might help - it's intended to run a build similarly to how cargo does, to help the bootstrap process.

fabiankrack commented 9 years ago

+1 for a better FreeBSD support.

mneumann commented 9 years ago

+1 also required for DragonFlyBSD :)

csperkins commented 9 years ago

I wrote a script that builds Cargo on FreeBSD, by compiling an initial known-good version by hand, and then using that to bootstrap up to the latest version. Details at https://csperkins.org/research/misc/2015-01-02-cargo-freebsd.html if it's useful to others.

lyuts commented 9 years ago

@csperkins Thanks a lot for the link. It is very useful. Just an idea, you can list required dependencies for this bootstrap to succeed. I understand it's a little painful to figure out all of them, but one step a time. textproc/libflate is required. Apologies for the noise in this thread, could find a way to leave a comment in your post.

csperkins commented 9 years ago

I won't have the time to do that for the next few weeks at least, however as a starting point, it bootstraps on a FreeBSD 10.1-RELEASE-p9 machine with only the following packages installed:

bash-4.3.33 = ca_root_nss-3.18.1 = cmake-3.1.3 = cmake-modules-3.1.3 = curl-7.42.1 = cvsps-2.1_1 = expat-2.1.0_2 = gettext-runtime-0.19.4 = git-2.3.7 = gmake-4.1_1 = indexinfo-0.2.3 = libexecinfo-1.1_3 = libffi-3.2.1 = libflate-2.0 = libssh2-1.4.3_5,2 = libunwind-20121006_2 = p5-Authen-SASL-2.16_1 = p5-Digest-HMAC-1.03_1 = p5-Error-0.17023 = p5-GSSAPI-0.28_1 = p5-IO-Socket-IP-0.37 = p5-IO-Socket-SSL-2.012 = p5-Mozilla-CA-20141217 = p5-Net-SMTP-SSL-1.02 = p5-Net-SSLeay-1.68 = p5-Socket-2.019 = perl5-5.18.4_14 = pkg-1.5.1 = pkgconf-0.9.10 = python-2.7_2,2 = python2-2_3 = python27-2.7.9_1 = screen-4.2.1_5 = vim-lite-7.4.691 =

alexcrichton commented 8 years ago

This now exists externally, so closing. Deciding whether to officially include this is https://github.com/rust-lang/cargo/issues/2110