Eli Schwartz 47ef0df167
dev-util/dialog: remove broken USE=minimal
USE=minimal was never actually minimal, and nobody noticed or cared.
Even if I fix it to work, the end result produces a difference of:

```
 *   SIZE: 1.35MiB -> 1.51MiB, 4 -> 14 files
 * ------> FILES(+10) SONAME(+1) SIZE(+12.01%)
```

"minimal" is generally an antipattern, and there's no compelling reason
to fix it so we can keep it (or even keep it at all, if it had worked).

It's also conceptually broken today, since any software that links to
the library needs to depend on `dev-util/dialog:=[-minimal]`. And
nothing does -- but at minimum sys-block/whdd would need to.

Historically, the library support was added for bug 266065, and from its
first addition was behind a USE flag. No real argument was given for why
it should be a USE flag, it just kinda "was" that way.

So what was the problem?

`foo && bar || baz` is a mindworm. If bar fails, both bar and baz get
run. The correct grammatical construct is an if/then/else statement, no
(or rare) exceptions.

More on that at https://mywiki.wooledge.org/BashPitfalls#pf22

In this case, we run `default_src_install`, which internally invokes
make install, and then also always run emake install-full, even for
minimal builds.

The reason is because portage is absolutely full of this too. It
constantly runs things like `[[ -n ${VAR} ]] && do_thing_with "${VAR}"`
or else `use foo && bar`. The return value is therefore 1, but no "die"
was called so it "rarely ever matters". Here the issue is that
`default_src_install` finishes by running `einstalldocs`, which
error-returns if there are no docs.

The general rule of thumb is: assume ALL functions defined by PMS or an
eclass *can* and *will* return nonzero at total whimsy unless explicitly
documented to have explicit return values explicitly intended for
explicit testing (such as `use`).

If you write your own ebuild-local functions, then good job, you! You
may assume they are sanely written (because you wrote them), rather than
assuming they are written in `die`-centric ebuildism code golf.

And finally, for bonus points:

Even without install-full, a static library is installed by bad
autoconf-dickey macros. Fixing the install rule only solves 7 out of 8
files.

Bug: https://bugs.gentoo.org/266065
Closes: https://bugs.gentoo.org/958297
Closes: https://github.com/gentoo/gentoo/pull/42641
Acked-by: Sam James <sam@gentoo.org>
Signed-off-by: Eli Schwartz <eschwartz@gentoo.org>
2025-06-20 02:05:53 -04:00
..