Bug 242971 - Casper-related files are installed even if WITHOUT_CASPER=true ; some of them are not removed by "make delete-old"
Summary: Casper-related files are installed even if WITHOUT_CASPER=true ; some of them...
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: 12.1-RELEASE
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-12-29 22:54 UTC by Philippe Michel
Modified: 2020-02-05 21:17 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 Philippe Michel 2019-12-29 22:54:34 UTC
With WITHOUT_CASPER=true, the following files are installed anyway :

INCS=   libcasper.h
INCS+=  libcasper_service.h

MAN+=   libcasper.3
MAN+=   libcasper_service.3

MLINKS+=libcasper.3 cap_init.3
MLINKS+=libcasper.3 cap_wrap.3
MLINKS+=libcasper.3 cap_unwrap.3
MLINKS+=libcasper.3 cap_sock.3
MLINKS+=libcasper.3 cap_clone.3
MLINKS+=libcasper.3 cap_close.3
MLINKS+=libcasper.3 cap_limit_get.3
MLINKS+=libcasper.3 cap_limit_set.3
MLINKS+=libcasper.3 cap_send_nvlist.3
MLINKS+=libcasper.3 cap_recv_nvlist.3
MLINKS+=libcasper.3 cap_xfer_nvlist.3
MLINKS+=libcasper.3 cap_service_open.3

MLINKS+=libcasper_service.3 CREATE_SERVICE.3

Most of them are deleted by a "make delete-old", but a few are missing from OptionalObsoleteFiles.inc and are not removed.
Comment 1 Mariusz Zaborski freebsd_committer 2020-01-08 11:33:36 UTC
Hello Philippe,

The headers which are installed needed for FreeBSD to work even when WITHOUT_CASPER users provide. The difference is how the headers behave. The headers provide stub functions for the Casper library.

For example, if we are using cap_gethostbyname thanks to this header, it will be changed to the gethostbyname without changes in the code.

We install the man pages because the function will appear in multiple base tools, which will be built with the stub functions. Although I don't have a strong opinion about that, and if there will be an urge to change that I will not resist :)

The make delete-old removes the libraries/man pages that are not used anymore with and without Casper.

Hope that this helps,
Mariusz
Comment 2 Philippe Michel 2020-01-08 18:48:25 UTC
Thanks for the explanation.

Still, there is something wrong with the current behaviour. With WITHOUT_CASPER=true, the following files are installed by make installworld and deleted by a subsequent make delete-old:

>>> Removing old files (only deletes safe to delete libs)
remove /usr/include/libcasper.h? y
remove /usr/share/man/man3/cap_clone.3.gz? y
remove /usr/share/man/man3/cap_close.3.gz? y
remove /usr/share/man/man3/cap_init.3.gz? y
remove /usr/share/man/man3/cap_limit_get.3.gz? y
remove /usr/share/man/man3/cap_limit_set.3.gz? y
remove /usr/share/man/man3/cap_recv_nvlist.3.gz? y
remove /usr/share/man/man3/cap_send_nvlist.3.gz? y
remove /usr/share/man/man3/cap_service_open.3.gz? y
remove /usr/share/man/man3/cap_sock.3.gz? y
remove /usr/share/man/man3/cap_unwrap.3.gz? y
remove /usr/share/man/man3/cap_wrap.3.gz? y
remove /usr/share/man/man3/cap_xfer_nvlist.3.gz? y

That doesn't make sense. Either they are useful even without Casper and delete-old shouldn't remove them, or they are not and they shouldn't have been installed.
Comment 3 commit-hook freebsd_committer 2020-01-20 19:48:47 UTC
A commit references this bug:

Author: oshogbo
Date: Mon Jan 20 19:47:58 UTC 2020
New revision: 356925
URL: https://svnweb.freebsd.org/changeset/base/356925

Log:
  Those files are already removed in ObsoleteFiles.\
  There is no need to remove them twice.

  PR:		242971
  MFC after:	2 weeks

Changes:
  head/tools/build/mk/OptionalObsoleteFiles.inc
Comment 4 commit-hook freebsd_committer 2020-01-20 19:52:49 UTC
A commit references this bug:

Author: oshogbo
Date: Mon Jan 20 19:51:54 UTC 2020
New revision: 356926
URL: https://svnweb.freebsd.org/changeset/base/356926

