| 11 Nov 2025 |
ElvishJerricco | yea it's not clear to me why this function was written this way | 11:21:36 |
vcunat | I have a workaround for it. | 11:21:46 |
vcunat | (fixing some texlive builds at least) | 11:21:59 |
ElvishJerricco | good lord, the thing it does to extract extraOutputsToInstall appears to have been not working this whole time, so that's fun (there needed to be parens) | 11:22:50 |
vcunat | Yeah, I'm adding the parens, too. | 11:23:08 |
ElvishJerricco | oh we've done the same fix? :P | 11:23:17 |
ElvishJerricco | buildEnv' =
args:
(buildEnv (
{
inherit (args) name paths;
}
// lib.optionalAttrs (args ? extraOutputsToInstall) { inherit (args) extraOutputsToInstall; }
// lib.optionalAttrs (args ? pathsToLink) { inherit (args) pathsToLink; }
)).overrideAttrs
(
removeAttrs args [
"extraOutputsToInstall"
"pathsToLink"
"name"
"paths"
"pkgs"
]
);
| 11:23:39 |
vcunat | Yes, exactly. | 11:24:04 |
vcunat | Up to formatting and ordering in the list. | 11:24:14 |
ElvishJerricco | lol | 11:24:19 |
vcunat | * Up to formatting and ordering in the list. (I don't care about those) | 11:24:22 |
ElvishJerricco | yea, it does appear to resolve the issue | 11:24:40 |
ElvishJerricco | at the expense of perpetuating this madness | 11:24:46 |
Grimmauld (any/all) | Why not just:
buildEnv' =
args:
buildEnv (
{
inherit (args) name paths;
}
// (removeAttrs args [
"name"
"paths"
"pkgs"
])
);
Do we need the override?
| 11:24:50 |
vcunat | I suspect it might better be refactored to pass all args directly except some extra ones defined by buildEnv' | 11:24:57 |
Grimmauld (any/all) | actually wtf why is this wrapper there anyways | 11:25:09 |
ElvishJerricco | probably not but I'm afraid to change it :P | 11:25:08 |
Grimmauld (any/all) | like, that wrapper does nothing? i think? | 11:25:29 |
ElvishJerricco | yea wtf | 11:25:44 |
Grimmauld (any/all) | it removes pkgs, thats about it | 11:25:52 |
ElvishJerricco | I mean | 11:26:09 |
Grimmauld (any/all) | it inherits name and paths, it explicitly does extra outputs | 11:26:11 |
Grimmauld (any/all) | so why do we need that at all | 11:26:24 |
ElvishJerricco | technically, the args given to this buildEnv' are more powerful, because they become derivation attrs, not args to buildEnv | 11:26:26 |
ElvishJerricco | so that's technically a difference | 11:26:30 |
ElvishJerricco | but I don't know if that's actually used? | 11:26:40 |
Grimmauld (any/all) | HUH | 11:26:49 |
Grimmauld (any/all) | okay that is actually fair, hold on let me check | 11:27:02 |
Grimmauld (any/all) | oh yeah there is stuff like postBuild, meta, outputs and passthru and a whole mess of other things: https://github.com/NixOS/nixpkgs/blob/addd85b5d06ea90d5a7923956a65baf96bcd1e9f/pkgs/tools/typesetting/tex/texlive/build-tex-env.nix#L414-L480 | 11:28:08 |
ElvishJerricco | ok, so unless anyone wants to go sifting through all those instances and finding a better way to do them, we should just keep the override | 11:28:45 |