Bug 1352312 - Bash completion regression - doesn't work for Makefiles
Summary: Bash completion regression - doesn't work for Makefiles
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Fedora
Classification: Fedora
Component: bash-completion
Version: 24
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Ville Skyttä
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-07-03 16:21 UTC by Pavel Stehule
Modified: 2016-07-07 13:35 UTC (History)
4 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2016-07-07 13:35:31 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
trace log (11.81 KB, text/plain)
2016-07-04 14:33 UTC, Pavel Stehule
no flags Details

Description Pavel Stehule 2016-07-03 16:21:02 UTC
Description of problem:

Bash completion is not well configured for Makefiles.

How reproducible:

go to some directory with "Makefile" file. Try to write
make and the completion list is based on files, not on Makefile entries.

Comment 1 Ville Skyttä 2016-07-03 18:23:02 UTC
Works fine for me, for example in the prepared bash-completion development dir. Need (much) more details and exact reproducer to be able to say more.

Comment 2 Pavel Stehule 2016-07-03 18:35:45 UTC
I am using PostgreSQL source directory

[pavel@nemesis postgresql]$ pwd
/home/pavel/src/postgresql
[pavel@nemesis postgresql]$ ls 
aclocal.m4  config.log     configure     contrib    doc          GNUmakefile     HISTORY   README      src
config      config.status  configure.in  COPYRIGHT  finitdb_log  GNUmakefile.in  Makefile  README.git  tmp_install
[pavel@nemesis postgresql]$ make 
config.status  GNUmakefile    src/           
[pavel@nemesis postgresql]$ make 


expected: all check install installdirs installcheck installcheck-parallel ...

I tested another source - bash - and it doesn't work too.

My installation is fresh Fedora 24.

Comment 3 Ville Skyttä 2016-07-04 07:27:26 UTC
Works for me on F24 and prepared bash source dir. For some reason producing the completions takes a long time the first time, but the expected ones eventually appear, and it's quick afterwards.

Still need more info, see Troubleshooting in bash-completion's README.md, and post the generated output somewhere for examination.

Comment 4 Pavel Stehule 2016-07-04 14:33:50 UTC
Created attachment 1176081 [details]
trace log

trace log for auto complete in PostgreSQL src directory

Comment 5 Pavel Stehule 2016-07-04 14:50:12 UTC
I found some example of using  _make_target_extract_script

It doesn't work on my comp

sed -nrf <(_make_target_extract_script --) Makefile

sed -nrf <(_make_target_extract_script --) Makefile
+ sed -nrf /dev/fd/63 Makefile
_make_target_extract_script --
++ _make_target_extract_script --
++ local mode=--
++ shift
++ local prefix=
+++ command sed 's/[][\,.*^$(){}?+|/]/\\&/g'
+++ sed 's/[][\,.*^$(){}?+|/]/\\&/g'
++ local prefix_pat=
++ local basename=
++ local dirname_len=0
++ [[ -- == -d ]]
++ local 'output=\1\2'
++ cat
++ [[ -z '' ]]
++ cat
sed: file /dev/fd/63 line 22: invalid reference \2 on `s' command's RHS

Comment 6 Ville Skyttä 2016-07-04 17:58:02 UTC
(In reply to Pavel Stehule from comment #5)
> It doesn't work on my comp
> 
> sed -nrf <(_make_target_extract_script --) Makefile

That's most likely because of the "r" in -nrf. I don't know where you got it, we don't call "sed -nrf" but "sed -nf".

(I haven't looked at your trace yet.)

Comment 7 Pavel Stehule 2016-07-04 19:31:24 UTC
(In reply to Ville Skyttä from comment #6)
> (In reply to Pavel Stehule from comment #5)
> > It doesn't work on my comp
> > 
> > sed -nrf <(_make_target_extract_script --) Makefile
> 
> That's most likely because of the "r" in -nrf. I don't know where you got
> it, we don't call "sed -nrf" but "sed -nf".
> 
> (I haven't looked at your trace yet.)

It returns nothing

Comment 8 Ville Skyttä 2016-07-05 05:51:06 UTC
Reproduced with the PostgreSQL build dir also on F-23, moving discussion to upstream at https://github.com/scop/bash-completion/issues/53

Comment 9 Ville Skyttä 2016-07-07 13:35:31 UTC
Closing as WONTFIX per upstream resolution wrt PostgreSQL dir. If you find other Makefiles for which completion doesn't work, feel free to file new bugs (preferably upstream), one per case.


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