Default flag weights are being overshadowed by the cost of installing new packages
If a flag's default setting pulls in a bunch of packages (currently I think it's just one, but I'm going to increase the initial weights so the issue is less noticeable for now), then the dependency solver will usually disable it. This isn't desired behaviour, given that it makes having a default setting relatively meaningless.
To solve this we'll need to track the total cost of possible new packages, and ensure that the default flag weight is at least as significant as that. This might be tricky given that such new packages may have multiple versions, and the weighting for versions is geared towards overriding use flags to ensure the newest version possible is installed (otherwise it's easy for a use flag to prevent a package from being updated).
It may be necessary, in order to avoid the aforementioned contradiction, to have the weighting only take into account the lowest cost version (the newest), meaning that if an older version is required by a hard dependency, the flag will be disabled to avoid it, even though it's a package that wasn't originally installed. The only way I can think of to get around this limitation would be to have a different weighting scheme for packages of which no version is installed, however once the new package is installed, the other scheme will apply and after subsequent updates you would have the same result as if they both use the same weighting scheme. The more aggressive scheme could also be used just for packages in @world
, but that would limit portmod's ability to update the contents of metapackages (which aren't added to @world
, just the metapackage itself is).
Note that if pulling in those packages requires changing other flags, then this will end up choosing the configuration with the least number of flag changes (likely just flipping the initial flag), since there would be no way of satisfying every default.