Bug 162948

Summary: [exp-run] 10.0 exp-run without libreadline in base system
Product: Ports & Packages Reporter: Max Khon <fjoe>
Component: Individual Port(s)Assignee: Baptiste Daroussin <bapt>
Status: Closed FIXED    
Severity: Affects Only Me CC: emaste, koobs
Priority: Normal    
Version: Latest   
Hardware: Any   
OS: Any   

Description Max Khon freebsd_committer freebsd_triage 2011-11-29 16:50:08 UTC
I would like to request a 10.0 exp-run without installed libreadline.

Patch against head/ is as follows:

Index: gnu/usr.bin/gdb/Makefile.inc
===================================================================
--- gnu/usr.bin/gdb/Makefile.inc	(revision 227900)
+++ gnu/usr.bin/gdb/Makefile.inc	(working copy)
@@ -15,6 +15,7 @@
 OBJ_ROOT= ${.OBJDIR}/../..
 OBJ_BU= ${OBJ_ROOT}/binutils
 OBJ_GDB= ${OBJ_ROOT}/gdb
+OBJ_RL=	${OBJ_ROOT}/../lib/libreadline/readline
 
 # These assignments duplicate much of the functionality of
 # MACHINE_CPUARCH, but there's no easy way to export make functions...
@@ -45,6 +46,7 @@
 CFLAGS+= -I${CNTRB_BU}/include
 CFLAGS+= -I${CNTRB_GDB}/include
 CFLAGS+= -I${CNTRB_BU}/bfd
+CFLAGS+= -I${OBJ_RL}/..
 
 GENSRCS+= nm.h tm.h
 
Index: gnu/usr.bin/gdb/gdb/Makefile
===================================================================
--- gnu/usr.bin/gdb/gdb/Makefile	(revision 227900)
+++ gnu/usr.bin/gdb/gdb/Makefile	(working copy)
@@ -5,13 +5,13 @@
 
 BULIBS= ${OBJ_BU}/libbfd/libbfd.a ${OBJ_BU}/libopcodes/libopcodes.a \
 	${OBJ_BU}/libiberty/libiberty.a
-GDBLIBS= ${OBJ_GDB}/libgdb/libgdb.a
+GDBLIBS= ${OBJ_GDB}/libgdb/libgdb.a ${OBJ_RL}/libreadline.a
 
 # libthread_db.so calls back into gdb for the proc services.  Make all the
 # global symbols visible.
 LDFLAGS+= -Wl,-E
 
-DPADD=	${GDBLIBS} ${BULIBS} ${LIBM} ${LIBREADLINE} ${LIBTERMCAP} ${LIBGNUREGEX}
-LDADD=	${GDBLIBS} ${BULIBS} -lm -lreadline -ltermcap -lgnuregex
+DPADD=	${GDBLIBS} ${BULIBS} ${LIBM} ${LIBTERMCAP} ${LIBGNUREGEX}
+LDADD=	${GDBLIBS} ${BULIBS} -lm -ltermcap -lgnuregex
 
 .include <bsd.prog.mk>
Index: gnu/usr.bin/gdb/kgdb/Makefile
===================================================================
--- gnu/usr.bin/gdb/kgdb/Makefile	(revision 227900)
+++ gnu/usr.bin/gdb/kgdb/Makefile	(working copy)
@@ -6,9 +6,9 @@
 
 BULIBS= ${OBJ_BU}/libbfd/libbfd.a ${OBJ_BU}/libopcodes/libopcodes.a \
 	${OBJ_BU}/libiberty/libiberty.a
-GDBLIBS= ${OBJ_GDB}/libgdb/libgdb.a
+GDBLIBS= ${OBJ_GDB}/libgdb/libgdb.a ${OBJ_RL}/libreadline.a
 
-DPADD=	${GDBLIBS} ${BULIBS} ${LIBKVM} ${LIBM} ${LIBREADLINE} ${LIBTERMCAP} ${LIBGNUREGEX}
-LDADD=	${GDBLIBS} ${BULIBS} -lkvm -lm -lreadline -ltermcap -lgnuregex
+DPADD=	${GDBLIBS} ${BULIBS} ${LIBKVM} ${LIBM} ${LIBTERMCAP} ${LIBGNUREGEX}
+LDADD=	${GDBLIBS} ${BULIBS} -lkvm -lm -ltermcap -lgnuregex
 
 .include <bsd.prog.mk>
Index: gnu/usr.bin/gdb/gdbtui/Makefile
===================================================================
--- gnu/usr.bin/gdb/gdbtui/Makefile	(revision 227900)
+++ gnu/usr.bin/gdb/gdbtui/Makefile	(working copy)
@@ -6,13 +6,13 @@
 
 BULIBS= ${OBJ_BU}/libbfd/libbfd.a ${OBJ_BU}/libopcodes/libopcodes.a \
 	${OBJ_BU}/libiberty/libiberty.a