Log:
  Even when the MK_CASPER is set to "no" we still want to install man pages
  and the headers. If the user decides to install the system without Casper
  support, then the Casper functions are mocked, but they still exist in
  the system.

  PR:		242971
  MFC after:	2 weeks

Changes:
  head/tools/build/mk/OptionalObsoleteFiles.inc
Comment 5 commit-hook freebsd_committer 2020-01-20 19:56:50 UTC
A commit references this bug:

Author: oshogbo
Date: Mon Jan 20 19:56:22 UTC 2020
New revision: 356928
URL: https://svnweb.freebsd.org/changeset/base/356928

Log:
  When MK_CASPER=no is set remove files which are not needed to run system.

  PR:		242971

Changes:
  head/tools/build/mk/OptionalObsoleteFiles.inc
Comment 6 Mariusz Zaborski freebsd_committer 2020-01-20 19:58:54 UTC
I will get the fix integrated to STABLE in 2 weeks.
Thank you for reporting and your patience.
Comment 7 commit-hook freebsd_committer 2020-02-05 21:06:09 UTC
A commit references this bug:

Author: oshogbo
Date: Wed Feb  5 21:05:53 UTC 2020
New revision: 357599
URL: https://svnweb.freebsd.org/changeset/base/357599

Log:
  MFCr356925:
    Those files are already removed in ObsoleteFiles.
    There is no need to remove them twice.

    PR:           242971

Changes:
_U  stable/12/
  stable/12/tools/build/mk/OptionalObsoleteFiles.inc
Comment 8 commit-hook freebsd_committer 2020-02-05 21:11:11 UTC
A commit references this bug:

Author: oshogbo
Date: Wed Feb  5 21:10:42 UTC 2020
New revision: 357600
URL: https://svnweb.freebsd.org/changeset/base/357600

Log:
  MFCr356926:
    Even when the MK_CASPER is set to "no" we still want to install man pages
    and the headers. If the user decides to install the system without Casper
    support, then the Casper functions are mocked, but they still exist in
    the system.

    PR:           242971

Changes:
  stable/12/tools/build/mk/OptionalObsoleteFiles.inc
Comment 9 commit-hook freebsd_committer 2020-02-05 21:12:13 UTC
A commit references this bug:

Author: oshogbo
Date: Wed Feb  5 21:11:41 UTC 2020
New revision: 357601
URL: https://svnweb.freebsd.org/changeset/base/357601

Log:
  MFCr356928:
    When MK_CASPER=no is set remove files which are not needed to run system.

    PR:           242971

Changes:
_U  stable/12/
  stable/12/tools/build/mk/OptionalObsoleteFiles.inc
Comment 10 commit-hook freebsd_committer 2020-02-05 21:15:14 UTC
A commit references this bug:

Author: oshogbo
Date: Wed Feb  5 21:14:27 UTC 2020
New revision: 357602
URL: https://svnweb.freebsd.org/changeset/base/357602

Log:
  MFCr356925:
    Those files are already removed in ObsoleteFiles.\
    There is no need to remove them twice.

    PR:           242971

Changes:
_U  stable/11/
  stable/11/tools/build/mk/OptionalObsoleteFiles.inc
Comment 11 commit-hook freebsd_committer 2020-02-05 21:16:15 UTC
A commit references this bug:

Author: oshogbo
Date: Wed Feb  5 21:15:55 UTC 2020
New revision: 357603
URL: https://svnweb.freebsd.org/changeset/base/357603

Log:
  MFCr356926:
    Even when the MK_CASPER is set to "no" we still want to install man pages
    and the headers. If the user decides to install the system without Casper
    support, then the Casper functions are mocked, but they still exist in
    the system.

    PR:           242971

Changes:
_U  stable/11/
  stable/11/tools/build/mk/OptionalObsoleteFiles.inc
Comment 12 commit-hook freebsd_committer 2020-02-05 21:17:17 UTC
A commit references this bug:

Author: oshogbo
Date: Wed Feb  5 21:16:52 UTC 2020
New revision: 357604
URL: https://svnweb.freebsd.org/changeset/base/357604

Log:
  MFCr356928:
    When MK_CASPER=no is set remove files which are not needed to run system.

    PR:           242971

Changes:
_U  stable/11/
  stable/11/tools/build/mk/OptionalObsoleteFiles.inc