On 30/9/2025 07:11, Gregorio Litenstein wrote:
Would it be possible to add some manner of configuration option (or
possibly extra command-line switches) so that the -s and -b command-line
switches aren't taken into account for packages (and their dependencies)
that only got pulled-in as the result of a `depends_build`?
My use case is the following: I'm building a large program that depends
on things like ffmpeg, librsvg (and thus rust), among others, and I want
it to be truly redistributable, so I want to build at least all direct
dependencies myself. Howevere, I don't want to be building stuff like
gcc, rustc, clang and llvm on the regular on my CI runs. This has led me
to make a very complex workflow trying to optimize what is built and
what is installed from binary packages and it mostly works, but is very
brittle.
You're trying to do a complicated thing, so there isn't going to be a
dead simple solution. One problem is that recursive dependencies can be
encountered via multiple dependency types, so it's not even
straightforward to figure out if something is *only* depended on via
depends_build. (As an aside, you probably want to treat depends_fetch,
depends_extract, and depends_patch similarly.)
If you only care about whether something is in depends_build for the
top-level port, that's easier. Install the other dep types from source
and then install the build deps allowing binaries.
Either way, you will likely need to write at least a little code, since
this is a very specialised need. The dependencies.tcl script from mpbb
would be a good starting point. It shouldn't be too hard to modify it to
maintain a set of flags indicating whether each port has been seen as a
runtime dep of something, and update the options accordingly when
installing.
- Josh