-GDBLIBS= ${OBJ_GDB}/libgdb/libgdb.a
+GDBLIBS= ${OBJ_GDB}/libgdb/libgdb.a ${OBJ_RL}/libreadline.a
 
 # libthread_db.so calls back into gdb for the proc services.  Make all the
 # global symbols visible.
 LDFLAGS+= -Wl,-E
 
-DPADD=	${GDBLIBS} ${BULIBS} ${LIBM} ${LIBREADLINE} ${LIBTERMCAP} ${LIBGNUREGEX}
-LDADD=	${GDBLIBS} ${BULIBS} -lm -lreadline -ltermcap -lgnuregex
+DPADD=	${GDBLIBS} ${BULIBS} ${LIBM} ${LIBTERMCAP} ${LIBGNUREGEX}
+LDADD=	${GDBLIBS} ${BULIBS} -lm -ltermcap -lgnuregex
 
 .include <bsd.prog.mk>
Index: gnu/lib/libreadline/history/doc/Makefile
===================================================================
--- gnu/lib/libreadline/history/doc/Makefile	(revision 227900)
+++ gnu/lib/libreadline/history/doc/Makefile	(working copy)
@@ -1,12 +0,0 @@
-# $FreeBSD$
-
-SRCDIR= ${.CURDIR}/../../../../../contrib/libreadline/doc
-
-INFO = history
-
-INFOSECTION= "Programming & development tools."
-INFOENTRY_history= "* History: (history).		The GNU History library."
-
-history.info: history.texi hstech.texi hsuser.texi version.texi fdl.texi
-
-.include <bsd.info.mk>
Index: gnu/lib/libreadline/history/Makefile
===================================================================
--- gnu/lib/libreadline/history/Makefile	(revision 227900)
+++ gnu/lib/libreadline/history/Makefile	(working copy)
@@ -1,15 +0,0 @@
-# $FreeBSD$
-
-SUBDIR= doc
-
-LIB=    history
-MAN=    rlhistory.3
-
-SRCS= $(HISTSRC) xmalloc.c
-
-rlhistory.3: doc/history.3
-	cp -f ${.ALLSRC} ${.TARGET}
-
-CLEANFILES+= rlhistory.3
-
-.include <bsd.lib.mk>
Index: gnu/lib/libreadline/readline/doc/Makefile
===================================================================
--- gnu/lib/libreadline/readline/doc/Makefile	(revision 227900)
+++ gnu/lib/libreadline/readline/doc/Makefile	(working copy)
@@ -1,20 +0,0 @@
-# $FreeBSD$
-
-SRCDIR= ${.CURDIR}/../../../../../contrib/libreadline/doc
-
-INFO = readline rluserman
-
-INFOSECTION= "Programming & development tools."
-INFOENTRY_readline= "* Readline: (readline).		The GNU Readline library"
-INFOENTRY_rluserman= "* Readline: (readline).       The GNU readline library API"
-
-CLEANFILES += readline.texi
-
-readline.info: rlman.texi rluser.texi rltech.texi version.texi fdl.texi
-
-readline.texi: rlman.texi
-	cp -f ${SRCDIR}/rlman.texi ${.TARGET}
-
-rluserman.info: rluserman.texi version.texi rluser.texi fdl.texi
-
-.include <bsd.info.mk>
Index: gnu/lib/libreadline/readline/Makefile
===================================================================
--- gnu/lib/libreadline/readline/Makefile	(revision 227900)
+++ gnu/lib/libreadline/readline/Makefile	(working copy)
@@ -1,27 +1,22 @@
 # $FreeBSD$
 
-SUBDIR= doc
-
 LIB=    readline
-MAN=    doc/readline.3
-SHLIBDIR?=	/lib
-
+INTERNALLIB=
 TILDESRC= tilde.c
 SRCS=     readline.c vi_mode.c funmap.c keymaps.c parens.c search.c \
 	  rltty.c complete.c bind.c isearch.c display.c signals.c \
 	  util.c kill.c undo.c macro.c input.c callback.c terminal.c \
 	  text.c nls.c misc.c compat.c xmalloc.c $(HISTSRC) $(TILDESRC)
+CFLAGS+= -I${.OBJDIR}/..
 
 INSTALLED_HEADERS= readline.h chardefs.h keymaps.h history.h tilde.h \
 		   rlstdc.h rlconf.h rltypedefs.h
+.for _h in ${INSTALLED_HEADERS}
+CLEANFILES+=	${_h}
+DPSRCS+=	${.OBJDIR}/${_h}
 
-DPADD=	${LIBTERMCAP}
-LDADD=	-ltermcap
-
-INCSDIR=${INCLUDEDIR}/readline
-
-.for hdr in ${INSTALLED_HEADERS}
-INCS+=	${SRCDIR}/${hdr}
+${.OBJDIR}/${_h}:	${_h}
+	${INSTALL} ${.ALLSRC} ${.TARGET}
 .endfor
 
 .include <bsd.lib.mk>
Index: gnu/lib/libreadline/Makefile
===================================================================
--- gnu/lib/libreadline/Makefile	(revision 227900)
+++ gnu/lib/libreadline/Makefile	(working copy)
@@ -1,5 +1,5 @@
 # $FreeBSD$
 
-SUBDIR = history readline
+SUBDIR = readline
 
 .include <bsd.subdir.mk>
Comment 1 Max Khon freebsd_committer freebsd_triage 2011-11-29 16:51:53 UTC
Responsible Changed
From-To: freebsd-ports-bugs->portmgr

To portmgr.
Comment 2 Mark Linimon freebsd_committer freebsd_triage 2012-03-10 23:44:27 UTC
State Changed
From-To: open->analyzed
Comment 3 Mark Linimon freebsd_committer freebsd_triage 2012-03-10 23:44:27 UTC
Responsible Changed
From-To: portmgr->linimon
Comment 4 Mark Linimon freebsd_committer freebsd_triage 2012-03-12 02:08:47 UTC
Responsible Changed
From-To: linimon->fjoe

So far the results are not encouraging: 

http://pointyhat-west.isc.freebsd.org/errorlogs/amd64-errorlogs/e.10-exp.20120310234450.pointyhat-west/ 

The fact that lang/python27 fails takes out 5845 ports. 

Other notable errors are lang/ruby18, audio/jack, databases/mysql55-client, 
lang/lua, databases/postgresql*-client, databases/mysql*-client, and 
the other lang/python* ports, roughly in order of decreasing effect. 

Can you recommend the next step of action, please?
Comment 5 Mark Linimon 2012-03-18 08:54:26 UTC
The current run has completed.

Unfortunately removing readline means that over 6,000 ports either fail
to compile, or are blocked by those ports failing to compile.

The raw data are at:

  http://pointyhat-west.isc.freebsd.org/errorlogs/amd64-errorlogs/e.10-exp.20120310234450.pointyhat-west/index-category.html

However, eliminating ports already known to fail on 10, and then trying
to eliminate other false, positives, gives:

  http://pointyhat-west.isc.freebsd.org/errorlogs/amd64-errorlogs/e.10-exp.20120310234450.pointyhat-west/index-category-edited.html

(Click twice on 'Aff.' to sort by descending number of ports affected.)

So, my recommendation is *not* to remove readline from the base until
much more work is done.  I have the feeling that multiple runs will be
required.

mcl
Comment 6 Baptiste Daroussin freebsd_committer freebsd_triage 2013-05-06 14:30:38 UTC
Responsible Changed
From-To: fjoe->bapt

I'll take it.
Comment 7 Baptiste Daroussin freebsd_committer freebsd_triage 2013-05-06 14:30:43 UTC
State Changed
From-To: analyzed->open

Let's try again
Comment 8 baptiste.daroussin 2013-07-31 23:30:27 UTC
The patch apply properly but fail during the make depend phase:
make: make: don't know how to make readline.h. Stop

Can you provide an updated patch?
Comment 9 Ed Maste freebsd_committer freebsd_triage 2013-09-22 15:12:53 UTC
I've posted an updated patch at
http://people.freebsd.org/~emaste/patches/readline_internallib.diff
Comment 10 commit-hook freebsd_committer freebsd_triage 2014-07-09 15:52:53 UTC
A commit references this bug:

Author: bapt
Date: Wed Jul  9 15:52:32 UTC 2014
New revision: 268461
URL: http://svnweb.freebsd.org/changeset/base/268461

Log:
  The GNU readline library is now an INTERNALLIB - that is, it is
  statically linked into consumers (GDB and variants) in the base
  system, and the shared library is no longer installed.

  That also allows ports to be able to use a modern version of readline

  PR:		162948
  Reviewed by:	emaste

Changes:
  head/ObsoleteFiles.inc
  head/UPDATING
  head/gnu/lib/libreadline/Makefile
  head/gnu/lib/libreadline/history/
  head/gnu/lib/libreadline/readline/Makefile
  head/gnu/lib/libreadline/readline/doc/
  head/gnu/usr.bin/gdb/Makefile.inc
  head/gnu/usr.bin/gdb/gdb/Makefile
  head/gnu/usr.bin/gdb/gdbtui/Makefile
  head/gnu/usr.bin/gdb/kgdb/Makefile
  head/share/mk/bsd.libnames.mk
  head/tools/build/mk/OptionalObsoleteFiles.inc