having the "+test" or "+tests" variant propagate causes unexpected builds
Daniel J. Luke
dluke at geeklair.net
Sat Oct 29 02:33:04 UTC 2022
I don't think implementation difficulty is the barrier here - but that all variants should just have the same behavior.
In my mind, the real problem is the need for +test variants, there should be a way to just use the test phase - and perhaps changes to base/ to enable that are a better option.
> On Oct 23, 2022, at 7:58 PM, Jason Liu <jasonliu at umich.edu> wrote:
>
> My own personal opinion has been that +test/+tests and +debug, by default, should not propagate through the chain of dependencies; and then perhaps there might be some way to enable propagation (maybe with a command line option?).
>
> However, if I recall correctly, all variants propagate through the dependency chain, so it might be difficult to make certain variant keywords behave differently?
>
> --
> Jason Liu
>
>
> On Sun, Oct 23, 2022 at 1:58 PM Ken Cunningham <ken.cunningham.webuse at gmail.com> wrote:
> Various ports implement a “test” or “tests” variant to allow extra features and deps required for testing to be enabled.
>
> This variant, when requested, will propagate up the chain to all the ports, however. There is no real use case where someone would desire the test/s variant to propagate up.
>
> This generates needless builds, and often enables features people neither need nor want, and then guarantees manual rebuilds, forever, of the involved ports.
>
> I recently came back to a massive building project involving clang and llvm when I was trying to build “mesa +tests”. Because clang-15 and llvm-15 also have a “+tests” variant, and had not yet been installed, port was building those (and possibly others) with the tests variant rather than use the prebuilt binary.
>
> Of course I just aborted the huge llvm/clang-15 build, cleaned them up, and installed them separately. But others would probably not know to do this.
>
> I had suggested a few years ago we might namespace the test/tests variants, by having a convention that the portname be prepended to the test variant, to be more specific and avoid this — but not a widely acceptable idea at that time. So we’re still in the same situation…
>
> Is it possible that a “test” or “tests” variant might not be propagated up the ports chain by base, instead?
>
>
> K
>
>
>
> PS. A similar thing happens with “+debug” variants, another common variant that you *usually* don’t want propagated up to *every single port* in the chain either.
>
> This one is occasionally something that people would want up their chain, but it is so fragile of a plan to rely on variant propagation (ie if you have the port installed already, it won’t be reinstalled with the “+debug” variant), that such rare users might best install each port they want to be installed as “debug” do that specifically. Certainly most of us don’t want clang-15 installed with it’s debug variant when you’re trying to debug some little port.
--
Daniel J. Luke
More information about the macports-dev
mailing list