Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 539848 - QA warnings double each time ebuild is executed
Summary: QA warnings double each time ebuild is executed
Status: RESOLVED WONTFIX
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Unclassified (show other bugs)
Hardware: AMD64 Linux
: Normal minor (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-02-12 06:57 UTC by abandoned account
Modified: 2015-05-31 05:18 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
included whole 12meg log (as 260KiB bz2) to see exactly how it looks like when QA warnings get duplicated like that (grub-9999-r1:20150212-035520.log.bz2,253.17 KB, application/x-bzip)
2015-02-12 07:15 UTC, abandoned account
Details

Note You need to log in before you can comment on or make changes to this bug.
Description abandoned account 2015-02-12 06:57:14 UTC
When keepwork and keeptemp (and -stricter in my case) FEATURE flags are used, successive ebuild executions stack any reported QA warnings, due to the way warnings are grep-ed out from the log.

The "problem" code is in this file:
/usr/lib/portage/python2.7/install-qa-check.d/90gcc-warnings
...
f=$(LC_CTYPE=C LC_COLLATE=C "${grep_cmd}" -E "${joined_msgs}" "${PORTAGE_LOG_FILE}")
...
eqawarn "QA Notice: Package triggers severe warnings which indicate that it"
                                eqawarn "           may exhibit random runtime failures."
                                eqawarn "${f}"

...
It seems to me that the QA warnings become part of that log file (example log filename: /var/log/portage/ebuild.logs/build/sys-boot/grub-9999-r1:20150212-035520.log )  and because of the way they are reported they will match the grep again on a successive ebuild call so they will be reported again, effectively doubling them. The temp/logging/other  file in which they are put(apparently) was about 3 megs at one point when I decided to investigate because it took too many seconds to display the QA warnings on console.



Reproducible: Always

Steps to Reproduce:
1. ebuild /usr/portage/sys-boot/grub/grub-9999-r1.ebuild merge

2. ebuild /usr/portage/sys-boot/grub/grub-9999-r1.ebuild merge

3.


Expected Results:  
exclude already reported QA warnings from the existing .log file, so they don't keep accruing with each ebuild run.
Comment 1 abandoned account 2015-02-12 07:04:15 UTC
looks like this:
 first time reported:

 * QA Notice: Package triggers severe warnings which indicate that it
 *            may exhibit random runtime failures.
 * /var/tmp/portage/sys-boot/grub-9999-r1/work/grub-9999/grub-core/disk/diskfilter.c:505:4: warning: implicit 
declaration of function ‘printf’ [-Wimplicit-function-declaration]


second time reported:
 * QA Notice: Package triggers severe warnings which indicate that it
 *            may exhibit random runtime failures.
 * /var/tmp/portage/sys-boot/grub-9999-r1/work/grub-9999/grub-core/disk/diskfilter.c:505:4: warning: implicit 
declaration of function ‘printf’ [-Wimplicit-function-declaration]                                             *  * /var/tmp/portage/sys-boot/grub-9999-r1/work/grub-9999/grub-core/disk/diskfilter.c:505:4: warning: implic
it declaration of function ‘printf’ [-Wimplicit-function-declaration]                                         

third time reported:
 * QA Notice: Package triggers severe warnings which indicate that it
 *            may exhibit random runtime failures.
 * /var/tmp/portage/sys-boot/grub-9999-r1/work/grub-9999/grub-core/disk/diskfilter.c:505:4: warning: implicit 
declaration of function ‘printf’ [-Wimplicit-function-declaration]                                             *  * /var/tmp/portage/sys-boot/grub-9999-r1/work/grub-9999/grub-core/disk/diskfilter.c:505:4: warning: implic
it declaration of function ‘printf’ [-Wimplicit-function-declaration]                                          *  * /var/tmp/portage/sys-boot/grub-9999-r1/work/grub-9999/grub-core/disk/diskfilter.c:505:4: warning: implic
it declaration of function ‘printf’ [-Wimplicit-function-declaration]                                          *  *  * /var/tmp/portage/sys-boot/grub-9999-r1/work/grub-9999/grub-core/disk/diskfilter.c:505:4: warning: imp
licit declaration of function ‘printf’ [-Wimplicit-function-declaration]                                       * /var/tmp/portage/sys-boot/grub-9999-r1/work/grub-9999/grub-core/disk/diskfilter.c:532:5: warning: format ‘%
u’ expects a matching ‘unsigned int’ argument [-Wformat=]                                                      * /var/tmp/portage/sys-boot/grub-9999-r1/work/grub-9999/grub-core/disk/diskfilter.c:532:5: warning: format ‘%
u’ expects a matching ‘unsigned int’ argument [-Wformat=]
Comment 2 abandoned account 2015-02-12 07:07:08 UTC
failed the copy/pasting above, the lines got merged. I added newlines manually to the third, looks like this:

 * QA Notice: Package triggers severe warnings which indicate that it
 *            may exhibit random runtime failures.
 * /var/tmp/portage/sys-boot/grub-9999-r1/work/grub-9999/grub-core/disk/diskfilter.c:505:4: warning: implicit 
declaration of function ‘printf’ [-Wimplicit-function-declaration]                                            
 *  * /var/tmp/portage/sys-boot/grub-9999-r1/work/grub-9999/grub-core/disk/diskfilter.c:505:4: warning: implic
it declaration of function ‘printf’ [-Wimplicit-function-declaration]                                         
 *  * /var/tmp/portage/sys-boot/grub-9999-r1/work/grub-9999/grub-core/disk/diskfilter.c:505:4: warning: implic
it declaration of function ‘printf’ [-Wimplicit-function-declaration]                                         
 *  *  * /var/tmp/portage/sys-boot/grub-9999-r1/work/grub-9999/grub-core/disk/diskfilter.c:505:4: warning: imp
licit declaration of function ‘printf’ [-Wimplicit-function-declaration]                                      
 * /var/tmp/portage/sys-boot/grub-9999-r1/work/grub-9999/grub-core/disk/diskfilter.c:532:5: warning: format ‘%
u’ expects a matching ‘unsigned int’ argument [-Wformat=]                                                     
 * /var/tmp/portage/sys-boot/grub-9999-r1/work/grub-9999/grub-core/disk/diskfilter.c:532:5: warning: format ‘%
u’ expects a matching ‘unsigned int’ argument [-Wformat=]
Comment 3 abandoned account 2015-02-12 07:15:02 UTC
Created attachment 396232 [details]
included whole 12meg log (as 260KiB bz2) to see exactly how it looks like when QA warnings get duplicated like that
Comment 4 abandoned account 2015-02-12 07:43:33 UTC
While the QA warnings were being displayed, but because there were a lot of them and I had to interrupt with C-c, the next ebuild run shows this:

# time ebuild /usr/portage/sys-boot/grub/grub-9999-r1.ebuild merge
>>> Existing ${T}/environment for 'grub-9999-r1' will be sourced. Run
>>> 'clean' to start with a fresh environment.
>>> WORKDIR is up-to-date, keeping...
 * checking ebuild checksums ;-) ...                                                                   [ ok ]
 * checking auxfile checksums ;-) ...                                                                  [ ok ]
 * checking miscfile checksums ;-) ...                                                                 [ ok ]
>>> It appears that 'pretend' has already executed for 'grub-9999-r1'; skipping.
>>> Remove '/var/tmp/portage/sys-boot/grub-9999-r1/.pretended' to force pretend.
>>> It appears that 'setup' has already executed for 'grub-9999-r1'; skipping.
>>> Remove '/var/tmp/portage/sys-boot/grub-9999-r1/.setuped' to force setup.
>>> It appears that 'unpack' has already executed for 'grub-9999-r1'; skipping.
>>> Remove '/var/tmp/portage/sys-boot/grub-9999-r1/.unpacked' to force unpack.
>>> It appears that 'prepare' has already executed for 'grub-9999-r1'; skipping.
>>> Remove '/var/tmp/portage/sys-boot/grub-9999-r1/.prepared' to force prepare.
>>> It appears that 'configure' has already executed for 'grub-9999-r1'; skipping.
>>> Remove '/var/tmp/portage/sys-boot/grub-9999-r1/.configured' to force configure.
>>> It appears that 'compile' has already executed for 'grub-9999-r1'; skipping.
>>> Remove '/var/tmp/portage/sys-boot/grub-9999-r1/.compiled' to force compile.
 * Skipping make test/check due to ebuild restriction.
>>> Test phase [disabled because of RESTRICT=test]: sys-boot/grub-9999-r1
>>> It appears that 'install' has already executed for 'grub-9999-r1'; skipping.
>>> Remove '/var/tmp/portage/sys-boot/grub-9999-r1/.installed' to force install.
 * Removing /lib/systemd
 * Removing /lib32/systemd
 * Removing /lib64/systemd
 * Removing /usr/lib/systemd
 * Removing /usr/lib32/systemd
 * Removing /usr/lib64/systemd
 * Removing /etc/systemd
 * checking 611 files for package collisions
 * This package will overwrite one or more files that may belong to other
 * packages (see list below). You can use a command such as `portageq
 * owners / <filename>` to identify the installed package that owns a
 * file. If portageq reports that only one package owns a file then do
 * NOT file a bug report. A bug report is only useful if it identifies at
 * least two or more packages that are known to install the same file(s).
 * If a collision occurs and you can not explain where the file came from
 * then you should simply ignore the collision since there is not enough
 * information to determine if a real problem exists. Please do NOT file
 * a bug report at http://bugs.gentoo.org unless you report exactly which
 * two packages install the same file(s). See
 * http://wiki.gentoo.org/wiki/Knowledge_Base:Blockers for tips on how to
 * solve the problem. And once again, please do NOT file a bug report
 * unless you have completely understood the above message.
 * 
 * package sys-boot/grub-9999-r1 NOT merged
 * 
 * Detected file collision(s):
 * 
 * 	/usr/share/info/dir
 * 
 * Searching all installed packages for file collisions...
 * 
 * Press Ctrl-C to Stop
 * 
 * None of the installed packages claim the file(s).
 * 
 * Package 'sys-boot/grub-9999-r1' NOT merged due to file collisions. If
 * necessary, refer to your elog messages for the whole content of the
 * above message.

real	0m4.424s
user	0m3.520s
sys	0m0.660s


This goes away if I remove /var/tmp/portage/sys-boot/grub-9999-r1/.installed
and rerun.
But I'm unsure if the error message makes sense, maybe it's a new issue.
Comment 5 abandoned account 2015-02-12 08:16:15 UTC
I am currently using this workaround:
f=$(LC_CTYPE=C LC_COLLATE=C "${grep_cmd}" --invert-match -E $'^( \x1b\[33;01m\*\x1b\[0m |\x1b\[31;01m \* \x1b\[39;49;00m)' "${PORTAGE_LOG_FILE}" | "${grep_cmd}" -E "${joined_msgs}")

original line was:
f=$(LC_CTYPE=C LC_COLLATE=C "${grep_cmd}" -E "${joined_msgs}" "${PORTAGE_LOG_FILE}")

file: /usr/lib/portage/python2.7/install-qa-check.d/90gcc-warnings
line:85 or so

And it looks like this(with the 12meg log file in place):

 * QA Notice: Package triggers severe warnings which indicate that it
 *            may exhibit random runtime failures.
 * /var/tmp/portage/sys-boot/grub-9999-r1/work/grub-9999/grub-core/disk/diskfilter.c:505:4: warning: implicit declaration of function ‘printf’ [-Wimplicit-function-declaration]
 * /var/tmp/portage/sys-boot/grub-9999-r1/work/grub-9999/grub-core/disk/diskfilter.c:532:5: warning: format ‘%u’ expects a matching ‘unsigned int’ argument [-Wformat=]
 * /var/tmp/portage/sys-boot/grub-9999-r1/work/grub-9999/grub-core/disk/diskfilter.c:532:5: warning: format ‘%u’ expects a matching ‘unsigned int’ argument [-Wformat=]

haven't tested it when the '*' are red(the 31 above), if they are, ever.
Comment 6 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2015-02-12 08:38:12 UTC
The issue is a known result of the design. I doubt it's worth fixing. Keeptemp/keepwork are not normal use conditions and running src_install() multiple times is not supported.
Comment 7 abandoned account 2015-02-12 15:31:07 UTC
The only reason I use keepwork and keeptemp is because, at this time, I don't know how else to keep the sourcecode in place while tinkering with the code(grub in this case) in the hopes of fixing some (grub)bug. I should probably read on how to use ebuilds.
Thanks.
Comment 8 Zac Medico gentoo-dev 2015-02-12 16:45:47 UTC
We could make it remove ${T}/logging/${EBUILD_PHASE} before it executes a particular phase. However, given the low-level nature of the ebuild(1) command, I think the existing behavior is fine. If you run the same phase multiple times without cleaning, then I think it's logical all of the elog messages to accumulate.
Comment 9 abandoned account 2015-02-13 18:37:56 UTC
Just to be clear, the problem is not that the C reported warnings accrue(as I understand is meant in Comment #8 ), but that those warnings reported in the QA Notice block (also)accrue. Since the .log file is kept, it makes sense that those C warnings accrue, but it doesn't make sense to re-report in the next QA block those warnings from all the previous QA blocks. (and they also look nested)

My workaround in Comment #5 completely disregards the warnings reported in all the previous QA Notice blocks from the .log, so the QA Notice block contains only those reported by C (or, to be accurate, any warnings that are not within the previous QA blocks from the log). 
 This means the C-reported warnings still accrue, but this is way better than having those in QA block also accrue - in this latter case you would have to spend a lot of time waiting for them to scroll up the screen when they are displayed. (or just remove the .log file after a few compilations I guess)

So, if I get 2 warnings in the QA Notice block, after 1st time compilation, and I don't clear the log for the next 13 compilations, then on the 14th compilation the QA Notice block will show me about 2^14 or 16384 warnings on screen, which will take a while to display. With the workaround, supposedly I'll only see 2*14 or 28. 

Sorry for the noise, I just wanted to make sure I was somewhat clearer, because it seemed to me this can be misinterpreted in the 2 ways I've just attempted to describe in the first paragraph.

That's all from me:)
Comment 10 abandoned account 2015-02-13 18:44:02 UTC
have to update it to make sure those env vars are passed to the second invocation of grep too

f=$(LC_CTYPE=C LC_COLLATE=C "${grep_cmd}" --invert-match -E $'^( \x1b\[33;01m\*\x1b\[0m |\x1b\[31;01m \* \x1b\[39;49;00m)' "${PORTAGE_LOG_FILE}" | LC_CTYPE=C LC_COLLATE=C "${grep_cmd}" -E "${joined_msgs}"


because this says they previously didn't:
$ A=1 bash -c 'echo $A'|bash -c 'cat;echo $A.'
1
.

so this works:
$ A=1 bash -c 'echo $A'|A=2 bash -c 'cat;echo $A.'
1
2.
Comment 11 SpanKY gentoo-dev 2015-05-31 05:18:38 UTC
(In reply to Michał Górny from comment #6)

err, running `ebuild ... install` multiple times is def supported.  this shows up unrelated to keepwork/noclean.