Summary: | [GTK] Fails to build randomly when generating LLIntDesiredOffsets.h | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Alberto Garcia <berto> | ||||||
Component: | WebKitGTK | Assignee: | Nobody <webkit-unassigned> | ||||||
Status: | RESOLVED FIXED | ||||||||
Severity: | Normal | CC: | bugs-noreply, commit-queue, keith_miller, mark.lam, msaboff, saam | ||||||
Priority: | P2 | ||||||||
Version: | Other | ||||||||
Hardware: | Unspecified | ||||||||
OS: | Unspecified | ||||||||
Attachments: |
|
I found the problem. This is the line that fails: /usr/bin/ruby /«PKGBUILDDIR»/Source/JavaScriptCore/offlineasm/generate_offset_extractor.rb -I/«PKGBUILDDIR»/obj-i586-kfreebsd-gnu/DerivedSources/JavaScriptCore/ /«PKGBUILDDIR»/Source/JavaScriptCore/llint/LowLevelInterpreter.asm /«PKGBUILDDIR»/obj-i586-kfreebsd-gnu/DerivedSources/JavaScriptCore/LLIntDesiredOffsets.h This piece of code takes all -I arguments and puts them in the includeDirs list: def self.processIncludeOptions() while ARGV[0][/-I/] path = ARGV.shift[2..-1] if not path path = ARGV.shift end @@includeDirs << (path + "/") end end Since the last command-line arguments are not include directories but paths to files, the "while ARGV[0][/-I/]" condition will return false and the loop will exit. However in Debian the name of the build directory is generated randomly and it can happen to contain the "-I" string (e.g. '/tmp/build/webkit2gtk-IKCuVo'). The above code will treat that as an include dir and will continue looping. After all command-line arguments are parsed, ARGV[0] will be nil and ARGV[0][/-I/] will throw the "undefined method" error. Created attachment 277456 [details]
Patch
And here's the patch.
I think it's simple enough but someone with better ruby-fu than me please correct me if there's a better way to do it.
Comment on attachment 277456 [details]
Patch
I have no idea about ruby, but this looks simple enough.
Committed r200125: <http://trac.webkit.org/changeset/200125> |
Created attachment 273945 [details] Full build log (ppc64el) This error doesn't happen often, but I've seen it a few times. The last one with webkitgtk 2.10.8: [ 4%] Generating ../../DerivedSources/JavaScriptCore/LLIntDesiredOffsets.h cd /«PKGBUILDDIR»/obj-powerpc64le-linux-gnu/Source/JavaScriptCore && /usr/bin/ruby /«PKGBUILDDIR»/Source/JavaScriptCore/offlineasm/generate_offset_extractor.rb -I/«PKGBUILDDIR»/obj-powerpc64le-linux-gnu/DerivedSources/JavaScriptCore/ /«PKGBUILDDIR»/Source/JavaScriptCore/llint/LowLevelInterpreter.asm /«PKGBUILDDIR»/obj-powerpc64le-linux-gnu/DerivedSources/JavaScriptCore/LLIntDesiredOffsets.h /«PKGBUILDDIR»/Source/JavaScriptCore/offlineasm/parser.rb:64:in `processIncludeOptions': undefined method `[]' for nil:NilClass (NoMethodError) from /«PKGBUILDDIR»/Source/JavaScriptCore/offlineasm/generate_offset_extractor.rb:37:in `<main>' Source/JavaScriptCore/CMakeFiles/LLIntOffsetsExtractor.dir/build.make:86: recipe for target 'DerivedSources/JavaScriptCore/LLIntDesiredOffsets.h' failed make[3]: *** [DerivedSources/JavaScriptCore/LLIntDesiredOffsets.h] Error 1 make[3]: Leaving directory '/«PKGBUILDDIR»/obj-powerpc64le-linux-gnu' CMakeFiles/Makefile2:440: recipe for target 'Source/JavaScriptCore/CMakeFiles/LLIntOffsetsExtractor.dir/all' failed make[2]: *** [Source/JavaScriptCore/CMakeFiles/LLIntOffsetsExtractor.dir/all] Error 2 make[2]: *** Waiting for unfinished jobs.... This was built with make -j4. I'm attaching the full build log.