Bug 265570 - lang/gnatcross-sysroot-aarch64: package declares FreeBSD-base libraries as being provided in its manifest
Summary: lang/gnatcross-sysroot-aarch64: package declares FreeBSD-base libraries as be...
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Fernando Apesteguía
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-08-02 07:23 UTC by dfr
Modified: 2022-09-01 05:45 UTC (History)
5 users (show)

See Also:
fernape: maintainer-feedback?


Attachments
patch to add BUNDLE_LIBS (781 bytes, patch)
2022-08-17 16:29 UTC, Fernando Apesteguía
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description dfr 2022-08-02 07:23:52 UTC
A fragment of the +MANIFEST is included below showing that it declares that it provides base libraries. Note that the package declares that its ABI is FreeBSD:13:amd64 but the libraries contained are for aarch64. 

Normally this doesn't cause problems since most installations and jails use base.txz and this contains all the base libraries.

I created a tiny base image containing FreeBSD-runtime, FreeBSD-pkg-bootstrap and supporting libraries and added a repo declaration for FreeBSD-base pointing at alpha.pkgbase.live. When I try to install extra packages from base, instead of installing dependencies from base, pkg chooses gnatcross-sysroot-aarch64 instead, resulting in a non-functional image.

{
  "name": "gnatcross-sysroot-aarch64",
  "origin": "lang/gnatcross-sysroot-aarch64",
  "version": "1_1",
  "comment": "FreeBSD sysroots for C/Ada cross-compiler (amd64)",
  "maintainer": "ports@FreeBSD.org",
  "www": "http://www.dragonlace.net",
  "abi": "FreeBSD:13:amd64",
  "arch": "freebsd:13:x86:64",
  "prefix": "/usr/local/FreeBSD_ARM64",
  "flatsize": 184282577,
  "licenselogic": "single",
  "desc": "This package is used by the lang/gnatcross-aarch64 Ada cross-compiler to\ninstall the system root of FreeBSD ARM64 (aarch64).\n\nWWW: http://www.dragonlace.net",
  "categories": [
    "lang"
  ],
  "shlibs_provided": [
    "libsdp.so.4",
    "libcap_pwd.so.0",
    "libkrb5.so.11",
    "libprivatebsdstat.so.1",
    "libhdb.so.11",
    "libmagic.so.4",
    "libheimbase.so.11",
    ...
Comment 1 dfr 2022-08-02 09:15:19 UTC
I can work around this with something like 'pkg install -r FreeBSD-base ...' but so far my attempts to use priorities to prefer shlibs from FreeBSD-base don't work.

I notice that this port currently doesn't have a maintainer - perhaps it can be disabled?
Comment 2 Baptiste Daroussin freebsd_committer freebsd_triage 2022-08-02 09:20:18 UTC
this port should use BUNDLE_LIBS=yes and not expose its libs
Comment 3 dfr 2022-08-02 12:47:42 UTC
Apparently this has caused problems for people not using pkgbase at least once: https://docs.freebsd.org/cgi/getmsg.cgi?fetch=161079+0+archive/2021/freebsd-current/20210321.freebsd-current.

I don't have a ports commit bit otherwise I would add BUNDLE_LIBS myself :(
Comment 4 Fernando Apesteguía freebsd_committer freebsd_triage 2022-08-17 16:29:37 UTC
Created attachment 235969 [details]
patch to add BUNDLE_LIBS

Could you try this patch?
Comment 5 dfr 2022-08-18 16:22:57 UTC
Looks reasonable to me but I'm not a ports committer so I can't commit it.
Comment 6 Fernando Apesteguía freebsd_committer freebsd_triage 2022-08-18 16:43:40 UTC
Let's see if portmgr@ can say something...
Comment 7 Antoine Brodin freebsd_committer freebsd_triage 2022-08-18 18:25:06 UTC
Hello,
This port is unmaintained,  you don't need portmgr or other approval to fix it.
Comment 8 Fernando Apesteguía freebsd_committer freebsd_triage 2022-08-18 18:34:48 UTC
(In reply to Antoine Brodin from comment #7)
Oh, I know that part, but regarding BUNDLE_LIBS the handbook says "Always ask the Ports Management Team <portmgr@FreeBSD.org> before adding this to a port."
Comment 9 Antoine Brodin freebsd_committer freebsd_triage 2022-08-18 18:54:05 UTC
(In reply to Fernando Apesteguía from comment #8)
In comment #2,  bapt belongs to portmgr
Comment 10 commit-hook freebsd_committer freebsd_triage 2022-08-28 11:50:47 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=6706c7424c96d9947a624237f61b261dac85b099

commit 6706c7424c96d9947a624237f61b261dac85b099
Author:     Fernando Apesteguía <fernape@FreeBSD.org>
AuthorDate: 2022-08-17 06:15:37 +0000
Commit:     Fernando Apesteguía <fernape@FreeBSD.org>
CommitDate: 2022-08-28 11:45:40 +0000

    lang/gnatcross-sysroot-aarch64: Use BUNDLE_LIBS

    Package declares FreeBSD-base libraries as being provided in its manifest.
    Use BUNDLE_LIBS so the package does not expose its libs.

    PR:             265570
    Reported by:    dfr@rabson.org
    MFH:            2022Q3

 lang/gnatcross-sysroot-aarch64/Makefile | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
Comment 11 Fernando Apesteguía freebsd_committer freebsd_triage 2022-09-01 05:45:53 UTC
Committed,

Thanks!