Bug 273839 - contrib libs does not install pc files for libs
Summary: contrib libs does not install pc files for libs
Status: Open
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: 13.2-STABLE
Hardware: Any Any
: --- Affects Many People
Assignee: freebsd-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-09-16 03:57 UTC by Ivan Rozhuk
Modified: 2023-09-17 03:10 UTC (History)
8 users (show)

See Also:


Attachments
patch (1.66 KB, patch)
2023-09-16 04:03 UTC, Ivan Rozhuk
no flags Details | Diff
patch (1.66 KB, patch)
2023-09-16 05:32 UTC, Ivan Rozhuk
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ivan Rozhuk 2023-09-16 03:57:26 UTC
contrib/elftoolchain/libelf VS devel/elfutils
contrib/libucl VS textproc/libucl
contrib/zstd VS archivers/zstd
contrib/libsodium VS security/libsodium
contrib/libpcap VS net/libpcap


In case libelf we got some ports (glib20 [1], llvm* [2], mesa-dri [3]) prefer lib from ports if it installed and use system if not.
So if some one build package on system with libelf from port and try to install on another system - then package got missed lib dep.

Probably other libs from list above (and may be some other unlisted) have no sense to keep in ports, like zlib exist only in base.


1. https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=273479
2. https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=273801
3. https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=273803
Comment 1 Ivan Rozhuk 2023-09-16 04:03:19 UTC
Created attachment 244914 [details]
patch

This patch add libelf.pc for contrib/elftoolchain/libelf, this fix glib20 elf lib handling:
...
Run-time dependency libelf found: YES 0.100
...
0.100 was used for test, not version is set to 0.187 like port version.
Comment 2 Ivan Rozhuk 2023-09-16 05:32:30 UTC
Created attachment 244916 [details]
patch

Change version to 0.186 - to easy detect that libelf from base sys, ports version is 0.187.
Comment 3 Cy Schubert freebsd_committer freebsd_triage 2023-09-16 13:37:34 UTC
90f14401dea714ea5558bd4ae0b704aeb0fecc9c has been reverted.
Comment 4 commit-hook freebsd_committer freebsd_triage 2023-09-16 13:38:46 UTC
A commit in branch main references this bug:

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

commit b7f2c91ae8f9b047c7e9af6b1d8772752cfcc08f
Author:     Cy Schubert <cy@FreeBSD.org>
AuthorDate: 2023-09-16 13:33:34 +0000
Commit:     Cy Schubert <cy@FreeBSD.org>
CommitDate: 2023-09-16 13:36:40 +0000

    Revert "devel/binutils: Disable randomly discovered libelf dependency"

    The author requests revert. His patch has caused PR/273839.

    PR:     273798, 273839

    This reverts commit 90f14401dea714ea5558bd4ae0b704aeb0fecc9c.

 devel/binutils/Makefile | 1 -
 1 file changed, 1 deletion(-)
Comment 5 Cy Schubert freebsd_committer freebsd_triage 2023-09-16 13:56:18 UTC
It is always best to thoroughly test before submitting a patch. I failed to do that for you before committing your patch. You failed to thoroughly test before submitting a patch. A learning experience for both of us.
Comment 6 Jan Beich freebsd_committer freebsd_triage 2023-09-16 14:46:01 UTC
(In reply to Cy Schubert from comment #5)
This bug is for base system. Nothing has landed so far.

I do like the idea here: many base libs already provide pkg-config support. Until then ports/ can either patch (vendor) source, use synthetic *.pc file and adjust PKG_CONFIG_PATH or slap CONFLICTS_BUILD and suggest poudriere.

devel/libelf is under LGPL, was last released on 2009-11-01 and has dead upstream. It should probably be nuked from ports/ instead of growing consumers due to bugs like this one.

(In reply to Ivan Rozhuk from comment #0)
> contrib/libucl VS textproc/libucl
> contrib/zstd VS archivers/zstd

Base versions of these are not supposed to be used by ports due to PRIVATELIB=true.

> contrib/libsodium VS security/libsodium

Base libsodium appears limited to kernel.
Comment 7 Graham Perrin 2023-09-16 15:43:03 UTC
Maybe open a new bug report? With see also: bug 273798 and this bug 273839.
Comment 8 Ivan Rozhuk 2023-09-16 22:09:57 UTC
Nothing has fixed here.
Comment 9 Cy Schubert freebsd_committer freebsd_triage 2023-09-17 01:23:40 UTC
(In reply to Jan Beich from comment #6)

FreeBSD does not use Makefiles in contrib to build contrib software. One must alter FreeBSD's bespoke Makefiles.

But, before we think about any of this, the question of whether to PC files installed by the base system should probably be discussed on arch@, and depending on the decision of the folks there, followed up by a patch submitted through phabricator. The one ports developer and I (src/ports) are not enough people to make a decision whether to add this to the base system or not.

Personally, I don't think we should install PC files in base. Additional features not used by everyone are what ports are for. Again, a discussion on arch@ would answer this question rather than relying on one developer's opinion. I think the decision of whether to include this in base depends more than on two developers opinion in the matter and arch@ is probably the better place to flesh out any ideas.

Then: Should it be decided to do this, a phabricator review would be the next step. A PR will not allow enough eyes to review the proposal. I would feel better if imp, jhb, emaste, kib, and others were part of the discussion.
Comment 10 Ivan Rozhuk 2023-09-17 02:12:51 UTC
> Personally, I don't think we should install PC files in base. Additional features not used by everyone are what ports are for.

libcrypto.pc
liblzma.pc
libmagic.pc
libssl.pc
libusb-0.1.pc
libusb-1.0.pc
libusb-2.0.pc
openssl.pc
zlib.pc

We already have zlib and liblzma. archivers/zstd port does not have options that enables/disables any features. Why not to have zstd pc file in base?

libelf - required by some ports and randomly linked to system / ports version as an example that control is lost.

I prefer sqlite3 from ports.
Other contrib libs - I have no idea.
Comment 11 Cy Schubert freebsd_committer freebsd_triage 2023-09-17 02:20:16 UTC
As stated before, we should discuss with the elftoolchain maintainers on arch@.