Skip to content

fix(build): Use nix from the buildir instead of the installed one#7747

Closed
Et7f3 wants to merge 1 commit intoNixOS:masterfrom
Et7f3:fix_build_man
Closed

fix(build): Use nix from the buildir instead of the installed one#7747
Et7f3 wants to merge 1 commit intoNixOS:masterfrom
Et7f3:fix_build_man

Conversation

@Et7f3
Copy link
Contributor

@Et7f3 Et7f3 commented Feb 4, 2023

Motivation

Context

fix #7124

I think it wasn't caught because nix develop configurePhase set a prefix to local directory that is writeable.

Checklist for maintainers

Maintainers: tick if completed or explain if not relevant

  • agreed on idea
  • agreed on implementation strategy
  • tests, as appropriate
    • functional tests - tests/**.sh
    • unit tests - src/*/tests
    • integration tests - tests/nixos/*
  • documentation in the manual
  • code and comments are self-explanatory
  • commit message explains why the change was made
  • new feature or bug fix: updated release notes


# Technically it will be defined by mk/programs.mk
# but we can't use it as dependency of target unless we enable .SECONDEXPANSION:
nix_PATH = $(buildprefix)src/nix/nix
Copy link
Contributor Author

@Et7f3 Et7f3 Feb 4, 2023

Choose a reason for hiding this comment

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

It can be made more generic with

Suggested change
nix_PATH = $(buildprefix)src/nix/nix
nix_PATH = $(buildprefix)$(nix_DIR)/nix

$(nix_NAME) isn't available without .SECONDEXPANSION:

@edolstra
Copy link
Member

edolstra commented Feb 7, 2023

Our build system by intent uses make install, not make. (E.g. the main tests are make installcheck.) We should probably just remove the rules that build $(buildprefix)src/nix/nix etc. to avoid confusion.

@Et7f3
Copy link
Contributor Author

Et7f3 commented Feb 8, 2023

So we will need in configure to give a prefix writable by user ? I think it is more common and less disturbing to have a CMMI (without needing to pass --prefix) and make that is enough for on root users (without having to use a prefix)

@fricklerhandwerk
Copy link
Contributor

fricklerhandwerk commented Feb 20, 2023

Triaged in the Nix team meeting 2023-02-17:

  • @edolstra: probably a misunderstanding of the build process. one should use make install. this may be surprising for people used to other build processes.
  • to discuss how to solve the underlying problem

@nixos-discourse
Copy link

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/2023-02-17-nix-team-meeting-minutes-33/25624/1

@thufschmitt thufschmitt added the contributor-experience Developer experience for Nix contributors label Feb 27, 2023
@Ericson2314
Copy link
Member

Duplicate of #5145. I changed the include order to avoid the expansion order problems and avoid needing to define twice.

@Et7f3 Et7f3 deleted the fix_build_man branch November 30, 2023 08:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

contributor-experience Developer experience for Nix contributors

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

ld: cannot open output file /usr/lib64/libnixutil.so: Permission denied

6 participants