RESOLVED FIXED Bug 130148
[GTK][CMAKE] build-webkit doesn't detect when the build fails
https://bugs.webkit.org/show_bug.cgi?id=130148
Summary [GTK][CMAKE] build-webkit doesn't detect when the build fails
Carlos Garcia Campos
Reported 2014-03-12 11:35:42 PDT
This is green in the bot http://build.webkit.org/builders/GTK%20Linux%2064-bit%20Release/builds/45543/steps/compile-webkit/logs/stdio PluginViewX11.cpp:(.text+0xb78): undefined reference to `void WTF::derefIfNotNull<_cairo>(_cairo*)' collect2: error: ld returned 1 exit status [100%] Built target WebKitPluginProcess ==================================================================== WebKit is now built (01m:48s). To run GtkLauncher with this newly-built code, use the "Tools/Scripts/run-launcher" script. ==================================================================== program finished with exit code 0 elapsedTime=108.171358
Attachments
Patch (2.74 KB, patch)
2014-04-15 17:36 PDT, Brendan Long
no flags
Patch (2.95 KB, patch)
2014-04-15 19:48 PDT, Brendan Long
no flags
Patch (4.00 KB, patch)
2014-04-16 13:04 PDT, Brendan Long
no flags
Patch (1.55 KB, patch)
2014-04-16 13:44 PDT, Brendan Long
no flags
Brendan Long
Comment 1 2014-04-15 16:34:04 PDT
This is really annoying, because it's hard to tell where a build failed. I think I tracked this down to OptionsGTK.cmake: build_command(COMMAND_LINE_TO_BUILD) file(WRITE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/build.sh "#!/bin/sh\n" "${COMMAND_LINE_TO_BUILD} $@" ) build_command() by default gives you `make -i`, where `-i` is also known as `--ignore-errors`. See: http://www.gnu.org/software/make/manual/html_node/Errors.html#Errors http://www.cmake.org/cmake/help/v3.0/command/build_command.html I'm not exactly sure how to fix this yet. Maybe just strip "-i" from the COMMAND_LINE_TO_BUILD?
Martin Robinson
Comment 2 2014-04-15 16:37:04 PDT
I think this is by design, so that people looking at EWS and buildbot output can fix all errors in one change. We should try to track down how this is configured via CMake. After we understand this, there are a couple options: 1. Let users override the setting in their environment. 2. Conditionally enable the setting only for bots.
Brendan Long
Comment 3 2014-04-15 16:38:41 PDT
We should probably stop-on-error by default, and then have a --ignore-errors for bots, since I suspect most humans will want to see their errors immediately.
Brendan Long
Comment 4 2014-04-15 16:40:13 PDT
Oh, and the CMake documentation sounds like it always adds this for makefiles: > The trailing -- -i option is added for Makefile generators. This may just be poorly documented though.
Brendan Long
Comment 5 2014-04-15 16:58:19 PDT
I looked through CMake's source code since they documentation wasn't very helpful, and when generating the build_command, it has a "ignoreErrors" argument, which is unconditionally set to "true" in all cases where it gets called: std::string makecommand = this->Makefile->GetLocalGenerator() ->GetGlobalGenerator()->GenerateCMakeBuildCommand(target, configuration, "", true); With the signature: std::string cmGlobalGenerator::GenerateCMakeBuildCommand( const std::string& target, const std::string& config, const std::string& native, bool ignoreErrors) So if we want to remove the "-i", we'll have to do it manually. This works: string(REPLACE "-i" "" COMMAND_LINE_TO_BUILD ${COMMAND_LINE_TO_BUILD}) I'll look at adding some sort of option.
Brendan Long
Comment 6 2014-04-15 17:00:13 PDT
What if we just turn this off, then let people add --makeargs="-i" ?
Martin Robinson
Comment 7 2014-04-15 17:01:41 PDT
(In reply to comment #6) > What if we just turn this off, then let people add --makeargs="-i" ? The issue is with the bots.
Martin Robinson
Comment 8 2014-04-15 17:03:24 PDT
(In reply to comment #7) > (In reply to comment #6) > > What if we just turn this off, then let people add --makeargs="-i" ? > > The issue is with the bots. Sorry. My comment wasn't very useful. What I mean to say is that we should make sure the bots don't suddenly become less useful for developers on other platforms.
Brendan Long
Comment 9 2014-04-15 17:13:09 PDT
Yes, I mean: Can we make this not the default, then fix the bots to run build-webkit --makeargs="-i" ?
Martin Robinson
Comment 10 2014-04-15 17:14:57 PDT
(In reply to comment #9) > Yes, I mean: Can we make this not the default, then fix the bots to run build-webkit --makeargs="-i" ? I think we should shoot for making this not the default and fixing the bots all in one patch.
Brendan Long
Comment 11 2014-04-15 17:30:46 PDT
(In reply to comment #10) > (In reply to comment #9) > > Yes, I mean: Can we make this not the default, then fix the bots to run build-webkit --makeargs="-i" ? > > I think we should shoot for making this not the default and fixing the bots all in one patch. I have a patch mostly ready, but don't we want to turn this off for bots too, since right now they can't tell if they're failing?
Martin Robinson
Comment 12 2014-04-15 17:32:50 PDT
I guess for the bots we really want to swap -i for -k.
Brendan Long
Comment 13 2014-04-15 17:36:30 PDT
Brendan Long
Comment 14 2014-04-15 17:49:16 PDT
Comment on attachment 229420 [details] Patch I just realized that the string replace for -i really needs a comment. I'll fix it soon.
Martin Robinson
Comment 15 2014-04-15 18:06:34 PDT
(In reply to comment #14) > (From update of attachment 229420 [details]) > I just realized that the string replace for -i really needs a comment. I'll fix it soon. Looks good so far, though the EWS probably also needs a fix.
Brendan Long
Comment 16 2014-04-15 19:48:59 PDT
Created attachment 229424 [details] Patch Ok, now there's a nice comment.
Martin Robinson
Comment 17 2014-04-16 06:22:37 PDT
Comment on attachment 229424 [details] Patch Looks great, but do you think you could also fix this for the EWS?
Brendan Long
Comment 18 2014-04-16 11:22:55 PDT
(In reply to comment #17) > (From update of attachment 229424 [details]) > Looks great, but do you think you could also fix this for the EWS? Do you know where the EWS build scripts are? I had assumed it was the same as the other build bots.
Martin Robinson
Comment 19 2014-04-16 12:44:28 PDT
I think it's in Tools/Scripts/webkitpy/common/config/ports.py
Brendan Long
Comment 20 2014-04-16 13:04:34 PDT
Created attachment 229473 [details] Patch How's this? I changed ports.py so the default makeargs still apply, even if MAKEARGS is set. The defaults are listed first so they can be overridden.
Brendan Long
Comment 21 2014-04-16 13:11:52 PDT
Comment on attachment 229473 [details] Patch Hm it's trying to add --keep-going to ninja. I'll look into that..
Brendan Long
Comment 22 2014-04-16 13:22:03 PDT
So if the build bots are running ninja, then this won't work anyway. It only happens with GNU make apparently. We can solve part of the problem by adding ninja-build to the dependencies.
Martin Robinson
Comment 23 2014-04-16 13:23:00 PDT
Comment on attachment 229473 [details] Patch You probably want to put this into GtkWK2Port and attach it onto the result of the calling the parent's method.
Brendan Long
Comment 24 2014-04-16 13:44:44 PDT
Created attachment 229476 [details] Patch Here's a simpler one that just replaces -i with -k, so at least the error code will be correct. I'm going to look into adding ninja-build to install-dependencies. CMake doesn't do this with ninja by default, so if we can auto-install ninja then most peope won't see this unless they want it.
WebKit Commit Bot
Comment 25 2014-04-16 14:24:32 PDT
Comment on attachment 229476 [details] Patch Clearing flags on attachment: 229476 Committed r167385: <http://trac.webkit.org/changeset/167385>
WebKit Commit Bot
Comment 26 2014-04-16 14:24:38 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.