-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Build fails on DESTDIR= build environments: No rule to make target '/usr/bin/nix' #5781
Comments
Note that there is something weird about DESTDIR being required in the make stage (before make install). I stumbled into this bug when upgrading my openSUSE package to 2.5.1. I first got the error:
when doing:
Then I added DESTDIR to the make stage and ended here. IMHO just building should not end trying to chmod files in the destination directory. |
Debian Maintainer of package nix here probably with the same problem while packaging version 2.5.1:
Or is this a different issue? |
Proposed #6005 to restore basic |
I would actually prefer to get rid of It's also worth noting that for Nix, you really want to run |
From what I understand Do you know of any FHS distribution that uses mount namespaces to handle software installs? I'm curious to look at the way they deal with all the portability complications and other corner cases. I don't think mount namespaces work as is for such a layout: one still needs to allow Sounds a lot less portable and more nuanced than adding $DESTDIR as a prefix when copying a few files as a final step. In my opinion proliferation of
Requiring custom sandboxing mechanism just to make nix installed from source sounds like a very high bar to package nix. Is it expected to be more complicated than an average daemon? Then perhaps nix manual should explicitly guide on how distribution packagers are expected to provide nix packages when building it from source (say, by providing an example for concrete distribution like Fedora or Debian). |
Fixes: NixOS#5781 For linux distributions it is important that a projects build and install steps are clearly separated and that the install target can be overridden with the DESTDIR variable: https://www.gnu.org/software/make/manual/html_node/DESTDIR.html Before this patch some targets in doc/manual/local.mk had prerequisites on the INSTALLED nix binary which caused the BUILD step to depend on the INSTALL step. This patch changes the prerequisites to depend on the built but not yet installed nix binary.
@edolstra I think getting rid of DESTDIR will make hard to package nix. Given that nix itself introduces daemons and systemd services, it is expected that nix itself is installed as a package. https://build.opensuse.org/package/show/home:dmacvicar/nix How are distributions expected to build nix? |
I managed to build 2.7.0 on openSUSE using @trofi 's patch from #6005. |
d536c57 fixed all |
Linux distributions usually install packages into sandboxed environments before moving packages into live system:
nix
fails atmake install
stage:On
NixOS
it's easiest to reproduce by using inaccessible prefix:I sprinlked
s@$(bindir)/nix@$(DESTDIR)$(bindir)/nix@g
around with:But it's not enough as nix relies on it's own local libraries:
What would be the best way to fix it?
The text was updated successfully, but these errors were encountered: