Query types like --print-requires, --print-requires-private and --print-provides
can be used in practice to query information about a calculated solution rather
than a single package.
Allow this to be done where it makes sense to allow it, while continuing to restrict
package-specific queries (like --variable= and --variables) to single packages.
Fixes: 541de8bd ("main: handle query selectors that are only usable for single packages correctly")
Signed-off-by: Ariadne Conill <ariadne@dereferenced.org>
Closes: #366
ci/woodpecker/push/woodpecker Pipeline was successfulDetails
This feature adds autoconf-style -DHAVE_FOO definitions to the
--cflags output when it is requested. This has been requested
a few times over the years as it allows for simplifying build
system logic in scenarios where a standalone Makefile or similar
build process is used without a configuration step.
Provide a second optional argument to PKG_PROG_PKG_CONFIG with an action to
take if no pkgconf is found, and default to aborting.
Too many configure scripts in the wild don't handle an empty PKG_CONFIG,
resulting in weird error messages through the run, which often confuse
users.
Authors wishing to fallback to other methods can either return to the old
behavior by specifying [:] as an action, or use [PKG_CONFIG=false] and call
pkg-config macros normally, handling the fallback as any other failure.
Users can override PKG_CONFIG in the command line so this should imply no
regression.
Closes: https://github.com/pkgconf/pkgconf/issues/350
Ref: https://gitlab.freedesktop.org/pkg-config/pkg-config/-/issues/69
Signed-off-by: Ismael Luceno <ismael@iodev.co.uk>
Remove the 'traverse_serial' fields which were added in 2.1.1.
Use the 'serial' field to track the current traversal.
Stop using 'identifier' to sort packages in the flattened solution.
Directly construct the flattened solution by a specific walk which
also preserves the relative order in Requires and Requires.private.
The topological sort is a single list, so don't fill requires_private.
Purely private dependencies are marked in dependency flags.
The ancestor flag is a pkg property, not a client property.
In our previous attempt to optimize this problem, we did not track the type of the
visit to the node, e.g. whether it came from evaluating Requires or Requires.private,
which resulted in some solutions being correctly incalculated due to greedy optimization
of the dependency graph.
We reintroduce this optimization by adding a second traversal serial as well as
re-introducing the PROPF_VISITED node property as well as a new PROPF_VISITED_PRIVATE
node property flag. This allows a node to be revisted at maximum two times per
traversal level.
Co-authored-by: Yi Chou <yich@google.com>