mirror of
https://github.com/NixOS/nix.git
synced 2025-11-15 06:52:43 +01:00
macOS: Remove flags
In particular, UF_IMMUTABLE (uchg) needs to be cleared to allow the
path to be garbage-collected or optimised.
See https://github.com/NixOS/nixpkgs/issues/25819.
+ the file from being garbage-collected.
(cherry picked from commit b5bdfdef73)
This commit is contained in:
parent
11dd08f02e
commit
026f4f9ae8
1 changed files with 10 additions and 0 deletions
|
|
@ -571,6 +571,16 @@ static void canonicalisePathMetaData_(const Path & path, uid_t fromUid, InodesSe
|
||||||
{
|
{
|
||||||
checkInterrupt();
|
checkInterrupt();
|
||||||
|
|
||||||
|
#if __APPLE__
|
||||||
|
/* Remove flags, in particular UF_IMMUTABLE which would prevent
|
||||||
|
the file from being garbage-collected. FIXME: Use
|
||||||
|
setattrlist() to remove other attributes as well. */
|
||||||
|
if (lchflags(path.c_str(), 0)) {
|
||||||
|
if (errno != ENOTSUP)
|
||||||
|
throw SysError(format("clearing flags of path ‘%1%’") % path);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
struct stat st;
|
struct stat st;
|
||||||
if (lstat(path.c_str(), &st))
|
if (lstat(path.c_str(), &st))
|
||||||
throw SysError(format("getting attributes of path ‘%1%’") % path);
|
throw SysError(format("getting attributes of path ‘%1%’") % path);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue