Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

conda: init at miniconda3 4.3.31 #34872

Merged
merged 3 commits into from Feb 18, 2018
Merged

conda: init at miniconda3 4.3.31 #34872

merged 3 commits into from Feb 18, 2018

Conversation

bhipple
Copy link
Contributor

@bhipple bhipple commented Feb 12, 2018

Motivation for this change

This takes the work done in PR #26443, which itself was a derivative work from
PR #26245, and adds a few improvements, including:

  • Upgrading to the latest miniconda3 installer script
  • Adding meta information for licenses, homepage, maintainers
  • Removing unnecessary emacs and git packages
  • Compact the expressions and docs a little
  • Rename the FHS script to conda-shell, to more consistently match conda-install and also be more easily discoverable with tab-complete
  • More consistently naming the installer miniconda3, in case we someday want to support miniconda.

On the last point, I don't think we really need to give a miniconda2 option, or
at least it isn't a high priority; conda itself can install and manage conda
environments and pythons, so AFAICT a miniconda2 install would just save a small
amount of download bandwidth when someone who wants exclusively python2 adds a
python2 environment.

CC @FRidh @jluttine @layus

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option build-use-sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.

@bhipple
Copy link
Contributor Author

bhipple commented Feb 12, 2018

@GrahamcOfBorg build conda

@GrahamcOfBorg
Copy link

Success on aarch64-linux (full log)

Partial log (click to expand)

collision between `/nix/store/kzgnkvjy768hd8k3q0p61zchhv17kg3p-gcc-6.4.0-lib/lib/libgcc_s.so.1' and `/nix/store/fij62nvzlwdgih6hgdahv9mxrlzy7kna-glibc-2.26-131/lib/libgcc_s.so.1'
collision between `/nix/store/kzgnkvjy768hd8k3q0p61zchhv17kg3p-gcc-6.4.0-lib/lib64/libgcc_s.so' and `/nix/store/fij62nvzlwdgih6hgdahv9mxrlzy7kna-glibc-2.26-131/lib64/libgcc_s.so'
collision between `/nix/store/kzgnkvjy768hd8k3q0p61zchhv17kg3p-gcc-6.4.0-lib/lib64/libgcc_s.so.1' and `/nix/store/fij62nvzlwdgih6hgdahv9mxrlzy7kna-glibc-2.26-131/lib64/libgcc_s.so.1'
collision between `/nix/store/zhx0mndbdj0191b8ia2vyp85y36pwdkq-shadow-4.5/etc/login.defs' and `/nix/store/h7n3f3mbq5qdzcpvn7slidhi7xrqmhrp-conda-shell-chrootenv-etc/etc/login.defs'
collision between `/nix/store/zhx0mndbdj0191b8ia2vyp85y36pwdkq-shadow-4.5/etc/pam.d' and `/nix/store/h7n3f3mbq5qdzcpvn7slidhi7xrqmhrp-conda-shell-chrootenv-etc/etc/pam.d'
created 1148 symlinks in user environment
building '/nix/store/94lrd8k4qvncb462idygximfp5n011zv-conda-shell-fhs.drv'...
building '/nix/store/k0rai71m4kq53b5kg77wz6cf264d40mc-conda-shell-init.drv'...
building '/nix/store/slcx530hyiaig829r3hph7sskyj407kh-conda-shell.drv'...
/nix/store/5h6kg5x1644si26rq4l2ybyv8xma140q-conda-shell

@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Partial log (click to expand)

