Repository navigation
wrapGAppsHook: prepare for structuredAttrs - #511330
Conversation
fb19350 to
1a75510
Compare
|
Making it work for all outputs seems like an improvement regardless, but it's not great that we can't get outputs in order any more… that means there's no way to get the default output? |
|
So overall makes sense. Would be nice to see the associative array version. |
1a75510 to
3d8860f
Compare
|
Pushed a new version using an associative array - apparently we need a
I'm not sure - it makes sense that the order is lost inside the associative array, but I also don't immediately see a separate variable to keep track of the default. There is some logic in Edit: output handling for |
3d8860f to
c80428c
Compare
This hook is called in the fixupPhase via
```
local output
for output in $(getAllOutputNames); do
prefix="${!output}" runHook fixupOutput
done
```
Without `__structuredAttrs`, `getAllOutputNames` returns the `output` array, in order.
However, with `__structuredAttrs`, it returns the keys of the `output` associative array,
which are no longer necessarily ordered in the same way.
In the case of some packages (e.g. `mate-panel-with-applets`) this means that instead of
`[ "out" "man" ]`, we process `[ "man" "out" ]`. Running the hook for `"man"` then sets
`wrapGAppsHookHasRun` and no wrapping is done for `"out"`, which is what was really needed.
Instead, keep track of whether the hook has run on a per-output basis. That way, the order
does not matter and any executables that are spread around multiple outputs are wrapped.
c80428c to
a0ee897
Compare
|
Also tested this commit and this commit + #523612 applied to master with |
This partially reverts commit 72a37f9. Requires NixOS#511330 .
This reverts commit 72a37f9. Requires NixOS#511330 .
|
Actually, maybe we want to skip |
|
Successfully created backport PR for |
|
Successfully created backport PR for |
This hook is called in the fixupPhase via
Without
__structuredAttrs,getAllOutputNamesreturns theoutputarray, in order. However, with__structuredAttrs, it returns the keys of theoutputassociative array, which are no longer necessarily ordered in the same way.In the case of some packages (e.g.
mate-panel-with-applets) this means that instead of[ "out" "man" ], we process[ "man" "out" ]. Running the hook for"man"then setswrapGAppsHookHasRunand no wrapping is done for"out", which is what was really needed.Instead, keep track of whether the hook has run on a per-output basis. That way, the order does not matter and any executables that are spread around multiple outputs are wrapped.
I tried to do this using an associative array to keep track of which outputs we've already seen, but I couldn't get the syntax to work for some reason (maybe due to lack of sleep :)) - if the general approach makes sense I can take another stab at that.
This should allow #511162 to be reverted.
Things done
passthru.tests.nixpkgs-reviewon this PR. See nixpkgs-review usage../result/bin/.