Bug 261638 - Mk/Uses/bdb.mk: Many ports IGNORE'd with BDB_DEFAULT=18: cannot install: no eligible BerkeleyDB version
Summary: Mk/Uses/bdb.mk: Many ports IGNORE'd with BDB_DEFAULT=18: cannot install: no e...
Status: Open
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Ports Framework (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Port Management Team
URL:
Keywords: needs-qa
Depends on:
Blocks: 261523
  Show dependency treegraph
 
Reported: 2022-01-31 22:19 UTC by Naram Qashat
Modified: 2022-07-17 00:13 UTC (History)
11 users (show)

See Also:
koobs: maintainer-feedback? (portmgr)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Naram Qashat 2022-01-31 22:19:46 UTC
So recently I was getting messages saying that bdb 5 was deprecated and it was recommended to switch to bdb 18. But when I change my DEFAULT_VERSIONS to have bdb=18, I started getting ports marked as IGNORE in my poudriere builds. For instance, security/cyrus-sasl2 tells me this:

cannot install: no eligible BerkeleyDB version. Requested: 18, incompatible: 2. Try: make debug-bdb

Most ports say the same thing except for having nothing where the 2 after incompatible is.

When I enter an interactive poudriere session with no bdb installed and my default set to 5 (or unset) and run debug-bdb inside of /usr/ports/security/cyrus-sasl2, I get the following:

--INPUTS----------------------------------------------------
CYRUS_SASL_WITH_BDB_VER: 
BDB_DEFAULT: 5
BDB_BUILD_DEPENDS: 
bdb_ARGS (original): 
WITH_BDB_HIGHEST (original): 
--PROCESSING------------------------------------------------
supported versions: 5
invalid versions: 2
installed versions: 
eligible versions: 5
bdb_ARGS (effective): 5
WITH_BDB_HIGHEST (override): yes
--OUTPUTS---------------------------------------------------
IGNORE=
BDB_VER=5
BDB_INCLUDE_DIR=/usr/local/include/db5
BDB_LIB_NAME=db-5.3
BDB_LIB_CXX_NAME=db_cxx-5.3
BDB_LIB_DIR=/usr/local/lib/db5
BUILD_DEPENDS=
LIB_DEPENDS=libdb-5.3.so:databases/db5
------------------------------------------------------------

But if I set my default version to 18, I get the following instead:

--INPUTS----------------------------------------------------
CYRUS_SASL_WITH_BDB_VER: 
BDB_DEFAULT: 18
BDB_BUILD_DEPENDS: 
bdb_ARGS (original): 
WITH_BDB_HIGHEST (original): 
--PROCESSING------------------------------------------------
supported versions: 18
invalid versions: 2
installed versions: 
eligible versions: 
bdb_ARGS (effective): 18
WITH_BDB_HIGHEST (override): yes
--OUTPUTS---------------------------------------------------
IGNORE=cannot install: no eligible BerkeleyDB version. Requested: 18, incompatible: 2. Try: make debug-bdb
BDB_VER=
BDB_INCLUDE_DIR=
BDB_LIB_NAME=
BDB_LIB_CXX_NAME=
BDB_LIB_DIR=
BUILD_DEPENDS=
LIB_DEPENDS=
------------------------------------------------------------

I don't know enough about how bdb.mk is structured to know how to fix this, though.
Comment 1 Yasuhiro Kimura freebsd_committer freebsd_triage 2022-03-30 07:36:21 UTC
(In reply to Naram Qashat from comment #0)

Currently you also need to add 'WITH_BDB6_PERMITTED=yes' to make.conf to use databases/db18 as default version of berkeley db. It it pitfall and will be removed when changing default version of berkeley db to 18.
Comment 2 Dan Langille freebsd_committer freebsd_triage 2022-04-07 16:40:49 UTC
What is the next step for this PR?
Comment 3 John Hein 2022-05-16 16:31:37 UTC
Note: bdrewery@ added the following to Mk/Uses/bdb.mk:

===============
commit a396e4f131341b58bf897f73d1ce1f8a6f6e5256
Author:     Bryan Drewery <bdrewery@FreeBSD.org>
AuthorDate: Mon May 9 11:56:31 2022 -0700
Commit:     Bryan Drewery <bdrewery@FreeBSD.org>
CommitDate: Mon May 9 11:58:30 2022 -0700

    Mk/Uses/bdb.mk: Allow bdb:18 to work by default.

    mail/mutt currently has USES=bdb:18 which causes an obscure error in
    Poudriere causing it to be IGNORED unless WITH_BDB6_PERMITTED is set.
    We already have a license framework so this flag seems odd but in the
    case where a port explicitly is asking for the version it makes sense
    to permit it as the default.

diff --git a/Mk/Uses/bdb.mk b/Mk/Uses/bdb.mk
index 645b9e9a7b0e..0316ff061229 100644
--- a/Mk/Uses/bdb.mk
+++ b/Mk/Uses/bdb.mk
@@ -63,7 +63,7 @@ _DB_DEFAULTS= 5
 #   Since 2020-12-02, this name is not fitting too much but
 #   retained for now for compatibility. The name of this variable
 #   is subject to change especially once db6 were removed.
-.  if defined(WITH_BDB6_PERMITTED)
+.  if defined(WITH_BDB6_PERMITTED) || ${_bdb_ARGS} == 18
 _DB_DEFAULTS+= 18
 .  endif
===============


Unfortunately, the LICENSE for db18 is AvGPL3.  This can cause a port that uses this version of bdb to now be "infected" by this license and may require the LICENSE setting for the port to be adjusted.

This is not fully in sync with the OP's original issue, but it is intimately related to one solution for it (define WITH_BDB6_PERMITTED=1).  This may require discussion in a separate bug or phab review.

bdrewery@ CC'd for comment.


Any port that now uses something newer than db5 (which, in the current ports tree, means using databases/db18) may need to adjust its declared LICENSE.

See also mail/mutt: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=263211

See also databases/p5-BerkeleyDB (perl@ CC'd - please comment).
Comment 4 John Hein 2022-05-16 17:21:49 UTC
See also bug 264022