Skip to content

Nokogiri fails to build on MacOS BigSur #106973

@ghedamat

Description

@ghedamat

Describe the bug
I usually work in a nix-shell that has Ruby and its dependencies and install Ruby Gems inside there using bundler (the ruby package manager)

On MacOS BigSur the gem nokogiri now fails to build with this error

ld: file not found: /usr/lib/system/libcache.dylib for architecture x86_64 

going deeper on MacOS big sour even the "official" Nix package for nokogiri fails to build
so that could be a simpler repro step

To Reproduce
Steps to reproduce the behavior:
0. On MacOS BigSur (min version 11.0.1)
1.nix-env -iA nixos.rubyPackages_2_7.nokogiri

Expected behavior
build and install works

Screenshots

Gem files will remain installed in /nix/store/23dzxqgmvc5587rfyddkavrqk8wgzpsx-ruby2.7.1-nokogiri-1.10.7/lib/ruby/gems/2.7.0/gems/nokogiri-1.10.7 for inspection.
Results logged to /nix/store/23dzxqgmvc5587rfyddkavrqk8wgzpsx-ruby2.7.1-nokogiri-1.10.7/lib/ruby/gems/2.7.0/extensions/x86_64-darwin-17/2.7.0/nokogiri-1.10.7/gem_make.out
builder for '/nix/store/29x5my70z2fs7jdvkxi80yl6w2r4bjvh-ruby2.7.1-nokogiri-1.10.7.drv' failed with exit code 1
error: build of '/nix/store/29x5my70z2fs7jdvkxi80yl6w2r4bjvh-ruby2.7.1-nokogiri-1.10.7.drv' failed
(base) Grahams-iMac:eternal-sledgehammer grahamanthony$ cat /nix/store/23dzxqgmvc5587rfyddkavrqk8wgzpsx-ruby2.7.1-nokogiri-1.10.7/lib/ruby/gems/2.7.0/extensions/x86_64-darwin-17/2.7.0/nokogiri-1.10.7/mkmf.log
"clang -o conftest -I/nix/store/v20x5lks0vs9wag058pngl4456p4zy4w-ruby-2.7.1/include/ruby-2.7.0/x86_64-darwin17 -I/nix/store/v20x5lks0vs9wag058pngl4456p4zy4w-ruby-2.7.1/include/ruby-2.7.0/ruby/backward -I/nix/store/v20x5lks0vs9wag058pngl4456p4zy4w-ruby-2.7.1/include/ruby-2.7.0 -I. -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT   -O3 -ggdb3 -Wall -Wextra -Wdeprecated-declarations -Wdivision-by-zero -Wimplicit-function-declaration -Wimplicit-int -Wpointer-arith -Wshorten-64-to-32 -Wwrite-strings -Wmissing-noreturn -Wno-constant-logical-operand -Wno-long-long -Wno-missing-field-initializers -Wno-overlength-strings -Wno-parentheses-equality -Wno-self-assign -Wno-tautological-compare -Wno-unused-parameter -Wno-unused-value -Wunused-variable -Wextra-tokens  -fno-common -pipe  -I /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/libxml2 conftest.c  -L. -L/nix/store/v20x5lks0vs9wag058pngl4456p4zy4w-ruby-2.7.1/lib -L. -fstack-protector-strong -L/nix/store/fc6xps4v6jhkckk0ba3v6cbm6gka7qxm-gettext-0.21/lib -L/nix/store/nrsa1l0kh3vxindfkfa1d5fw62yvac4d-libc++-7.1.0/lib -L/nix/store/faz5fq60zphhc71falxxv3sj366xs9g4-libc++abi-7.1.0/lib -L/nix/store/g7nk9byy3n9y3nsn4l1ih483130j3adx-libffi-3.3-dev/lib -L/nix/store/0hm48lrchva2pm8a0q0vbx2nnw4y3mkw-ncurses-6.2-dev/lib -L/nix/store/y0i2ki3i32b2rfvmzaaq85k40k5lwqmc-zlib-1.2.11-dev/lib -L/nix/store/qh0x9pmjy9m5ghs8naznmnhv4czc3cak-openssl-1.1.1g-dev/lib -L/nix/store/fnmpxiv4m11rc3kbp7sp93vmp692z91g-gdbm-1.18.1/lib -L/nix/store/i57z50qhric4n6m2y044pc9091mdjrnq-libyaml-0.2.5/lib -L/nix/store/v0n14y5q17p050a81ih6w5d0szsncjmv-libiconv-osx-10.12.6/lib -L/nix/store/jkqd0pz2gnns0jkl3h1jdlyg9pjhmxjp-objc4-osx-10.12.6/lib -L/nix/store/2aiv2f0l8g5a6635qdykh7c10vzkfa0r-libunwind-osx-10.12.6/lib -L/nix/store/sw7b2gcklaj3iy5ikv7ag163bpry3ivb-clang-wrapper-7.1.0/resource-root/lib -L/nix/store/h144jawqa92rqjhaahrsikq5j2dwkh5n-Libsystem-osx-10.12.6/lib     -lruby-2.7.1    "
ld: file not found: /usr/lib/system/libcache.dylib for architecture x86_64
clang-7: error: linker command failed with exit code 1 (use -v to see invocation)
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: int main(int argc, char **argv)
4: {
5:   return !!argv[argc];
6: }
/* end */

Additional context
possibly related

#91748

#98541

https://discourse.nixos.org/t/is-there-a-plan-that-nix-can-bootstrap-itself-on-macos-big-sur/10043

Notify maintainers
I found @alyssais on the relevant file not sure if they are the ones in charge of this, apologies if this is the wrong maintainer

Metadata
Please run nix-shell -p nix-info --run "nix-info -m" and paste the result.

 - system: `"x86_64-darwin"`
 - host os: `Darwin 20.1.0, macOS 10.16`
 - multi-user?: `no`
 - sandbox: `no`
 - version: `nix-env (Nix) 2.3.1`
 - channels(grahamanthony): `"nixos-21.03pre257780.e9158eca70a, nixpkgs-21.03pre257780.e9158eca70a"`
 - nixpkgs: `/Users/grahamanthony/.nix-defexpr/channels/nixpkgs`

Please note that the channel information ^^ is inaccurate, the nix shell is pinned to unstable from this morning

Maintainer information:

rubyPackages.nokogiri
rubyPackages_2_5.nokogiri 
rubyPackages_2_7.nokogiri

Let me know if I can help in any way and thanks a lot!

Metadata

Metadata

Assignees

No one assigned

    Labels

    0.kind: bugSomething is broken6.topic: darwinRunning or building packages on Darwin6.topic: rubyA dynamic, open source programming language with a focus on simplicity and productivity.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions