that seems to be the longest time of all homebrew packages IIRC
==> Installing ripgrep dependency: rust
==> Using the sandbox
==> Downloading https://static.rust-lang.org/dist/rustc-1.14.0-src.tar.gz
######################################################################## 100.0%
==> ./configure --prefix=/Users/timothee/homebrew/Cellar/rust/1.14.0 --enable-clang --release-channel=stable
==> make
==> make install
==> Downloading https://static-rust-lang-org.s3.amazonaws.com/cargo-dist/2016-11-02/cargo-nightly-x86_64-apple-darwin.tar.gz
######################################################################## 100.0%
==> ./install.sh --prefix=/private/tmp/rust-20170205-1206-tvi7um/rustc-1.14.0/cargobootstrap
==> Cloning https://github.com/rust-lang/cargo.git
Cloning into '/Users/timothee/Library/Caches/Homebrew/rust--cargo--git'...
remote: Counting objects: 278, done.
remote: Compressing objects: 100% (272/272), done.
remote: Total 278 (delta 39), reused 59 (delta 1), pack-reused 0
Receiving objects: 100% (278/278), 693.76 KiB | 0 bytes/s, done.
Resolving deltas: 100% (39/39), done.
Note: checking out '298a0127f703d4c2500bb06d309488b92ef84ae1'.
You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.
If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:
git checkout -b <new-branch-name>
==> Checking out tag 0.15.0
==> ./configure --prefix=/Users/timothee/homebrew/Cellar/rust/1.14.0 --local-rust-root=/Users/timothee/homebrew/Cellar/rust/1.14.0 --enable-optimize
==> make
==> make install
==> Caveats
Bash completion has been installed to:
/Users/timothee/homebrew/etc/bash_completion.d
zsh completion has been installed to:
/Users/timothee/homebrew/share/zsh/site-functions
==> Summary
馃嵑 /Users/timothee/homebrew/Cellar/rust/1.14.0: 24,937 files, 241.7M, built in 39 minutes 9 seconds
As far as I can tell, it looks like it is building Rust from source, and building Rust from source takes a while. If you don't want to build Rust from source, then don't use homebrew to build Rust from source. Instead you should install Rust using rustup.
The currently available Rust formula was updated three days ago and contains binary versions of Rust 1.15 for the last three versions of macOS.
The formula for ripgrep contains depends_on "rust" => :build, though, which is surprising and seems to come from here. Nevertheless, this, too, contains bottles (binaries) for the last three versions of macOS.
If homebrew packages are wrong, bugs should be filed with those packages, or homebrew itself. I don't think there's anything actionable about this ticket, other than the usual "make Rust faster to compile" that we're working across in all fronts.
@timotheecour if you have a specific issue here that's Rust's fault and can be improved, please let us know! Until then, I'm going to give this one a close. Thanks!
@retep998 @killercup @steveklabnik
thanks for answers, filed https://github.com/Homebrew/homebrew-core/issues/9703 for one of the above points: ripgrep depends on "rust" => :build which takes takes 39 minutes #9703
Regardless of homebrew:
Looking at htop during install shows only 2 active threads most of the time (rarely up to 8), even though I'm running on a machine with 48 CPU (with 0 activity).
threads of the form:
rustc src/librustc/lib.rs --crate-name rustc --crate-type dylib -C prefer-dynamic -C opt-level=2
nproc" cpu? @timotheecour Rust's unit of compilation is the crate, unlike in C/C++ where each source file is a unit of compilation. Crates depend on each other much more than C/C++ source files do, so it is quite normal for a Rust build to be waiting for one or two specific crates before more stuff can be built. Rustbuild does by default use as many CPU cores as it can, it is just limited by interdependencies between crates
The formula for ripgrep contains depends_on "rust" => :build, though, which is surprising and seems to come from here.
@killercup Why is this "surprising"? ripgrep is written in rust. So it needs rust to build.
@ilovezfs I assume :build means "compile" in this context. And compiling Rust is not necessary: You just need the compiler binary and are good to go.
One could assume that ripgrep requires a nightly compiler, but that would mean that there should be (a) a HEAD flag somewhere in the formula, and (b) actually passing features (like --features "simd") when compiling ripgrep.
In fact, ripgrep itself offers an alternative brew formula with binaries compiled with rust nightly to enable those features: https://github.com/BurntSushi/ripgrep#installation
=> :build means build time for the formula. The formula is ripgrep. At build time, it needs rust.
=> :build has nothing to do with whether "rust" itself is the binary bottle or a local source build.
Ah, thanks, @ilovezfs, that makes sense. (I love ZFS, too, btw.) Then, I must assume OP was not using a system for which pre-build binaries exist.
@killercup Yeah ZFS is awesome :)
Then, I must assume OP was not using a system for which pre-build binaries exist.
That is correct. OP is using a non-standard prefix (the standard prefix is /usr/local), and neither the ripgrep bottle nor the rust bottle are relocatable bottles, so source builds of both rust and ripgrep are triggered. If OP uses the standard prefix, /usr/local, then the ripgrep bottle would be poured and rust would not be installed at all.
@ilovezfs
unfortunately on linux (https://github.com/Homebrew/homebrew-core/issues/9703), there is not bottle for rust nor ripgrep (and IIRC we can't use /usr/local as standard prefix on linux, it defaults to ~/.linuxbrew to avoid clashing)
@timotheecour right the standard prefix is different for Linuxbrew. I suggest you inquire about getting rust bottled for Linux here: https://github.com/Linuxbrew/homebrew-core/issues
@ilovezfs
I did : https://github.com/Linuxbrew/homebrew-core/issues/1733
I also have a PR in progress to try to fix it but it's running into additional issues, see
https://github.com/Linuxbrew/homebrew-core/pull/1744#issuecomment-278893844
it's trying to build a Mach-O 64-bit x86_64 executable on linux
@timotheecour ah OK. Then we should continue this conversation on https://github.com/Linuxbrew/homebrew-core/pull/1744.
The currently available Rust formula was updated three days ago and contains binary versions of Rust 1.15 for the last three versions of macOS.
The formula for ripgrep contains
depends_on "rust" => :build, though, which is surprising and seems to come from here. Nevertheless, this, too, contains bottles (binaries) for the last three versions of macOS.
I just ran into this issue after upgraing to Mojave. It seems that there is no pre-built binary for Mojave. Would be nice to add.
Most helpful comment
I just ran into this issue after upgraing to Mojave. It seems that there is no pre-built binary for Mojave. Would be nice to add.