Bug 1217465 - RFE: Can Koji be made to grab the logs that mock collected from a tree it has just built or failed to build?
Summary: RFE: Can Koji be made to grab the logs that mock collected from a tree it has...
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Fedora
Classification: Fedora
Component: koji
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Dennis Gilmore
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On: 1190763
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-04-30 12:35 UTC by David Howells
Modified: 2015-05-01 13:36 UTC (History)
10 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of: 1190763
Environment:
Last Closed: 2015-04-30 18:12:43 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description David Howells 2015-04-30 12:35:14 UTC
+++ This bug was initially created as a clone of Bug #1190763 +++

Description of problem:

It would be really handy if koji grabbed logs from a failed build (and even successful builds) and put them somewhere they could be accessed - even if it was only available for a day or so.

As to how to find the logs, just scraping all files matching *.log from the build tree into a tarball would probably be a good start.

I have two examples of where this might be useful:

 (1) gcc-5 dumps a whole chunk of tar'd, bzip'd and uuencoded testing logs to
     stdout because it has nowhere else to put them.

 (2) I'm seeing a config failure building cross-gcc on ARM that doesn't occur
     on x86_64 or i686 - but it happens in koji where I can't get at the
     config.log to see what happened.

Ideally, rpmbuild would gather the logs and put them somewhere koji or someone running rpmbuild by hand could get them, perhaps in a tarball.

--- Additional comment from Dennis Gilmore on 2015-02-09 10:46:44 EST ---

koji takes the output of mock.  so to fix this we would need mock to output things like config.log or the files generated by gcc when it gives an ICE.  I am reassigning the bug to mock as that is where the change will need to happen.

--- Additional comment from David Howells on 2015-02-16 08:17:37 EST ---

Apparently, it might be possible to use a mock plugin to capture the logs:

http://fedoraproject.org/wiki/Projects/Mock/Plugin/ChrootScan

--- Additional comment from Miroslav Suchý on 2015-02-16 08:58:38 EST ---

Reassigning back to koji per #2
However I highly recommend to first standardize (FPC?) which paths should be grabbed.

--- Additional comment from Miroslav Suchý on 2015-02-16 10:30:31 EST ---

I just find that this plugin was missing in mock due stupid mistake (missing line in Makefile).
It will be included in mock-1.2.8

--- Additional comment from David Howells on 2015-03-31 11:05:38 EDT ---

Could the build tree just be scanned for files matching a "*.log" pattern for starters?  That'd pick up the stuff left behind by configure sripts?

--- Additional comment from Dennis Gilmore on 2015-03-31 23:10:33 EDT ---

the requested behaviour should be mocks default behaviour on a failure. reassigning back to mock.

--- Additional comment from Miroslav Suchý on 2015-04-22 11:08:16 EDT ---

Done in commit:
* 134820a chroot_scan: implement "only_failed" option [RHBZ#1190763]

chroot_scan is now extended by option 'only_failed'

# config_opts['plugin_conf']['chroot_scan_enable'] = False
# config_opts['plugin_conf']['chroot_scan_opts'] = {
## Regexp of files which should be copied from buildroot to resultdir.
#    'regexes': [ "core(\.\d+)?", "\.log$",],
## If set to True files are copied only if build failed.
#    'only_failed': True,
#}

If plugin is enabled (I keep it disabled by default, no change here) and you set "only_failed" to True (the default), then all regexes are coppied from chroot to resultdir.
It is up to Koji owners if they enable this plugin and set up regexes.
Please clone this BZ for Koji product if still interrested in.

--- Additional comment from Dennis Gilmore on 2015-04-22 20:16:42 EDT ---

There is a lot of benefit to getting the logs for all mock builds. getting config.log and .out files from /tmp when gcc gies internal compiler errors etc. it should be the default behaviour of mock and koji would just inherit it.

--- Additional comment from Fedora Update System on 2015-04-29 09:16:25 EDT ---

mock-1.2.8-1.fc22 has been submitted as an update for Fedora 22.
https://admin.fedoraproject.org/updates/mock-1.2.8-1.fc22

--- Additional comment from Fedora Update System on 2015-04-29 09:16:51 EDT ---

mock-1.2.8-1.fc21 has been submitted as an update for Fedora 21.
https://admin.fedoraproject.org/updates/mock-1.2.8-1.fc21

--- Additional comment from Fedora Update System on 2015-04-29 09:17:44 EDT ---

mock-1.2.8-1.fc20 has been submitted as an update for Fedora 20.
https://admin.fedoraproject.org/updates/mock-1.2.8-1.fc20

--- Additional comment from Fedora Update System on 2015-04-29 09:18:51 EDT ---

mock-1.2.8-1.el7 has been submitted as an update for Fedora EPEL 7.
https://admin.fedoraproject.org/updates/mock-1.2.8-1.el7

--- Additional comment from Fedora Update System on 2015-04-29 09:25:43 EDT ---

mock-1.2.8-1.el6 has been submitted as an update for Fedora EPEL 6.
https://admin.fedoraproject.org/updates/mock-1.2.8-1.el6

--- Additional comment from Dennis Gilmore on 2015-04-29 09:47:23 EDT ---

Plugin should be enabled by default. It should be mocks default behaviour and you shoudl find .out files in /tmp also as that is what is output when gcc has a internal compiler error.

--- Additional comment from Fedora Update System on 2015-04-29 15:18:34 EDT ---

Package mock-1.2.8-1.el7:
* should fix your issue,
* was pushed to the Fedora EPEL 7 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=epel-testing mock-1.2.8-1.el7'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-EPEL-2015-6057/mock-1.2.8-1.el7
then log in and leave karma (feedback).

--- Additional comment from David Howells on 2015-04-30 06:34:59 EDT ---

Do the saved logs just appear through koji now?

--- Additional comment from Miroslav Suchý on 2015-04-30 06:56:47 EDT ---

No. Koji have to enable it.
It is disabled by default for those reasons:
 * I hesitate to enable it by default as it is brand new code and not widely tested
 * lots of mock users are not interested in those logs, I would guess that majority of them

--- Additional comment from David Howells on 2015-04-30 07:38:16 EDT ---

Should I dup this bz for koji?

--- Additional comment from Miroslav Suchý on 2015-04-30 08:18:17 EDT ---

Yes, please.

Comment 1 Dennis Gilmore 2015-04-30 18:12:43 UTC
This needs to be the default mock behaviour. not something special enabled in koji.

Comment 2 David Howells 2015-04-30 18:26:53 UTC
(In reply to Dennis Gilmore from comment #1)
> This needs to be the default mock behaviour. not something special enabled
> in koji.

Yes, it will be fixed in mock - but unless koji then presents the logs grabbed by mock to the user, there's not a lot of point.  Will this happen automatically?  If so, fine; if not, koji will need a change too.

Comment 3 Miroslav Suchý 2015-05-01 13:36:28 UTC
> unless koji then presents the logs grabbed by mock to the user, there's not a lot of point.

+1
you just need add one line to you mock config. 
More working be on presentation layer.


Note You need to log in before you can comment on or make changes to this bug.