-
Notifications
You must be signed in to change notification settings - Fork 74
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
add support for the Nix package manager #115
base: master
Are you sure you want to change the base?
Conversation
it seems the travis error is just a config error, it is not cause by the code in this PR |
I would kind of love to be able to just use Nix everywhere since it would probably make a lot of interactions with installing system software drastically less brittle. |
That would be absolutely fantastic! I am dreaming of a system where I could define a .nix expression in my project, nix-shell into it, and have julia, all the packages required and their bindeps in scope. And in a different terminal a different project with its depedencies etc. It would allow to have (hopefully) 100% reproducible julia environments for each and every research project, readily accessible as .nix in its respective git repo. I was planning to look into how npm2nix does this. (https://github.com/NixOS/npm2nix, http://sandervanderburg.blogspot.co.at/2014/10/deploying-npm-packages-with-nix-package.html). But a cleaner (and more radical) approach would be to use nix as the underlying architecture for julia packages, merging the functionality of Pkg and BinDeps... |
just a gentle bump ;-) |
As a general rule, I'm against providing multiple ways to get packages on a single platform as that just increases the surface area available for installation errors to occur. (For example, the recent |
Nix does build from source, but has a binary cache at nixos.org, so in most cases you dont actually need to build things. But as the absolute path is part of the hash used to identify build products, you get this benefit only in the case when nix can store its packages in /nix. If a non-standard location like ~/nix is used everything is build from source. |
I see. Very similar to Homebrew then. (Homebrew does have detection/declaration of whether a binary "bottle" is relocatable, but in practice many larger software packages are not relocatable) Correct me if I'm wrong, but this seems to mean that the main benefit of including this change is that we have a standardized method of building from source? So with the |
I do agree that the multiple providers are a bit cumbersome. We have support for apt, yum and pacman as they are the underlying managers for debian, centos and arch. Nix does this for nixos, but that is a niche distro, I agree. |
Yes, exactly what you are saying. In theory it would even allow us to use it as sole BinDeps provider for linux distros + OSX, but OSX support, while present, is currently being reworked for 10.10. |
Alright. In that case, we need to ensure that I believe if we treat We may need to create a new "category" of builders, e.g. How does that sound to you? |
Yes, Nix should only be used when apt/yum/pacman are not available, so |
Wait, this is really interesting, but if we are to choose one default package management system over the others, we should make a comprehensive comparison of the different systems before that. I can see at least these criteria:
Regarding the second point, you said Nix needs to build packages from source when installing them into the user home directory, which is unfortunate. Though Guix, which is based on Nix, claims that user profiles can be managed with only normal privileges: http://www.gnu.org/software/guix/manual/guix.html#Features It may be that the daemon runs as root, and is allowed to install any packages that user ask for, because they don't interfere with other users. This is a solution which may still be interesting. But there are several alternatives available. For example, 0install claims that installs with user rights only are possible, and that it runs on Windows and OS X: http://0install.net/why.html Linstaller seems to offer a similar set of features: http://0install.net/comparison.html |
Yes, once nix (similarly Guix) is installed by root, individual users can do whatever they want without interference and get the benefit of binary downloads. Just like you are saying, it is a daemon running as the user who owns /nix (http://nixos.org/nix/manual/#ssec-multi-user). Having the installation in a non-nix location, resorting to from-source builds, is the fallback in the case that no one-time installation of nix into /nix in possible on that system. While I would suggest to simply use Nix as one additional provider at the moment, keeping apt/yum/pacman and reevaluate a Nix-for-all strategy in the future, here are the notes for the bullet points:
|
FWIW, brew (which is already used for OSX) has a Linux port which uses the same recipes. |
I've used |
@rened have you used this patch against BinDeps to install a |
@staticfloat Yes, JuliaIO/HDF5.jl#177, but I can try with more packages (I want to add that to as many packages as possible anyway) and see how well it works? Also, I could try to disable e.g. apt on Ubuntu and make some experiments there. Any challenging packages you would be particularly interested in? |
If you want challenging, try Finally, if you're eager to start using this package manager for all of these, I should point out that |
Sounds good, I'll try that during the next couple of days - thanks for the pointers! |
hey there! We're working on offering a hosted notebook environment for julia using non root containers and would be very interested in getting this to work. Anything we can do to help? |
Thought I'd bump this. Most of Julia works flawlessly on NixOS, but I just tried to install HDF5.jl which has BinDeps as a dependency, and the install failed due to the use of Edit: for anyone on NixOS that finds this, here's how I'm currently solving this: https://gist.github.com/tbenst/7c33680b5bac66a2a758827655517ea4 |
This PR is pretty out of date at this point and it seems like the change needs to be with BinaryBuilder or BinaryProvider not with BinDeps, so I'm not sure there's anything to do here anymore, is there? |
Nix is a package manager which can be used on various UNIXes, it is also the basis of the NixOS distribution.
One of its strengths is the fact that non-root users can install packages.