collision between `/nix/store/kzqrxkxs6lcbhxlalcim7zz6xay0i2f2-gcc-6.4.0-lib/lib/libgcc_s.so.1' and `/nix/store/diqn7sliwgm97bv83aklxxmpjdz4n2sj-glibc-multi-2.26-131/lib/libgcc_s.so.1'
collision between `/nix/store/kzqrxkxs6lcbhxlalcim7zz6xay0i2f2-gcc-6.4.0-lib/lib64/libgcc_s.so' and `/nix/store/diqn7sliwgm97bv83aklxxmpjdz4n2sj-glibc-multi-2.26-131/lib64/libgcc_s.so'
collision between `/nix/store/kzqrxkxs6lcbhxlalcim7zz6xay0i2f2-gcc-6.4.0-lib/lib64/libgcc_s.so.1' and `/nix/store/diqn7sliwgm97bv83aklxxmpjdz4n2sj-glibc-multi-2.26-131/lib64/libgcc_s.so.1'
collision between `/nix/store/w2kj9zddzmfsjmkfnbnypblm54hdi9d7-shadow-4.5/etc/login.defs' and `/nix/store/9i4m29p8nslxjq7rqbbvb1j0y7s840zr-conda-shell-chrootenv-etc/etc/login.defs'
collision between `/nix/store/w2kj9zddzmfsjmkfnbnypblm54hdi9d7-shadow-4.5/etc/pam.d' and `/nix/store/9i4m29p8nslxjq7rqbbvb1j0y7s840zr-conda-shell-chrootenv-etc/etc/pam.d'
created 1162 symlinks in user environment
building '/nix/store/5alv2fg6cbii6axl5dm7vmzc04w5wvjf-conda-shell-fhs.drv'...
building '/nix/store/7sjx0l2j0hq21ygirw58qdb4w22ahg8a-conda-shell-init.drv'...
building '/nix/store/hpgi0m4lr71gq2xs0v7akah2w8v0swf2-conda-shell.drv'...
/nix/store/g8qikismr6h66hn094c1ciirdcbvjgw6-conda-shell

@GrahamcOfBorg
Copy link

Success on aarch64-linux (full log)

Partial log (click to expand)

/nix/store/5h6kg5x1644si26rq4l2ybyv8xma140q-conda-shell

@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Partial log (click to expand)

collision between `/nix/store/kzqrxkxs6lcbhxlalcim7zz6xay0i2f2-gcc-6.4.0-lib/lib64/libgcc_s.so.1' and `/nix/store/diqn7sliwgm97bv83aklxxmpjdz4n2sj-glibc-multi-2.26-131/lib64/libgcc_s.so.1'
collision between `/nix/store/kzqrxkxs6lcbhxlalcim7zz6xay0i2f2-gcc-6.4.0-lib/lib/libgcc_s.so' and `/nix/store/diqn7sliwgm97bv83aklxxmpjdz4n2sj-glibc-multi-2.26-131/lib/libgcc_s.so'
collision between `/nix/store/kzqrxkxs6lcbhxlalcim7zz6xay0i2f2-gcc-6.4.0-lib/lib/libgcc_s.so.1' and `/nix/store/diqn7sliwgm97bv83aklxxmpjdz4n2sj-glibc-multi-2.26-131/lib/libgcc_s.so.1'
collision between `/nix/store/w2kj9zddzmfsjmkfnbnypblm54hdi9d7-shadow-4.5/etc/login.defs' and `/nix/store/9i4m29p8nslxjq7rqbbvb1j0y7s840zr-conda-shell-chrootenv-etc/etc/login.defs'
collision between `/nix/store/w2kj9zddzmfsjmkfnbnypblm54hdi9d7-shadow-4.5/etc/pam.d' and `/nix/store/9i4m29p8nslxjq7rqbbvb1j0y7s840zr-conda-shell-chrootenv-etc/etc/pam.d'
created 1162 symlinks in user environment
building path(s) ‘/nix/store/h18q7aqmm2wci9md64by1wx7znh6kz91-conda-shell-fhs’
building path(s) ‘/nix/store/69nkzvfr1zp6wmn4fiyihpxrp9xkp9nf-conda-shell-init’
building path(s) ‘/nix/store/g8qikismr6h66hn094c1ciirdcbvjgw6-conda-shell’
/nix/store/g8qikismr6h66hn094c1ciirdcbvjgw6-conda-shell

@jluttine
Copy link
Member

Thanks! I didn't test it but took a quick look and looks good to me. Great that this is being worked on!

Just some general questions:

  • If one wanted to add some packages to the FHS conda environment, how is that done? With overlays? Or what is (or would be) the most convenient way to support that?

  • Can I easily define different conda environments for my projects? So that I add shell.nix to each of my project directory and those files can add whatever system packages the project needs to the conda FHS environment. Then, instead of running conda-shell, I'd run nix-shell in the project directory. Should some instructions on this be added?

I'm relatively new to nix so I suppose these are quite easy to achieve, but just wondering what is the "correct" way.

Copy link
Member

@FRidh FRidh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for taking this on!

