Page MenuHomeFreeBSD

check/delete-old: Auto-generate lib32 entries for libraries.
ClosedPublic

Authored by jhb on Dec 7 2021, 7:07 PM.
Tags
None
Referenced Files
Unknown Object (File)
Feb 21 2024, 5:28 AM
Unknown Object (File)
Feb 2 2024, 11:04 AM
Unknown Object (File)
Jan 11 2024, 2:12 PM
Unknown Object (File)
Dec 13 2023, 12:02 AM
Unknown Object (File)
Nov 30 2023, 11:46 PM
Unknown Object (File)
Nov 30 2023, 6:42 PM
Unknown Object (File)
Nov 29 2023, 1:22 AM
Unknown Object (File)
Oct 30 2023, 4:45 PM
Subscribers

Details

Summary
  • Add usr/lib32/libfoo.so.N for lib/libfoo.so.N.
  • Add usr/lib32/foo for usr/lib/foo.
  • Treat casper libraries special since they are installed to /usr/lib32 instead of /usr/lib32/casper and thus map usr/lib/casper/foo to usr/lib32/foo.

Note that OLD_DIRS entries are not duplicated, only OLD_FILES and
OLD_LIBS.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 43218
Build 40106: arc lint + arc unit

Event Timeline

jhb requested review of this revision.Dec 7 2021, 7:07 PM
This revision is now accepted and ready to land.Dec 7 2021, 7:11 PM

Remaining references to lib32 in *.inc. Most of these are the MK_LIB32 bits:

> grep lib32 ObsoleteFiles.inc tools/build/mk/OptionalObsoleteFiles.inc 
ObsoleteFiles.inc:# 20200601: OpenSSL 32-bit compat engines moved to /usr/lib32/engines
ObsoleteFiles.inc:OLD_LIBS+=usr/lib32/capi.so
ObsoleteFiles.inc:OLD_LIBS+=usr/lib32/padlock.so
ObsoleteFiles.inc:OLD_LIBS+=usr/lib32/lib4758cca.so
ObsoleteFiles.inc:OLD_LIBS+=usr/lib32/libaep.so
ObsoleteFiles.inc:OLD_LIBS+=usr/lib32/libatalla.so
ObsoleteFiles.inc:OLD_LIBS+=usr/lib32/libcapi.so
ObsoleteFiles.inc:OLD_LIBS+=usr/lib32/libchil.so
ObsoleteFiles.inc:OLD_LIBS+=usr/lib32/libcswift.so
ObsoleteFiles.inc:OLD_LIBS+=usr/lib32/libgost.so
ObsoleteFiles.inc:OLD_LIBS+=usr/lib32/libnuron.so
ObsoleteFiles.inc:OLD_LIBS+=usr/lib32/libsureware.so
ObsoleteFiles.inc:OLD_LIBS+=usr/lib32/libubsec.so
ObsoleteFiles.inc:OLD_DIRS+=usr/lib32/private
ObsoleteFiles.inc:OLD_FILES+=usr/lib/debug/usr/lib32/i18n
ObsoleteFiles.inc:OLD_FILES+=usr/lib/debug/usr/lib32/private
tools/build/mk/OptionalObsoleteFiles.inc:OLD_DIRS+=usr/lib32/dtrace
tools/build/mk/OptionalObsoleteFiles.inc:OLD_FILES+=etc/mtree/BSD.lib32.dist
tools/build/mk/OptionalObsoleteFiles.inc:.  if exists(${DESTDIR}/usr/lib32)
tools/build/mk/OptionalObsoleteFiles.inc:LIB32_DIRS!=find ${DESTDIR}/usr/lib32 -type d \
tools/build/mk/OptionalObsoleteFiles.inc:LIB32_FILES!=find ${DESTDIR}/usr/lib32 \! -type d \
tools/build/mk/OptionalObsoleteFiles.inc:LIB32_LIBS!=find ${DESTDIR}/usr/lib32 \! -type d \
tools/build/mk/OptionalObsoleteFiles.inc:.    if exists(${DESTDIR}/usr/lib/debug/usr/lib32)
tools/build/mk/OptionalObsoleteFiles.inc:DEBUG_LIB32_DIRS!=find ${DESTDIR}/usr/lib/debug/usr/lib32 -type d \
tools/build/mk/OptionalObsoleteFiles.inc:DEBUG_LIB32_FILES!=find ${DESTDIR}/usr/lib/debug/usr/lib32 \! -type d \
tools/build/mk/OptionalObsoleteFiles.inc:DEBUG_LIB32_LIBS!=find ${DESTDIR}/usr/lib/debug/usr/lib32 \! -type d \
Makefile.inc1
3221

So this is how I tested this was by starting with the stock version of this and generating before/after output and comparing those. I won't include the list-* targets in the commit, but kind of useful for them to exist in the history perhaps. Alternatively, it might reduce some duplication if the check/delete-old-* targets invoked list-old-* to generate the list of files.

What do you think about implementing check-old-* and delete-old-* by invoking list-old-*? Perhaps we could have only one instance of the :Mlib/*:S,^lib,usr/lib32,,

Makefile
157

Makefile defines existing check-old-{files,libs} as:

# check-old-files     - List obsolete files.
# check-old-libs      - List obsolete libraries.

We should add new targets to Makefile's comment, and update the description for those two.

ObsoleteFiles.inc
9

Should we add a note in this large comment about the automatically generated entries? (including already-existing handling for /usr/lib/debug)

Makefile.inc1
3221

Yes I was looking at this / entering my comments before I saw this new comment.

I think leaving them in and invoking them from check-old-* or delete-old-* is fine, or you could have delete-old-* invoke check-old-*

jhb marked 2 inline comments as done.Dec 7 2021, 10:46 PM

So I've found an annoying edge case. :( When a library moves from /usr/lib to /lib, we add a rule to remove /usr/lib32/libfoo.so.1 even though it is valid with this logic. (libbe.so.1 is an example of this)

I'm not quite sure how to resolve that edge case cleanly.

  • Rebase on change to add list-old-* targets.
This revision now requires review to proceed.Dec 7 2021, 11:30 PM
In D33324#753463, @jhb wrote:

I'm not quite sure how to resolve that edge case cleanly.

Ah, this is annoying. The best idea I've got is to introduce a new var (MOVED_LIBS or OLD_MOVED_LIBS, say) and specify libs that moved there, and then avoid the lib32 special case for them.

In D33324#753463, @jhb wrote:

I'm not quite sure how to resolve that edge case cleanly.

Ah, this is annoying. The best idea I've got is to introduce a new var (MOVED_LIBS or OLD_MOVED_LIBS, say) and specify libs that moved there, and then avoid the lib32 special case for them.

So I've implemented MOVED_LIBS and added it as two earlier commits in this series (stack) and this now seems to work reliably (and finds several stale things on my desktop that aren't currently listed).

This revision is now accepted and ready to land.Jan 20 2022, 8:52 PM