Skip to content

Some of the targets are installed into $(prefix) during the build phase #5140

@pszubiak

Description

@pszubiak

Describe the bug

Some targets are installed into $(prefix) during the build phase

While building Nix from the master branch, some targets like libnixutil.so are installed into $(prefix) during the build phase. If the build user doesn't have permission to write into $(prefix) the build fails.

It doesn't happen on the 2.3-maintenance branch, or if the build is configured with the --disable-doc-gen option on the master branch.

Steps To Reproduce

  1. Checkout Nix master branch
  2. ./bootstrap.sh
  3. ./configure --prefix=/usr
  4. make
  GEN    Makefile.config
  GEN    src/libexpr/parser-tab.cc
  GEN    src/libexpr/lexer-tab.cc
  CXX    src/build-remote/build-remote.o
  CXX    src/nix-build/nix-build.o
  CXX    src/nix-channel/nix-channel.o
  CXX    src/nix-collect-garbage/nix-collect-garbage.o
  CXX    src/nix-copy-closure/nix-copy-closure.o
  ...
  CXX    src/libutil/util.o
  CXX    src/libutil/xml-writer.o
  LD     /usr/lib64/libnixutil.so
/opt/rh/gcc-toolset-9/root/usr/bin/ld: cannot open output file /usr/lib64/libnixutil.so: Permission denied
collect2: error: ld returned 1 exit status
make: *** [mk/lib.mk:117: /usr/lib64/libnixutil.so] Error 1

Expected behavior

Targets aren't installed $(prefix) during the build

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions