5

the setup:

  • system: "x86_64-linux"
  • host os: Linux 4.15.0-22-generic, Ubuntu, 18.04 LTS (Bionic Beaver)
  • multi-user?: no
  • sandbox: no
  • version: nix-env (Nix) 2.0.2
  • channels(aeug): "nixpkgs-18.09pre140731.c29d2fde74d"
  • nixpkgs: /home/aeug/.nix-defexpr/channels/nixpkgs

running:

nix-shell -p conda --run "conda-shell"

results in:

bash: /etc/profile.d/vte.sh: No such file or directory
mkdir: relocation error: /usr/lib/libc.so.6: symbol _dl_exception_create, version GLIBC_PRIVATE not defined in file ld-linux-x86-64.so.2 with link time reference

edit I had to allow my user to access /etc/profile.d/vte.sh

but this results in:

./conda-shell 

** (process:20829): WARNING **: 08:04:35.617: chrootenv doesn't stack!
** Message: 08:04:35.628: Requires Linux version >= 3.19 built with CONFIG_USER_NS
** Message: 08:04:35.628: Run: sudo sysctl -w kernel.unprivileged_userns_clone=1

** (process:20831): ERROR **: 08:04:35.629: main: unshare: Operation not permitted
Trace/breakpoint trap (core dumped)

so I issue

kernel.unprivileged_userns_clone=1

but still the result is the same.

If i do

sudo ./conda-shell 
mkdir: relocation error: /usr/lib/libc.so.6: symbol _dl_exception_create, version GLIBC_PRIVATE not defined in file ld-linux-x86-64.so.2 with link time reference
stat: relocation error: /usr/lib/libc.so.6: symbol _dl_exception_create, version GLIBC_PRIVATE not defined in file ld-linux-x86-64.so.2 with link time reference
 id: relocation error: /usr/lib/libc.so.6: symbol _dl_exception_create, version GLIBC_PRIVATE not defined in file ld-linux-x86-64.so.2 with link time reference

besides "nix-shell" there is still nix-env but

nix-env -qaP .\*conda.\*
nixpkgs.conda                   conda-shell-4.3.31
nixpkgs.python27Packages.conda  python2.7-conda-4.3.16
nixpkgs.python36Packages.conda  python3.6-conda-4.3.16

nix-env -i conda 
error: selector 'conda' matches no derivations

Why is in nix-env an conda pkgs available but via -i not existing?


How can you debug the root cause and which way are there to solve it?

InLaw
  • 2,026
  • 2
  • 16
  • 28
  • `nix-shell` does a lot of things. Let's try to simplify it first. What happens if you `nix-build -f '' -A conda` and run it from the result? – Robert Hensing Jun 06 '18 at 20:13
  • results in: `error: unrecognised flag '-f' ` – InLaw Jun 07 '18 at 05:30
  • Sorry, `nix-build` doesn't need the `-f` flag, `nix-env` does. Try `nix-build '' -A conda`. Does running the result give the same error messages? – Robert Hensing Jun 07 '18 at 07:11
  • creates the `results` folder and the msg: `/nix/store/47z22iq42kflwhdbzrh2fbin2ph6qkk1-conda-shell` but it is not listed in `nix-env -q .\*conda.\* ` – InLaw Jun 07 '18 at 07:48
  • `./conda-shell` results again in `mkdir: relocation error: /usr/lib/libc.so.6: symbol _dl_exception_create, version GLIBC_PRIVATE not defined in file ld-linux-x86-64.so.2 with link time reference` – InLaw Jun 07 '18 at 07:58
  • `nix-build` does not manage user profiles so the behavior you're seeing is expected (and useful) – Robert Hensing Jun 07 '18 at 09:38
  • thanks for you help but I cannot follow you here. I would like to understand what the root cause is and if there is no bug then how to make it work in this "perfect nix world". How should `relocation error` be related with the profile if the error is IN the nix-shell execution? – InLaw Jun 07 '18 at 09:45
  • 1
    Now we can establish that the first message was caused by `nix-shell` only and is probably harmless. Judging from the error message, conda calls an executable `mkdir` that has a binary compatibility issue with your ubuntu system. Now if `mkdir` came from Nixpkgs, it would be built/patched in a way that it doesn't even look at /usr/lib. Considering that conda is a package manager, I suspect that it has fetched its own mkdir somewhere. I'm not familiar with conda, so I may well be mistaken. If you could `find` mkdir in a conda directory, that may confirm this hypothesis. – Robert Hensing Jun 07 '18 at 09:45
  • `nix-shell -p` not only builds a package but reuses part of a hard-coded nix expression to set up a shell. Indeed this is not related to the problematic error that is causing the "relocation error" messages. – Robert Hensing Jun 07 '18 at 09:48
  • Another cause of this problem may be the lack of a sandbox. I had assumed earlier that the conda build is correct, which may not be the case if it was built in your machine without sandbox. If you are sure that conda was fetched from a binary cache, you can ignore this comment. Otherwise you may need to build it in a sandbox. – Robert Hensing Jun 07 '18 at 09:54
  • Maybe related to this issue: https://github.com/NixOS/nixpkgs/issues/48780 (not solved yet) although if you're on ubuntu I would simply use vanilla conda. conda in nixos works by building a chroot, better to avoid that complexity if possible? – olejorgenb Jan 19 '19 at 13:21

0 Answers0