Page MenuHomeFreeBSD

databases/duckdb: Do not pull in dependencies of unselected extensions
ClosedPublic

Authored by olgeni on Mon, Aug 24, 11:03 PM.
Tags
None
Referenced Files
F169104791: D59163.id.diff
Mon, Aug 31, 10:31 AM
Unknown Object (File)
Sun, Aug 30, 10:12 AM
Unknown Object (File)
Sun, Aug 30, 2:14 AM
Unknown Object (File)
Sat, Aug 29, 5:29 AM
Unknown Object (File)
Fri, Aug 28, 8:16 PM
Unknown Object (File)
Thu, Aug 27, 5:21 AM
Unknown Object (File)
Tue, Aug 25, 1:32 PM
Unknown Object (File)
Tue, Aug 25, 1:29 PM
Subscribers
None

Details

Summary

The extension loop adds each extension's library dependencies with

LIB_DEPENDS+= ${PORT_OPTIONS:M${opt}:?${${opt}_LIB_DEPENDS}:}

The intent is "if this extension's option is selected, append its
<OPT>_LIB_DEPENDS", mirroring the two lines above it. Those work because
${PORT_OPTIONS:M${opt}:S/...} is empty-in-empty-out, but :? does not
behave the same way: per make(1), it evaluates the variable *name* -- not
the value the preceding modifiers produced -- as a conditional
expression. The condition here is therefore the bare word PORT_OPTIONS,
which is always true, so the true branch is always taken:

PORT_OPTIONS= FOO BAR
${PORT_OPTIONS:MAWS} -> ""
${PORT_OPTIONS:MAWS:?${AWS_LIB_DEPENDS}:} -> libaws.so:devel/aws

As a result AVRO_LIB_DEPENDS (avro-c, jansson, snappy), AWS_LIB_DEPENDS
(aws-sdk-cpp) and ODBC_SCANNER_LIB_DEPENDS (unixODBC) are added to every
build, even though all three options are marked BROKEN and are off by
default. Besides the needless dependencies, this makes the port
unbuildable in trees where devel/aws-sdk-cpp is unavailable ๐Ÿ˜… and it takes
every consumer of databases/duckdb down with it.

The line is not needed in the first place: <OPT>_LIB_DEPENDS is a
standard options helper, and bsd.options.mk already applies it for the
selected options, group options included. Drop it and bump
PORTREVISION, since the dependency list of the default package changes.

Test Plan

With the default option set, and with AWS forced on:

  1. make -V LIB_DEPENDS # before

libcurl.so:ftp/curl libavro.so:devel/avro-c libjansson.so:devel/jansson
libsnappy.so:archivers/snappy libaws-cpp-sdk-core.so:devel/aws-sdk-cpp
libodbc.so:databases/unixODBC

  1. make -V LIB_DEPENDS # after

libcurl.so:ftp/curl

  1. make WITH=AWS -V LIB_DEPENDS # after, helper still applies

libcurl.so:ftp/curl libaws-cpp-sdk-core.so:devel/aws-sdk-cpp

poudriere testport on 14.4-RELEASE amd64: builds clean, stage-qa and
check-plist report no issues. The staged libduckdb.so now needs only
libc++, libc, libcrypto, libcurl, libcxxrt and libgcc_s -- no aws-sdk-cpp,
unixODBC or avro-c.

Diff Detail

Repository
R11 FreeBSD ports repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

olgeni held this revision as a draft.
olgeni published this revision for review.Mon, Aug 24, 11:14 PM
olgeni edited the summary of this revision. (Show Details)
This revision is now accepted and ready to land.Tue, Aug 25, 1:37 AM