Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 30 Nov 2021 22:55:35 +0000
From:      bugzilla-noreply@freebsd.org
To:        bugs@FreeBSD.org
Subject:   [Bug 260128] "make tags" fails with "gtags not found", src/Makefile undesirably rewrites PATH
Message-ID:  <bug-260128-227-3c6mwNhh8q@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-260128-227@https.bugs.freebsd.org/bugzilla/>
References:  <bug-260128-227@https.bugs.freebsd.org/bugzilla/>

next in thread | previous in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D260128

Jory Folker <jfolker11@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jfolker11@gmail.com

--- Comment #4 from Jory Folker <jfolker11@gmail.com> ---
For now, I propose setting /usr/local/bin/gtags in bsd.dep.mk, and here is =
my
diff:

freebsd% cat bsd.dep.mk.diff
--- bsd.dep.mk  2021-11-30 16:09:01.231877000 -0600
+++ bsd.dep.mk.new      2021-11-30 16:08:25.988490000 -0600
@@ -45,7 +45,7 @@
 .error bsd.dep.mk cannot be included directly.
 .endif

-CTAGS?=3D                gtags
+CTAGS?=3D                /usr/local/bin/gtags
 CTAGSFLAGS?=3D
 GTAGSFLAGS?=3D   -o
 HTAGSFLAGS?=3D
freebsd%=20

If we could eliminate a dependency on an executable from outside the base
system, then defaulting to ctags and allowing the user to change it by
exporting CTAGS in their env is ideal.

However, when I run 'make tags' with ctags, stderr is flooded with superflu=
ous
"Duplicate entry" warnings for redefined macros, functions defined using
macros, etc, like this:

Duplicate entry in file
/usr/home/jfolker/freebsd/src/contrib/ntp/ntpdc/ntpdc.c, line 1910:
__attribute__
Second entry ignored
Duplicate entry in file
/usr/home/jfolker/freebsd/src/contrib/ntp/ntpdc/ntpdc.c, line 1926:
__attribute__
Second entry ignored

This isn't itself bad, but it gives reasonable suspicion that we will lose
other functionality switching from gtags to ctags.

But I found something else worth noting: unless the install dest for GNU gl=
obal
was changed in the ports tree Makefile, 'make tags' has been broken for ove=
r 18
years.

freebsd% git blame src/Makefile
d672a60908a4 (Ruslan Ermilov      2002-04-29 15:22:01 +0000 214)=20
76499f153979 (Ruslan Ermilov      2003-01-29 10:00:42 +0000 215) PATH=3D=20
/sbin:/bin:/usr/sbin:/usr/bin
2e84ab947d9c (Ruslan Ermilov      2002-12-02 14:31:21 +0000 216)
MAKEOBJDIRPREFIX?=3D     /usr/obj
freebsd%
freebsd% git blame src/share/mk/bsd.dep.mk
5ffdf3618ef7 (Ruslan Ermilov      2002-04-22 10:04:41 +0000  44) .if
!target(__<bsd.init.mk>__)
5ffdf3618ef7 (Ruslan Ermilov      2002-04-22 10:04:41 +0000  45) .error
bsd.dep.mk cannot be included directly.
5ffdf3618ef7 (Ruslan Ermilov      2002-04-22 10:04:41 +0000  46) .endif
b16495e786c9 (Wolfram Schneider   1996-04-01 18:58:28 +0000  47)=20
ccc4bab1047d (Ruslan Ermilov      2002-10-17 13:48:13 +0000  48) CTAGS?=3D=
=20=20=20=20=20=20=20
        gtags
ccc4bab1047d (Ruslan Ermilov      2002-10-17 13:48:13 +0000  49) CTAGSFLAGS=
?=3D
ccc4bab1047d (Ruslan Ermilov      2002-10-17 13:48:13 +0000  50) GTAGSFLAGS=
?=3D=20=20
-o
ccc4bab1047d (Ruslan Ermilov      2002-10-17 13:48:13 +0000  51) HTAGSFLAGS=
?=3D
ccc4bab1047d (Ruslan Ermilov      2002-10-17 13:48:13 +0000  52)

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-260128-227-3c6mwNhh8q>