On 17/07/2025 00:31, John Haugabook via Cygwin-apps wrote:
Hello,
This patch adds an option --build-depend that, when called; installs the
packages listed in the build-depends property of setup.ini. It is for
someone who wants to build the binaries of a package themselves, enabling
them to pass one stringed package in lieu of a vector of packages.
Thanks very much for looking at this!
Right now this is more or less a rough draft as feedback requested i.e.
what's the best way to implement this, and to get specific detailed
hand-holding help on two things (unless better approach):
1. Using the correct setup.ini file (debugged using copy of setup.ini) and
passing it as a string to the "stream" parameter of build_depend(), which
is declared as:
- std::string build_depend(std::string pkg_search, std::string stream)
in build_depends.h.
So, I'd suggest that's not quite the right approach, as it falls down
when setup is requested to read from multiple package repositories.
(e.g. when fetching a supplemental set of packages from an overlay
server, as described in [1])
[1] https://cygwin.com/package-server.html
If you take a look at
IniDBBuilderPackage.cc:IniDBBuilderPackage::buildBeginBuildDepends(),
you'll see where the current handling of build-requires data parsed from
setup.ini stops.
It should be relatively straightforward to add another "nodeList" here,
to assemble the data parsed from build-requires: lines in setup.ini
(identically to the existing handling of
depends/obsoletes/provides/conflicts)
[There's a bit here where I skip over plumbing the build-requires into
the packagedb]
2. Convert and handle successful output of build_depend(), passing it to
"PackageOption" in package_meta.cc (unless better way) as a vector as
if the output from build_depend() was passed to -P, --packages.
In choose.cc:ChooserPage::applyCommandLinePackageSelection() there's an
existing block of code which handles, uh, command line package selection.
It seems like we could have a separate chunk here, which iterates over
the package names supplied to the '--build-depends' option, fetches
their build-requires, and marks those packages as "to be installed".