Using 'Source:' in setup.ini (was Re: [PATCH setup v2] add --build-depend option)

Jon Turney via Cygwin-apps <[email protected]> Sat, 7 Mar 2026 19:23:20 +0000
Newsgroups gmane.os.cygwin.applications
Message-ID <[email protected]>
On 31/08/2025 16:23, Jon Turney via Cygwin-apps wrote:
> On 24/07/2025 03:07, 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. It is for someone who
>> wants to build the binaries of a package themselves, enabling them to
>> pass one string value to the setup command in lieu of an array of 
>> packages.
> 
> Thanks very much for working on this!
> 
> Sorry for the ridiculous delay in responding.
>>> On 18/07/2025, Jon Turney via Cygwin-apps [[PATCH setup] add --build- 
>>> depend option] wrote:
>>>> 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)
[..]
> 
> You can take a look at [1] for what I put together.
> [1] https://cygwin.com/cgit/cygwin-apps/setup/log/?h=topic/build- 
> depends> from what I've loosely tested, the packages returned are as if 
> -P was
>> used to install.

So, the change to add a '--build-depends' option is in the currently 
deployed version of setup, but unfortunately doesn't work in many cases 
(basically, only when there is an install package with the same name as 
the source package it's generated from).

It's not presently possible for setup to locate packages by source 
package name, or sensibly traverse from an install package name to a 
source package name, because we don't actually emit that information 
into the manifest, and we currently only emit build-depends for packages 
which exactly match the source package name.

(I guess we could emit the build-depends: along with source: lines for 
every package built from the same source, but that seems increasingly 
redundant, especially when we already have an alternative syntax which 
addresses this)

For a long time (since at least 2003), we've had a alternative syntax 
defined for declaring the source archives in setup.ini (documented in 
[1]) which avoids all this confusion by actually surfacing the source 
package name there.


So this boils down to changing from (e.g.):

@ libblah
install: noarch/release/blah/blah-1.0.tar.xz <size> <hash>
source: src/release/blah/blah-1.0-src.tar.xz ...

to

@ libblah
install: noarch/release/blah/blah-1.0.tar.xz <size> <hash>
Source: blah-src

@ blah-src
source: src/release/blah/blah-1.0-src.tar.xz ...
build-depends: foo


(This also makes the manifest a bit smaller, as it means we don't repeat 
the full source: line for every install package generated from the same 
source package)

This syntax has been accepted by setup for a long time, but we've never 
made the switch to using it.

Last time I raised this, there were some vague concerns, I think around 
ensuring other tools could extract the data they want from the manifest 
in a single-pass (which is not guaranteed, but perhaps could be by 
ordering packages correctly).

[1] https://sourceware.org/cygwin-apps/setup.ini.html