@@ -0,0 +1,98 @@
{ lib
, pkgs
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not pkgs but individual packages

# $ conda-shell
# $ conda install spyder
let
minicondaInstaller = pkgs.stdenv.mkDerivation rec {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it makes more sense to use runCommand here

name = "conda-shell";
targetPkgs = pkgs: (
with pkgs; [
conda
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There should likely be a way to extend the packages here.

homepage = https://conda.io/;
platforms = lib.platforms.linux;
license = lib.licenses.bsd3;
maintainers = with lib.maintainers; [ jluttine fridh bhipple ];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove me from the maintainers. I don't intend to use it.

@FRidh FRidh mentioned this pull request Feb 12, 2018
7 tasks
- Overlay-friendly extraPkgs list for FHS customization
- Update maintainers
- Simplify installer script download significantly
- Explicitly mention packages used, instead of pkgs
# Conda manages most pkgs itself, but expects a few to be on the system.
, condaDeps ? [ stdenv.cc xorg.libSM xorg.libICE xorg.libXrender libselinux ]
# Any extra nixpkgs you'd like available in the FHS env for Conda to use
, extraPkgs ? [ ]
Copy link
Contributor Author

@bhipple bhipple Feb 13, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can be extended with an overlay as such:

$ cat ~/.config/nixpkgs/overlays/conda.nix                                                                                 ~/src/nixpkgs
self: super:
{
  conda = super.conda.override {
    extraPkgs = [ self.sssd self.firefox ];
  };
}

$ conda-shell
$ ls -l /usr/bin/firefox
lrwxrwxrwx 1 nobody nogroup 78 Dec 31  1969 /usr/bin/firefox -> /nix/store/a258dljnrj0chhnb6dpir2106yimfkb9-conda-shell-usr-target/bin/firefox

$ ls -l /usr/lib/sssd/libsss_krb5.so
lrwxrwxrwx 1 nobody nogroup 90 Dec 31  1969 /usr/lib/sssd/libsss_krb5.so -> /nix/store/a258dljnrj0chhnb6dpir2106yimfkb9-conda-shell-usr-target/lib/sssd/libsss_krb5.so

We could condense condaDeps and extraPkgs into one for simplicity, though they're both overridable in an overlay. I think logically the first one is more for "you're almost certainly going to need this" and the 2nd one is more for user tools like git/emacs, but don't feel too strongly either way.

src = fetchurl {
url = "https://repo.continuum.io/miniconda/Miniconda3-${version}-Linux-x86_64.sh";
sha256 = "1rklq81s9v7xz1q0ha99w2sl6kyc5vhk6b21cza0jr3b8cgz0lam";
};
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the tip to get rid of mkDerivation @FRidh; this is WAY simpler!

@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Partial log (click to expand)

collision between `/nix/store/kzqrxkxs6lcbhxlalcim7zz6xay0i2f2-gcc-6.4.0-lib/lib64/libgcc_s.so.1' and `/nix/store/diqn7sliwgm97bv83aklxxmpjdz4n2sj-glibc-multi-2.26-131/lib64/libgcc_s.so.1'
collision between `/nix/store/kzqrxkxs6lcbhxlalcim7zz6xay0i2f2-gcc-6.4.0-lib/lib/libgcc_s.so' and `/nix/store/diqn7sliwgm97bv83aklxxmpjdz4n2sj-glibc-multi-2.26-131/lib/libgcc_s.so'
collision between `/nix/store/kzqrxkxs6lcbhxlalcim7zz6xay0i2f2-gcc-6.4.0-lib/lib/libgcc_s.so.1' and `/nix/store/diqn7sliwgm97bv83aklxxmpjdz4n2sj-glibc-multi-2.26-131/lib/libgcc_s.so.1'
collision between `/nix/store/w2kj9zddzmfsjmkfnbnypblm54hdi9d7-shadow-4.5/etc/login.defs' and `/nix/store/9i4m29p8nslxjq7rqbbvb1j0y7s840zr-conda-shell-chrootenv-etc/etc/login.defs'
collision between `/nix/store/w2kj9zddzmfsjmkfnbnypblm54hdi9d7-shadow-4.5/etc/pam.d' and `/nix/store/9i4m29p8nslxjq7rqbbvb1j0y7s840zr-conda-shell-chrootenv-etc/etc/pam.d'
created 1163 symlinks in user environment
building path(s) ‘/nix/store/0qhpl5d4009xfgncjs3a5fyhlb3zc8rx-conda-shell-fhs’
building path(s) ‘/nix/store/r25zy2hzw2za42idjbzwvp1yxmkc87bg-conda-shell-init’
building path(s) ‘/nix/store/qpzbjv2yclh49gfmfsnd1qmnqf6k3ysf-conda-shell’
/nix/store/qpzbjv2yclh49gfmfsnd1qmnqf6k3ysf-conda-shell

@GrahamcOfBorg
Copy link

Success on aarch64-linux (full log)

Partial log (click to expand)

collision between `/nix/store/kzgnkvjy768hd8k3q0p61zchhv17kg3p-gcc-6.4.0-lib/lib/libgcc_s.so.1' and `/nix/store/fij62nvzlwdgih6hgdahv9mxrlzy7kna-glibc-2.26-131/lib/libgcc_s.so.1'
collision between `/nix/store/kzgnkvjy768hd8k3q0p61zchhv17kg3p-gcc-6.4.0-lib/lib64/libgcc_s.so' and `/nix/store/fij62nvzlwdgih6hgdahv9mxrlzy7kna-glibc-2.26-131/lib64/libgcc_s.so'
collision between `/nix/store/kzgnkvjy768hd8k3q0p61zchhv17kg3p-gcc-6.4.0-lib/lib64/libgcc_s.so.1' and `/nix/store/fij62nvzlwdgih6hgdahv9mxrlzy7kna-glibc-2.26-131/lib64/libgcc_s.so.1'
collision between `/nix/store/zhx0mndbdj0191b8ia2vyp85y36pwdkq-shadow-4.5/etc/login.defs' and `/nix/store/h7n3f3mbq5qdzcpvn7slidhi7xrqmhrp-conda-shell-chrootenv-etc/etc/login.defs'
collision between `/nix/store/zhx0mndbdj0191b8ia2vyp85y36pwdkq-shadow-4.5/etc/pam.d' and `/nix/store/h7n3f3mbq5qdzcpvn7slidhi7xrqmhrp-conda-shell-chrootenv-etc/etc/pam.d'
created 1149 symlinks in user environment
building '/nix/store/qzifyl0rmik5hh9qzjs4wihqgdh461j7-conda-shell-fhs.drv'...
building '/nix/store/w33ybqgd797fb684dsw7ixdjzcc71a3q-conda-shell-init.drv'...
building '/nix/store/skn6bz6hxsxvfa07ikb28zqsp3cirxvv-conda-shell.drv'...
/nix/store/lhb4l1ghz0qjn0x3sx29lal6jcz4ip17-conda-shell

@bhipple
Copy link
Contributor Author

bhipple commented Feb 13, 2018

@jluttine regarding your second question, conda has full support for managing its own environments in ~/.conda/ and switching seamlessly between them; since it saves those envs in its state directory they won't be lost between nix sessions. I don't think we want to interfere too much with the actual package management and environment management of conda itself, since it's already reasonably good at it, but I could imagine a configurable shellHook that runs source activate <conda env name> for you automatically after running conda-shell. Conda is changing the way environments are activated and toggled in the upcoming major version, though, so we might want to hold off on implementing that wrapper feature for the time being.

@@ -6943,6 +6943,8 @@ with pkgs;
};
purePackages = recurseIntoAttrs (callPackage ./pure-packages.nix {});

conda = callPackage ../development/interpreters/conda { };
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should actually move the expression to pkgs/tools/package-management/

@FRidh FRidh merged commit 5ab4287 into NixOS:master Feb 18, 2018
@bhipple
Copy link
Contributor Author

bhipple commented Feb 18, 2018

Sounds sensible to me. As a matter of general policy, would you prefer if I squashed and rebased my commits after code review updates to keep the history clean, or leave the shas intact so you can just review the updated diff? I guess github has a squash-merge option now so we can get the best of both worlds if I don't do so myself? I didn't see anything in the mmanual about this.

@FRidh
Copy link
Member

FRidh commented Feb 18, 2018

In general it is preferred when commits are "ready to merge" and that would mean that unnecessary commits have been squashed.

@bhipple
Copy link
Contributor Author

bhipple commented Feb 18, 2018

Looks like you used the github squash-merge option, so we get a nice clean history without the reviewer having to double check that the claimed "no-op" manual rebase and squash is actually so 👍

I see some other mergers don't use it, though -- it might be worth noting something in https://nixos.org/nixpkgs/manual/#idm140737316961072 to encourage doing so when the individual commits don't contain particularly useful information.

@GrahamcOfBorg
Copy link

Success on aarch64-linux (full log)

Partial log (click to expand)

collision between `/nix/store/q3d0qg3rsdjkfw7zbxa5cd71rfsbspl0-gcc-6.4.0-lib/lib64/libgcc_s.so' and `/nix/store/6aqa4qjkx4q1zxinkrp14r2k1k13ph8p-glibc-2.26-131/lib64/libgcc_s.so'
collision between `/nix/store/q3d0qg3rsdjkfw7zbxa5cd71rfsbspl0-gcc-6.4.0-lib/lib/libgcc_s.so.1' and `/nix/store/6aqa4qjkx4q1zxinkrp14r2k1k13ph8p-glibc-2.26-131/lib/libgcc_s.so.1'
collision between `/nix/store/q3d0qg3rsdjkfw7zbxa5cd71rfsbspl0-gcc-6.4.0-lib/lib/libgcc_s.so' and `/nix/store/6aqa4qjkx4q1zxinkrp14r2k1k13ph8p-glibc-2.26-131/lib/libgcc_s.so'
collision between `/nix/store/hl22lhhz9bfin4bp3pjq6i1xmw8acr6y-shadow-4.5/etc/pam.d' and `/nix/store/l463zacwgdwc4nc2ylvdqfklwys23pcc-conda-shell-chrootenv-etc/etc/pam.d'
collision between `/nix/store/hl22lhhz9bfin4bp3pjq6i1xmw8acr6y-shadow-4.5/etc/login.defs' and `/nix/store/l463zacwgdwc4nc2ylvdqfklwys23pcc-conda-shell-chrootenv-etc/etc/login.defs'
created 1149 symlinks in user environment
building '/nix/store/09jsyfrxvr1ilhr0bx3p8mqv6i9cami8-conda-shell-fhs.drv'...
building '/nix/store/51a8gdcpi9b4w0x347dlryk5b0n2f8kr-conda-shell-init.drv'...
building '/nix/store/basr4zvk7yqmr1kagsbm90k9pqb9gyvh-conda-shell.drv'...
/nix/store/a9y08alhd6ji31rqjyr8a2p5f3nl1si2-conda-shell

@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Partial log (click to expand)

collision between `/nix/store/003d91yhs72g120rkshp2d2hqsvi2368-gcc-6.4.0-lib/lib64/libgcc_s.so.1' and `/nix/store/jz04c5060whhj9my2qvj9hkh39qjf1q6-glibc-multi-2.26-131/lib64/libgcc_s.so.1'
collision between `/nix/store/003d91yhs72g120rkshp2d2hqsvi2368-gcc-6.4.0-lib/lib/libgcc_s.so' and `/nix/store/jz04c5060whhj9my2qvj9hkh39qjf1q6-glibc-multi-2.26-131/lib/libgcc_s.so'
collision between `/nix/store/003d91yhs72g120rkshp2d2hqsvi2368-gcc-6.4.0-lib/lib/libgcc_s.so.1' and `/nix/store/jz04c5060whhj9my2qvj9hkh39qjf1q6-glibc-multi-2.26-131/lib/libgcc_s.so.1'
collision between `/nix/store/8rkq0dwlgq7cs8gqkay7h1crwr42ksfv-shadow-4.5/etc/login.defs' and `/nix/store/0hpxc2mas6zs9zjzwsr10kkldf7cjv90-conda-shell-chrootenv-etc/etc/login.defs'
collision between `/nix/store/8rkq0dwlgq7cs8gqkay7h1crwr42ksfv-shadow-4.5/etc/pam.d' and `/nix/store/0hpxc2mas6zs9zjzwsr10kkldf7cjv90-conda-shell-chrootenv-etc/etc/pam.d'
created 1163 symlinks in user environment
building path(s) ‘/nix/store/cis6hnx4rybdwhr8hff3ky53h54j2vgf-conda-shell-fhs’
building path(s) ‘/nix/store/b855pc8fvya2kpy23067cnpqz71dk1hj-conda-shell-init’
building path(s) ‘/nix/store/imfgcmhkjib8jdppcb4v27l8i3kdsbwr-conda-shell’
/nix/store/imfgcmhkjib8jdppcb4v27l8i3kdsbwr-conda-shell

@FRidh
Copy link
Member

FRidh commented Feb 18, 2018

I know not everyone likes squashing as a maintainer, as that means purging the contributors history (although of course the original commits are still existing on the original branch).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants