Bug 236103 - WITHOUT_DEBUG not fully honored in src build
Summary: WITHOUT_DEBUG not fully honored in src build
Status: New
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: 12.0-STABLE
Hardware: Any Any
: --- Affects Many People
Assignee: freebsd-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-02-28 10:13 UTC by Helge Oldach
Modified: 2019-03-07 16:08 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Helge Oldach 2019-02-28 10:13:54 UTC
/usr/lib/debug/boot is populated with empty directories despite WITHOUT_DEBUG_FILES, WITHOUT_KERNEL_SYMBOLS and INSTALL_NODEBUG being defined, and it cannot be cleaned up through "make delete-old":

# make -C/usr/src RM_I=-v delete-old
>>> Removing old files (only deletes safe to delete libs)
>>> Old files removed
>>> Removing old directories
rmdir: /var/run/named: Directory not empty
/usr/share/doc/atf
/usr/share/atf
/usr/lib/debug/usr/tests
/usr/lib/debug/usr/sbin
/usr/lib/debug/usr/libexec/sm.bin
/usr/lib/debug/usr/libexec/sendmail
/usr/lib/debug/usr/libexec/lpr/ru
/usr/lib/debug/usr/libexec/lpr
/usr/lib/debug/usr/libexec/bsdinstall
/usr/lib/debug/usr/libexec
/usr/lib/debug/usr/lib32/i18n
/usr/lib/debug/usr/lib32/geom
/usr/lib/debug/usr/lib32/dtrace
/usr/lib/debug/usr/lib32
/usr/lib/debug/usr/lib/i18n
/usr/lib/debug/usr/lib/engines
/usr/lib/debug/usr/lib/clang/7.0.1/lib/freebsd
/usr/lib/debug/usr/lib/clang/7.0.1/lib
/usr/lib/debug/usr/lib/clang/7.0.1
/usr/lib/debug/usr/lib/clang
/usr/lib/debug/usr/lib
/usr/lib/debug/usr/bin
/usr/lib/debug/usr
/usr/lib/debug/sbin
/usr/lib/debug/libexec
/usr/lib/debug/lib/geom
/usr/lib/debug/lib/casper
/usr/lib/debug/lib
rmdir: /usr/lib/debug/boot: Directory not empty
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
/usr/lib/debug/bin
/usr/include/atf-c++
/usr/include/atf-c
>>> Old directories removed
To remove old libraries run 'make delete-old-libs'.
# ls -la /usr/lib/debug/boot
total 16
drwxr-xr-x  4 root  wheel  512 Feb 28 10:07 .
drwxr-xr-x  3 root  wheel  512 Feb 28 10:50 ..
drwxr-xr-x  2 root  wheel  512 Feb 28 10:02 kernel.old
drwxr-xr-x  2 root  wheel  512 Feb 28 10:02 modules
#

I believe we need to mangle the mkdir login in sys/conf/kern.post.mk and sys/conf/kmod.mk (look for INSTALL_NODEBUG)
Comment 1 Ed Maste freebsd_committer freebsd_triage 2019-03-04 15:13:27 UTC
kernel.old/ and modules/ are both empty directories, yes?
Comment 2 Helge Oldach 2019-03-04 15:27:40 UTC
(In reply to Ed Maste from comment #1)
That is indeed correct. And both have not been in place before "make installworld".
Comment 3 Ed Maste freebsd_committer freebsd_triage 2019-03-04 15:38:32 UTC
Ah, there is logic in OptionalObsoleteFiles.inc to handle ${MK_DEBUG_FILES}, but it explicitly excludes /usr/lib/debug/boot/* (since those are not controlled by DEBUG_FILES).

It looks like we need a similar one controlled by MK_KERNEL_SYMBOLS.