-
-
Notifications
You must be signed in to change notification settings - Fork 14k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Haskell generic bash completions break cross-compilation #49748
Comments
cc @Ericson2314 |
I would just not do it during cross compilation for. K |
I think disabling makes the most sense. You could use the native-built one but it might end up being incorrect. For instance one option is only available for one architecture or operating system. |
It's actually a very very predictable script that does not depend on the options. For this reason, duplicating it in Nix is actually feasible. It depends only on the executable name/path and the command name. Example:
|
Of course this is a 'nice to have'. We can do without completions on cross. |
Thank you for your contributions. This has been automatically marked as stale because it has had no activity for 180 days. If this is still important to you, we ask that you leave a comment below. Your comment can be as simple as "still important to me". This lets people see that at least one person still cares about this. Someone will have to do this at most twice a year if there is no other activity. Here are suggestions that might help resolve this more quickly:
|
The protocol between shell and executable has been fairly stable and the maintainer cares about compatibility, because non-Nix users can have scripts that are out of sync with (upgraded) executables. |
Is there a recommended way to disable the completions for cross compiling? |
None of the overrides in nixpkgs seem to handle this. You could define a function with the same name in the package set |
diff --git a/pkgs/development/haskell-modules/lib/compose.nix b/pkgs/development/haskell-modules/lib/compose.nix
index 600bf80cb19..575b2e08f11 100644
--- a/pkgs/development/haskell-modules/lib/compose.nix
+++ b/pkgs/development/haskell-modules/lib/compose.nix
@@ -437,9 +437,9 @@ rec {
zshCompDir="''${!outputBin}/share/zsh/vendor-completions"
fishCompDir="''${!outputBin}/share/fish/vendor_completions.d"
mkdir -p "$bashCompDir" "$zshCompDir" "$fishCompDir"
- "''${!outputBin}/bin/${exeName}" --bash-completion-script "''${!outputBin}/bin/${exeName}" >"$bashCompDir/${exeName}"
- "''${!outputBin}/bin/${exeName}" --zsh-completion-script "''${!outputBin}/bin/${exeName}" >"$zshCompDir/_${exeName}"
- "''${!outputBin}/bin/${exeName}" --fish-completion-script "''${!outputBin}/bin/${exeName}" >"$fishCompDir/${exeName}.fish"
+ ${pkgs.stdenv.hostPlatform.emulator pkgs.buildPackages} "''${!outputBin}/bin/${exeName}" --bash-completion-script "''${!outputBin}/bin/${exeName}" >"$bashCompDir/${exeName}"
+ ${pkgs.stdenv.hostPlatform.emulator pkgs.buildPackages} "''${!outputBin}/bin/${exeName}" --zsh-completion-script "''${!outputBin}/bin/${exeName}" >"$zshCompDir/_${exeName}"
+ ${pkgs.stdenv.hostPlatform.emulator pkgs.buildPackages} "''${!outputBin}/bin/${exeName}" --fish-completion-script "''${!outputBin}/bin/${exeName}" >"$fishCompDir/${exeName}.fish"
# Sanity check
grep -F ${exeName} <$bashCompDir/${exeName} >/dev/null || { this would probably work, did not test |
Resolved by commit ac1f1ad |
Issue description
Completions in Haskell currently break cross compilation.
Since #49477 we have a function that does this generically for Haskell packages. This can be improved by either:
Steps to reproduce
Cross compile a package with completions, like stack. It will call the build output and fail.
Note that stack currently has its own override in hackage2nix, which is probably best to disable in favor of the library functions.
The text was updated successfully, but these errors were encountered: