Nixpkgs: [Darwin] ruby error on ripgrep install

Created on 27 Oct 2020  ·  7Comments  ·  Source: NixOS/nixpkgs

Describe the bug
ripgrep can't be installed on macOS because of ruby compilation failure

To Reproduce
Steps to reproduce the behavior:

  1. nix-env -i ripgrep

Many packages are downloaded from source and compiled.
The compilation fails - full logs:

checking whether CFLAGS is valid... yes
checking whether LDFLAGS is valid... no
configure: error: something wrong with LDFLAGS=""
builder for '/nix/store/ppbkqkmvzmy5z391xm5g3f95945h1fl9-ruby-2.6.6.drv' failed with exit code 1
cannot build derivation '/nix/store/sq4wqa78f22jbg5awlcm6ml4bvmaxr4m-ruby-2.6.6.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/7yz9srx66k7zwvf61gv1jlr6si6id8d9-asciidoctor-2.0.10.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/h0p44gzhjjq6fr5x2g5pwlpmsrdblswm-asciidoctor-2.0.10.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/72ha8a3jdqslsprawk1i4i2qsws900ck-ripgrep-12.1.1.drv': 1 dependencies couldn't be built
error: build of '/nix/store/72ha8a3jdqslsprawk1i4i2qsws900ck-ripgrep-12.1.1.drv' failed

Expected behavior

  • Ruby shouldn't be mentioned when I install ripgrep.
  • I expect nix to download a pre-built binary of ripgrep.

Additional context
I'm a Nix newbie, I installed Nix for the first time on Darwin yesterday (+ ripgrep) and it worked just fine.

I installed Nix today on a second machine (also Darwin), and it's unable to install ripgrep. Plenty of other packages could be installed just fine:

~ ❯ nix-env -q --installed
aria2-1.35.0
cloc-1.88
docker-compose-1.27.4
git-2.28.0
gnupg-2.2.23
go-1.15.3
golangci-lint-1.31.0
htop-3.0.2
jq-1.6
kubectl-1.19.3
kubectx-0.9.1
kubeval-0.15.0
magic-wormhole-0.12.0
mosh-1.3.2
nano-5.3
neofetch-7.1.0
nmap-7.90
rustup-1.22.1
sshuttle-1.0.3
tmux-3.1b
tree-1.8.0
wget-1.20.3
wrk-4.1.0
yarn-1.22.5
zsh-5.8

I suspect this commit https://github.com/NixOS/nixpkgs/commit/d73cc1e58601a4d12cfc353e7478fee8b18126cd#diff-c1d18e0554429e0b48c20c01ef94191fa75ba3ef6e057b5b9e3c40dde0c2b64b would help, but I don't understand why it worked yesterday on another machine (this commit is 6 days old).

Notify maintainers
ripgrep: @zowoq @marsam @tailhook @globin
ruby: @marsam @vrthra @manveru

Metadata

~ ❯ nix-shell -p nix-info --run "nix-info -m"
 - system: `"x86_64-darwin"`
 - host os: `Darwin 19.6.0, macOS 10.15.7`
 - multi-user?: `yes`
 - sandbox: `no`
 - version: `nix-env (Nix) 2.3.8`
 - channels(root): `"nixpkgs-21.03pre248787.7ad5e816fab"`
 - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixpkgs`

Maintainer information: (not sure how to fill that)

# a list of nixpkgs attributes affected by the problem
attribute:
# a list of nixos modules affected by the problem
module:

Related: https://github.com/NixOS/nixpkgs/issues/101330

bug

Most helpful comment

Like me, you're apparently using the nixpkgs-unstable channel, which I'm guessing has the cctools update but doesn't yet have the commit you linked to, and it should resolve itself in a day or two.

All 7 comments

Yes, seeing the same failure of Ruby 2.6.6 on Darwin here. Suggest changing the subject to reflect that it's Ruby that's not compiling.

I've picked this title as I don't understand why ripgrep depends on ruby; and why a pre-built package isn't available — is it because Hydra fails to compile ripgrep?

EDIT/ happy to close this ticket seeing ruby is the likely root cause, if it's expected to depend on ruby here

I've picked this title as I don't understand why ripgrep depends on ruby

According to nix-store -q -tree, ruby is required by asciidoctor.

Like me, you're apparently using the nixpkgs-unstable channel, which I'm guessing has the cctools update but doesn't yet have the commit you linked to, and it should resolve itself in a day or two.

Looks like Nix on Darwin is set to use nixpkgs-unstable by default, so that sounds right.

ruby is required by asciidoctor.
Thanks!

Closing, it's a pure duplicate of #101330.

Solved locally by switching to the stable 20.09 nixpkgs release.

$ sudo -i
root# nix-channel --add https://nixos.org/channels/nixpkgs-20.09-darwin nixpkgs
root# nix-channel --update

The ruby fix has landed in the nixpkgs-unstable channel.

Was this page helpful?
0 / 5 - 0 ratings