NixOS / nix

Nix, the purely functional package manager
https://nixos.org/
GNU Lesser General Public License v2.1
12.28k stars 1.48k forks source link

Don't chown when local-store is read-only #10916

Closed jmbaur closed 3 months ago

jmbaur commented 3 months ago

Motivation

If the local-store is using the read-only flag, the underlying filesystem might be read-only, thus an attempt to chown would always fail.

Context

Using local-overlay-store and read-only-local-store fails to work due to an attempt to chown the lower store's directory to root:nixbld

Priorities and Process

Add :+1: to pull requests you find important.

The Nix maintainer team uses a GitHub project board to schedule and track reviews.

Ericson2314 commented 3 months ago

We should move this down so it doesn't hide the warnings, however.

roberth commented 3 months ago

@Ericson2314 This makes the command more fragile though, because it adds an irrelevant check and irrelevant error. Simple store reading operations should just work, even if the configuration can't build. Do you agree it's better to revert https://github.com/NixOS/nix/compare/e503e9bfd3fc0031707286ae13aa182ed1288976..de639ceafe75ae25293f49f170ccad0c3e4a133f?

roberth commented 3 months ago

Oh, I misread printError as something that throws. Of course it doesn't, so ignore my previous comment.

roberth commented 3 months ago

We don't have suitable testing infrastructure for this yet, so I'll open an issue for a regression test.