Skip to content

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

Merged
roberth merged 1 commit intoNixOS:masterfrom
jmbaur:read-only-no-chown
Jun 17, 2024
Merged

Don't chown when local-store is read-only#10916
roberth merged 1 commit intoNixOS:masterfrom
jmbaur:read-only-no-chown

Conversation

@jmbaur
Copy link
Contributor

@jmbaur jmbaur commented Jun 15, 2024

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 👍 to pull requests you find important.

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

@github-actions github-actions bot added the store Issues and pull requests concerning the Nix store label Jun 15, 2024
@Ericson2314
Copy link
Member

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

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.
@jmbaur jmbaur force-pushed the read-only-no-chown branch from e503e9b to de639ce Compare June 17, 2024 06:03
@roberth
Copy link
Member

roberth commented Jun 17, 2024

@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
Copy link
Member

roberth commented Jun 17, 2024

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

@roberth
Copy link
Member

roberth commented Jun 17, 2024

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

@roberth roberth merged commit e48abec into NixOS:master Jun 17, 2024
@jmbaur jmbaur deleted the read-only-no-chown branch June 17, 2024 12:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

store Issues and pull requests concerning the Nix store

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants