diff options
| author | Peder Bergebakken Sundt <pbsds@hotmail.com> | 2025-09-12 14:02:48 +0200 |
|---|---|---|
| committer | Peder Bergebakken Sundt <pbsds@hotmail.com> | 2025-09-12 14:08:39 +0200 |
| commit | 8bffdd4ccfc94eedd84b56d346adb9fac46b5ff6 (patch) | |
| tree | 1fd3a5827f609d56c2417b726f5dc3580a5ea7ac /pkgs/development/python-modules/termplotlib/gnuplot-subprocess.patch | |
| parent | acbc6a959f9656892573a570db4e859ae20e4cf3 (diff) | |
treewide: gate command execution for `installShellCompletion` behind `buildPlatform.canExecute hostPlatform`
This treewide conditions execution of the built applications for the purpose of generating shell completions behind `stdenv.buildPlatform.canExecute stdenv.hostPlatform`, which helps cross. This is a common issue I spot during review, let's prevent copy-paste errors by fixing it treewide.
Candidates were located with:
```shell
rg 'installShellCompletion' -l -tnix | xargs grep -F 'stdenv.buildPlatform.canExecute stdenv.hostPlatform' -L
```
Then I migrated the obvious cases which would not require a rebuild, as a means of testing.
This diff was not scripted. Should be zero rebuilds.
<details>
<summary>
Alternatives
</summary>
Alternatively I could have use this pattern:
```nix
postInstall = lib.optionalString (stdenv.hostPlatform.emulatorAvailable buildPackages) (
let
emulator = stdenv.hostPlatform.emulator buildPackages;
in
''
installShellCompletion --cmd foobar \
--bash <(${emulator} $out/bin/foobar completion bash) \
--fish <(${emulator} $out/bin/foobar completion fish) \
--zsh <(${emulator} $out/bin/foobar completion zsh)
''
);
```
but that would cause rebuilds and will also require testing.
---
An other alternative is to use the binary from the corresponding package in `buildPackages`.
This however would also cause rebuilds and will also require testing.
</details>
Diffstat (limited to 'pkgs/development/python-modules/termplotlib/gnuplot-subprocess.patch')
0 files changed, 0 insertions, 0 deletions
