Skip to content
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

restore shell completion #117

Open
sellout opened this issue Feb 19, 2025 · 1 comment
Open

restore shell completion #117

sellout opened this issue Feb 19, 2025 · 1 comment

Comments

@sellout
Copy link
Collaborator

sellout commented Feb 19, 2025

#116 removes shell completion, because using nixpkgs-unstable results in an error that had previously appeared in #97. #113 ostensibly fixed #97, but did so by inadvertently disabling shell completion. #113 reinstated the shell completion, but inadvertently revived #97.

So, we need to get shell completion working on both Nixpkgs 24.11 and unstable.

@sellout
Copy link
Collaborator Author

sellout commented Feb 19, 2025

Some comments from a conversation I had with @ceedubs about this:

Hunh … that’s odd for a couple reasons. One is that in the issue it was working on 24.05, but not unstable – but unstable then is (roughly) 24.11 now. And it works there, but fails on the next unstable again. So I wonder if there’s something special about unstable that doesn’t make it into releases. Also … does that path to unison (from the log) not exist on that machine, or does “required file not found” refer to some other file that is required by unison? And finally, I wonder if changing --bash <(${unison} --bash-completion-script ${unison}) to --bash <(./unison --bash-completion-script ${unison}) would work (i.e, build the completion script using the binary in the source tree, but referencing the binary that will eventually be installed).

Two addenda …

  1. “installed shell completion file ‘/nix/store/…/ucm.bash’ does not exist or has zero size” is an error I saw when putting together the PR – I think it’s a consequence of the build script not being run with -e (or some other strictness option), so a previous command fails (in this case, running unison), but the script continues on an creates an empty completion script.
  2. I wonder if there’s some other difference that the wrapped version has that’s required for it to work on unstable. I.e., wrapping the binary twice – once without --runtime-path so we can use it for completions, and once with --runtime-path for actual ucm. (Which is more of an experiment than a solution – making --bash-completion-script & friends work with --runtime-path is probably a better option in that case).

Ok, and it looks like “required file not found” refers to some file that unison needs. It seems to often happen with broken shebangs in scripts, when the shell can’t find the interpreter.

@sellout sellout mentioned this issue Feb 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant