Open thesamesam opened 5 months ago
We've had quite a lot of other examples of this where we forget to fully cleanup a USE flag but I can't recall any right now.
EDIT: https://bugs.gentoo.org/buglist.cgi?quicksearch=ALL%20%22not%20in%20IUSE%22&list_id=7051610
Another common case for this is where a flag is removed from IUSE
but not in configure (say, a call to econf
).
Well, Now I found the issues with automating this check:
$ pkgcheck scan -c UnknownUseFlagsCheck
app-office/kmymoney
MissingIuse: version 5.1.3: line 89: USE flag 'experimental' not in IUSE, called: use experimental
MissingIuse: version 5.1.3: line 110: USE flag 'experimental' not in IUSE, called: usex experimental
games-action/descent2-freedata
MissingIuse: version 1: line 48: USE flag 'textures' not in IUSE, called: use textures
sys-firmware/sigrok-firmware-fx2lafw
MissingIuse: version 9999: line 36: USE flag 'binary' not in IUSE, called: use binary
MissingIuse: version 9999: line 46: USE flag 'binary' not in IUSE, called: use binary
All of them are behind a weird if
logic, which for me stands for close to abuse.
If we check IUSE
in metadata for that versinon, we should avoid the FPs, even if those matches you gave look suspicious (they look valid but easy to get wrong).
If we check
IUSE
in metadata for that versinon, we should avoid the FPs, even if those matches you gave look suspicious (they look valid but easy to get wrong).
Sorry, I failed at understanding this reply. How would metadata scan help us, since this is protected behind magic if
, for example:
src_install() {
if [[ ${PV} != "9999" ]] && use binary ; then # <--- notice magic here
insinto /usr/share/sigrok-firmware
doins *.fw
dodoc ChangeLog NEWS README
else
default
fi
}
Ah, I see. OK, let's just skip it if the line has non-use
conditionals?
Is there an existing such new check request for this?
Explain
use foo
is illegal iffoo
is not inIUSE
.We can check if
foo
is inIUSE
and whether there's an unconditional simple use ofuse
, like:In such a case,
use foo
is definitely illegal as there's noin_iuse
call.It will fail like:
Examples
https://bugs.gentoo.org/921303
See dev-php/pecl-memcache in ::gentoo, fixed in commit bc4be3473afc1a1992475fd58df256bde6df7fcb.
Output message
MissingIuse
Documentation
USE flag not in
IUSE
referenced viause
command.Result level
error