Bug 8548 - tab completion for cbrun <arch> make broken
Summary: tab completion for cbrun <arch> make broken
Status: CLOSED FIXED
Alias: None
Product: ThinLinc
Classification: Unclassified
Component: Build system (show other bugs)
Version: trunk
Hardware: PC Unknown
: P2 Normal
Target Milestone: 4.19.0
Assignee: Pierre Ossman
URL:
Keywords: adaha_tester, prosaic
Depends on:
Blocks:
 
Reported: 2025-03-20 10:51 CET by Pierre Ossman
Modified: 2025-03-25 10:58 CET (History)
1 user (show)

See Also:
Acceptance Criteria:


Attachments

Description Pierre Ossman cendio 2025-03-20 10:51:12 CET
At some point the tab completion for make in cenbuild broke. I now get:

> $ cbrun win64 make awk: error while loading shared libraries: libmpfr.so.6: cannot open shared object file: No such file or directory

Not sure when this happened, or how.
Comment 1 Pierre Ossman cendio 2025-03-20 10:53:03 CET
The issue is that we change $PATH so that it will tab complete our commands, rather than the system commands. But it also changes which commands are used in other tab completion scripts, and not just the suggested commands to the user.

A quick mitigation is to only do this for the third word (i.e. the initial command). This should work well enough for most cases, but will break tab completion when you have nested commands (e.g. xargs).
Comment 3 Pierre Ossman cendio 2025-03-20 12:34:33 CET
Fixed and seems to work well now.
Comment 4 Adam Halim cendio 2025-03-25 10:58:15 CET
Tested this on Fedora 40 and could not reproduce this. Running
> cbrun win64 make
worked without issues.

It looks like Fedora 41 has a newer version of bash-completion (2.13 instead of 2.11). In the new version, bash completions for make started using awk, which is not the case in 2.11:
> grep awk /usr/share/bash-completion/completions/make
>     _comp_awk -f "${BASH_SOURCE[0]%/*}/../helpers/make-extract-targets.awk"
I could confirm that without the fix (cendio-build-utils-1.38), on a Fedora 41 VM, make completion is broken and tries to use the wrong binaries:
> cbrun win64 make bash: /opt/cendio-build/arch/win64/usr/bin/realpath: cannot execute: required file not found
> bash: /opt/cendio-build/arch/win64/usr/bin/awk: cannot execute: required file not found
Upgrading to cendio-build-utils-1.39 fixes this, and make completions work as expected.

Note You need to log in before you can comment on or make changes to this bug.