NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
18.08k stars 14.13k forks source link

R example fails with ld: library not found for -liconv #42902

Closed idontgetoutmuch closed 3 years ago

idontgetoutmuch commented 6 years ago

Issue description

I am trying to run a Jupyter notebook using the example here: https://nixos.wiki/wiki/R#Jupyter_Notebook

Steps to reproduce

nix-shell shellR.nix -I nixpkgs=https://github.com/nixos/nixpkgs-channels/archive/nixos-unstable-small.tar.gz
ld: library not found for -liconv
clang-5.0: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [/nix/store/k3v4j8g34hznydwss2vdzlzin67yms3d-R-3.5.0/lib/R/share/make/shlib.mk:6: xts.so] Error 1
ERROR: compilation failed for package 'xts'
* removing '/nix/store/hincd8sigckq2clnha6pqh0ynv75acl1-r-xts-0.10-2/library/xts'
builder for ‘/nix/store/bhi6vdpvkv55xfm3jlwn9wkgn1sgipch-r-xts-0.10-2.drv’ failed with exit code 1
cannot build derivation ‘/nix/store/xyhb17jznly6shb5amhhbzrxlmsf6a11-R-3.5.0-wrapper.drv’: 1 dependencies couldn't be built
error: build of ‘/nix/store/xyhb17jznly6shb5amhhbzrxlmsf6a11-R-3.5.0-wrapper.drv’ failed
/nix/var/nix/profiles/default/bin/nix-shell: failed to build all dependencies

Technical details

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

 - system: `"x86_64-darwin"`
 - host os: `Darwin 17.3.0, macOS 10.13.2`
 - multi-user?: `yes`
 - sandbox: `no`
 - version: `nix-env (Nix) 1.11.15`
 - channels(root): `"nixpkgs-18.03pre122117.14df60d0db9"`
 - channels(dom): `"nixpkgs-18.09pre142380.23f2dfd9f5a"`
 - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixpkgs`
matthewbauer commented 6 years ago

I am not getting the iconv issue on master.

stale[bot] commented 4 years ago

Thank you for your contributions.

This has been automatically marked as stale because it has had no activity for 180 days.

If this is still important to you, we ask that you leave a comment below. Your comment can be as simple as "still important to me". This lets people see that at least one person still cares about this. Someone will have to do this at most twice a year if there is no other activity.

Here are suggestions that might help resolve this more quickly:

  1. Search for maintainers and people that previously touched the related code and @ mention them in a comment.
  2. Ask on the NixOS Discourse.
  3. Ask on the #nixos channel on irc.freenode.net.
abathur commented 3 years ago

Tentatively closing this since bauer said he didn't see it on master, and there hasn't been any more activity.

Feel free to squeak if this is still a problem--I'll happily reopen it.

rpearce commented 3 years ago

I've been getting this using master for the past week or so and always failing on compiling procs v0.11.4 with rust. What's funny is I have the exact same Nix setup on my work computer (Macbook Pro from 2018 with latest macOS), but the error is on my personal Macbook Pro from 2013 running Catalina 10.15.7.

This exact error seems to be happening with any rust-based nix package.

Expand this to see the error

   Compiling toml v0.5.8
   Compiling hyper v0.13.10
   Compiling hyperlocal v0.7.0
   Compiling dockworker v0.0.22
   Compiling procs v0.11.4 (/private/tmp/nix-build-procs-0.11.4.drv-0/source)
error: linking with `/nix/store/kdb6mr4whml4dlyxbwhsv4zy90qbmbk4-clang-wrapper-7.1.0/bin/cc` failed: exit code: 1
  |
  = note: "/nix/store/kdb6mr4whml4dlyxbwhsv4zy90qbmbk4-clang-wrapper-7.1.0/bin/cc" "-m64" "-arch" "x86_64" "-L" "/nix/store/dkd2mzd27flf75g9nprg0civx9hwgchh-rustc-1.50.0/lib/rustlib/x86_64-apple-darwin/lib" "/private/tmp/nix-build-procs-0.11.4.drv-0/source/target/x86_64-apple-darwin/release/deps/procs.procs.hv73vwnx-cgu.0.rcgu.o" "-o" "/private/tmp/nix-build-procs-0.11.4.drv-0/source/target/x86_64-apple-darwin/release/deps/procs" "-Wl,-dead_strip" "-nodefaultlibs" "-L" "/private/tmp/nix-build-procs-0.11.4.drv-0/source/target/x86_64-apple-darwin/release/deps" "-L" "/private/tmp/nix-build-procs-0.11.4.drv-0/source/target/release/deps" "-L" "/private/tmp/nix-build-procs-0.11.4.drv-0/source/target/x86_64-apple-darwin/release/build/backtrace-sys-51a7809984259ee0/out" "-L" "/nix/store/dkd2mzd27flf75g9nprg0civx9hwgchh-rustc-1.50.0/lib/rustlib/x86_64-apple-darwin/lib" "/nix/store/dkd2mzd27flf75g9nprg0civx9hwgchh-rustc-1.50.0/lib/rustlib/x86_64-apple-darwin/lib/libcompiler_builtins-36c5611c149fc184.rlib" "-lc" "-lproc" "-lproc" "-lproc" "-lproc" "-liconv" "-lSystem" "-lresolv" "-lc" "-lm"
  = note: ld: library not found for -liconv
          clang-7: error: linker command failed with exit code 1 (use -v to see invocation)

error: aborting due to previous error

error: could not compile `procs`

Here are my system details:

 - system: `"x86_64-darwin"`
 - host os: `Darwin 19.6.0, macOS 10.15.7`
 - multi-user?: `no`
 - sandbox: `no`
 - version: `nix-env (Nix) 2.4pre20210317_8a5203d`
 - channels(rpearce): `"home-manager, nixpkgs-21.05pre277683.4e0d3868c67"`
 - nixpkgs: `/Users/rpearce/.nix-defexpr/channels/nixpkgs`
abathur commented 3 years ago

@rpearce I'm not specifically familiar, but I get the impression from reading other issues that missing libiconv is a common/general macOS package issue. How recently did you pull master? It looks like your specific case might be fixed in #117559.

If there's a persistent difference between the two systems at the same nixpkgs commit, it's probably worth a new issue. (There may also be a new issue in master--it is fairly common :)

rpearce commented 3 years ago

@abathur That looks like it'll definitely fix it. ~I pull master almost daily~ (this wasn't true; I pull nixos-unstable almost daily), and I didn't have the time to look into it for a week or so. Thanks for that link! I'll leave this thread alone