#79 show compile message if mock fail
Closed: Invalid None Opened 11 years ago by misc.

Hi,

while reviewing 840707, mock was not able to compile the rpm. It would be IMHO nice to show the last lines of the build.log directly rather than a message saying "you should look at the file in this directory".


This bug is old, and need to be resolved.

My preliminary feelings about this is that f-r is not really intended to be run on a package which does not build in mock. Such a package is per definition not reviewable, and not really an issue for f-r.

From this perspective, it enough that f-r reports that package not builds.

Ergo: Unless further input, I think this should be closed as a wontfix.

When a package do not buld, the first thing you do is to look why, you do not say to the reporter "it doesn't build, I do not tell you why". So to me, that make sense to just follow the workflow, and try to give a hint. In fact, if one day, we manage to have a automated review of packages, that would be more important to have good reporting of the issue at hand.

And the request is tagged as enhancement, and it is just 3 months old. I do not see why it should be closed.

Agreed, I was to quick. Today, I closed #181 which is a variant of this RFE. The message today is an indirect INFO: stating the directory where one could find build.log. But build.log isn't even mentioned, and the info message is easily overlooked since it a few lines above the crash.

I'm still not that fond of printing the last lines of build.log; problem is what amount of output is needed. But a clear message pointing to build.log in direct connection with the "build failed" message is definitely needed.

Fix in 9719bf6 With this fix the last two lines of console output becomes (in red):

{{{
Build failed, build log in /home/leamas/tmp/FedoraReview/872909-rubygem-test-unit-rr/results/build.log
Error: 'Mock build failed' (logs in ~/.cache/fedora-review.log)
}}}

Hopefully, this means a better chance to handle the 'failed build' situation. Unless there is more input in this bug I intend to close it with this fix

EDIT: My English isn't that good.

Fix updated in 833d873. Now the last line, the only in red is

{{{
ERROR: 'mock build failed, see /home/leamas/tmp/FedoraReview/872909-rubygem-test-unit-rr/results/build.log
}}}

At last, I think this should be clear to users.

Well, while this would be fragile, i think doing grep -c error or something like that would take care of the build error for gcc. Maybe with a few regexp we an cover 90% of the error.

Just the example I used to test this is not that simple (BZ 872909, fails on F17) gives the following tail of build.log:

{{{
+ cd rubygem-test-unit-rr-1.0.2
+ unset DISPLAY
+ pushd ./usr/share/gems/gems/test-unit-rr-1.0.2
+ ruby -Ilib test/run-test.rb
/usr/share/rubygems/rubygems/dependency.rb:247:in to_specs': Could not find test-unit (>= 0) amongst [bigdecimal-1.1.0, io-console-0.3, json-1.6.5, rdoc-3.12] (Gem::LoadError) from /usr/share/rubygems/rubygems/dependency.rb:256:into_spec'
from /usr/share/rubygems/rubygems.rb:1231:in gem' from test/run-test.rb:29:in<main>'
RPM build errors:
error: Bad exit status from /var/tmp/rpm-tmp.QZqZ4q (%check)
Bad exit status from /var/tmp/rpm-tmp.QZqZ4q (%check)
Child return code was: 1
EXCEPTION: Command failed. See logs for output.
# ['bash', '--login', '-c', 'rpmbuild -bb --target i686 --nodeps builddir/build/SPECS/rubygem-test-unit-rr.spec']
Traceback (most recent call last):
File "/usr/lib/python2.7/site-packages/mockbuild/trace_decorator.py", line 70, in trace
result = func(args, *kw)
File "/usr/lib/python2.7/site-packages/mockbuild/util.py", line 353, in do
raise mockbuild.exception.Error, ("Command failed. See logs for output.\n # %s" % (command,), child.returncode)
Error: Command failed. See logs for output.
# ['bash', '--login', '-c', 'rpmbuild -bb --target i686 --nodeps builddir/build/SPECS/rubygem-test-unit-rr.spec']
LEAVE do --> EXCEPTION RAISED

}}}

A grep -i for 'errors' with some line of context could fix it, but I do think it would be to fragile. Better then to point to the logfile. In a GUI, we should display the complete log IMHO. But displaying this much of output inline might even be confusing and hide the basic fact that the mock build failed.

OTOH, I've been wrong once here already so...

Or?!

IRC discussion: If we could parse the output we could provide a more meaningful output. But this is a huge task, would need a separate library. Without parse possibilities the best way seems to leave this as-is.

That said, this is not an ideal solution.

This has popped up now and then, but without any feasible solution. Closing, please reopen if there is a realistic approach or a patch.

Login to comment on this ticket.

Metadata