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

[Bug]: cmake autocompletion prints '_split_longopt: command not found' #19352

Closed
leha-bot opened this issue Feb 26, 2024 · 7 comments
Closed
Labels
bug report Something is not working properly inactive No activity in a certain period of time upstream issue It is an upstream issue

Comments

@leha-bot
Copy link

Problem description

After some recent updates cmake autocompletion in Bash became to print the '_split_longopt: command not found'.

After some searching I found some issues in CMake and another autocompletion issue in "bat" repo:

The latter suggests possible cause for their similar issue.

What steps will reproduce the bug?

  1. Type cmake in bash terminal
  2. Press 'Tab' for autocompletion

What is the expected behavior?

It works without error.

System information

termux-info:

Termux Variables:
TERMUX_API_VERSION=0.50.1
TERMUX_APK_RELEASE=F_DROID
TERMUX_APP_PACKAGE_MANAGER=apt
TERMUX_APP_PID=22445
TERMUX_IS_DEBUGGABLE_BUILD=0
TERMUX_MAIN_PACKAGE_FORMAT=debian
TERMUX_VERSION=0.118.0
TERMUX__USER_ID=0
Packages CPU architecture:
aarch64
Subscribed repositories:
# sources.list
deb https://packages.termux.org/apt/termux-main stable main
# x11-repo (sources.list.d/x11.list)
deb https://packages.termux.org/apt/termux-x11 x11 main
# tur-repo (sources.list.d/tur.list)
deb https://tur.kcubeterm.com tur-packages tur tur-on-device tur-continuous
Updatable packages:
All packages up to date
termux-tools version:
1.40.6
Android version:
14
Kernel build information:
Linux localhost 5.10.177-android13-4-00003-ga7208022a7ea-ab10815828 #1 SMP PREEMPT Fri Sep 15 16:40:54 UTC 2023 aarch64 Android
Device manufacturer:
Google
Device model:
Pixel 6
LD Variables:
LD_LIBRARY_PATH=
LD_PRELOAD=/data/data/com.termux/files/usr/lib/libtermux-exec.so
Installed termux plugins:
com.termux.window versionCode:15
com.termux.widget versionCode:13
com.termux.x11 versionCode:14
com.termux.api versionCode:51

@leha-bot leha-bot added bug report Something is not working properly untriaged labels Feb 26, 2024
@Biswa96
Copy link
Member

Biswa96 commented Feb 26, 2024

I can not reproduce the issue in my setup. cmake, then tab does not show any error. Please make sure all the packages are updated with apt update; apt upgrade command.

@leha-bot
Copy link
Author

I found that CMake requires the '_split_longopt' function which was provided by bash-completion package before 2.12. In the latest release this function has name '_comp__split_longopt'

I think the autocompletion has been broken after bash-completion upgrade from 2.11 to 2.12 , according to the diff between 2.12 and 2.11:
https://github.com/scop/bash-completion/compare/2.12.0..2.11

I fixed this bug via replacing old name in $TERMUX/usr/share/bash-completion/completions/cmake

I may send a PR with patch, if don't mind.

I also planning to fix it properly in upstream CMake

@TomJo2000
Copy link
Member

(Since I'm set as the maintainer for the bash-completion package I guess I should chime in.)
We could definitely patch the completion until the issue is fixed upstream (be that in cmake or bash-completion)
But that would more so be a band-aid fix.

What confuses me is that the behavior doesn't appear to be replicable though.
I'll test this myself later.

@Biswa96
Copy link
Member

Biswa96 commented Feb 26, 2024

Oh, my bad. I assumed that bash-completion is installed already. I can reproduce the issue after installing bash-completion package manually. 🙇

@licy183 licy183 removed the untriaged label Feb 26, 2024
@TomJo2000
Copy link
Member

Yep, I can also reproduce this and have already identified the issue.
A simple API breakage due to a renamed function in the main bash-completion script.
https://github.com/scop/bash-completion/blob/master/bash_completion#L760-L786
Should be trivial to patch, I'll see if there's already a PR upstream.

@TomJo2000 TomJo2000 added the upstream issue It is an upstream issue label Feb 26, 2024
@stale stale bot added the inactive No activity in a certain period of time label May 11, 2024
@leha-bot
Copy link
Author

leha-bot commented Jun 3, 2024

The upstream will seems to fix it a proper way here:
https://gitlab.kitware.com/cmake/cmake/-/merge_requests/9564
Waiting for merging and CMake 3.30 😊

@Biswa96
Copy link
Member

Biswa96 commented Jul 3, 2024

This should be fixed in cmake version 3.30.0 and above.

@Biswa96 Biswa96 closed this as completed Jul 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug report Something is not working properly inactive No activity in a certain period of time upstream issue It is an upstream issue
Projects
None yet
Development

No branches or pull requests

4 participants