Skip to content
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

Maintain same ownership when formatting #248

Merged
merged 1 commit into from
Sep 3, 2024
Merged

Maintain same ownership when formatting #248

merged 1 commit into from
Sep 3, 2024

Conversation

infinisil
Copy link
Member

@infinisil infinisil commented Aug 29, 2024

Fixes #73

$ cabal install --installdir=$PWD/bin
Wrote tarball sdist to
/home/tweagysil/src/nixfmt/dist-newstyle/sdist/nixfmt-0.6.0.tar.gz
Resolving dependencies...
Symlinking 'nixfmt' to '/home/tweagysil/src/nixfmt/bin/nixfmt'

$ echo '1  +  1' > a.nix
$ sudo chown root:root a.nix

$ bin/nixfmt a.nix
nixfmt: ./.a.nix357406-0.atomic: setOwnerAndGroup: permission denied (Operation not permitted)
$ cat a.nix
1  +  1
$ stat -c "%U:%G" a.nix
root:root

$ sudo bin/nixfmt a.nix
$ cat a.nix
1 + 1
$ stat -c "%U:%G" a.nix
root:root


This work is sponsored by Antithesis

Copy link

github-actions bot commented Aug 29, 2024

Nixpkgs diff

@infinisil infinisil merged commit 3e8eef7 into master Sep 3, 2024
2 checks passed
@infinisil infinisil deleted the atomic-chown branch September 3, 2024 18:31
@nixos-discourse
Copy link

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

https://discourse.nixos.org/t/formatting-team-meeting-2024-09-03/51584/1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Nixfmt does not persist file ownership
4 participants