| 21 Sep 2025 |
sterni | emily: if both work, is it preferrable to use python3.pkgs.xattr or darwin.xattr? I originally packaged the latter because xattr/xattr lacked some flags but seems like they merged Apple's changes back… | 14:19:57 |
emily | hmm, I think we use darwin.file_cmds (which xattr is now an output of) for very little, e.g. we use GNU coreutils over the BSD-derived Darwin commands generally… so using whatever "everything else" uses generally seems sensible to me. OTOH, why is the other one… Python? it's a C codebase, right? | 14:23:30 |
emily | I guess it looks like either they ported the main() to Python, or they forked from Apple when its main() was Python but Apple have since ported it to C?! | 14:24:13 |
emily | it seems nice to avoid a runtime dependency on Python but I don't know if GHC already pulls that in | 14:24:41 |
emily | I would say, if this is an "if Darwin, one package, else another" type thing, and the fallback case works fine, then just do that. if it's a dependency only used on Darwin, file_cmds seems more canonical. | 14:24:59 |
emily | it looks like GHC is literally the only thing using darwin.(file_cmds.)xattr, though, and the only other thing using darwin.file_cmds is the somewhat stupendously useless darwin.mail_cmds. so if I ever get around to cleaning up some of the source releases that seem like busywork to maintain it's possible it would go away anyway. (OTOH maybe Swift Build will make them less busywork since we can reuse the upstream build systems more.) | 14:26:57 |
emily | uh, what does GHC want an xattr(1) for, anyway? | 14:27:04 |
sterni | https://gitlab.haskell.org/ghc/ghc/-/commit/bf65a7c388b | 14:41:54 |
sterni | I never checked whether it is actually necessary, Randy set XATTR=/does-not-exist for some bindists. I just packaged the darwin one when GHC started failing because it started executing /usr/bin/xattr | 14:42:43 |
sterni | emily: ah it used to be a literal fork of the python one (i.e. apple distributed the original (?) tarball and an ed(1) script) http://github.com/nixos/nixpkgs/commit/283d622397539f196416657da9dc804a4ca89846 | 14:48:17 |
sterni | I guess now that that has changed, we it is better to use the C one | 14:48:29 |
emily | the Nix store can't contain xattrs | 14:48:50 |
emily | I believe it strips them automatically | 14:48:55 |
emily | so most likely you do not need to give it anything | 14:49:01 |
sterni | but on write or on fixup | 14:49:14 |
sterni | though I guess that doesn't matter | 14:49:33 |
emily | https://github.com/NixOS/nix/commit/d798349ede3d6eb6e92a2e4f95f6b2179407ceb9 | 14:49:35 |
emily | uhh, #if __linux__ :) | 14:49:44 |
emily | I think that changed since though | 14:49:50 |
sterni | hm https://github.com/NixOS/nixpkgs/pull/413450 | 14:50:10 |
emily | the bonus fun is that you can get com.apple.provenance ones in there that are difficult to strip because they're part of XProtect | 14:50:09 |
emily | yes, it's "fun" | 14:50:42 |
emily | it mostly only causes issues with things like libarchive tests looking at xattrs | 14:50:48 |
emily | not sure why Randy has caught the virus and I haven't | 14:51:38 |