movableink / webkit

Unofficial mirror of the WebKit SVN repository
http://www.webkit.org/
68 stars 11 forks source link

build fails with ruby 3.2 #36

Open mwhudson opened 8 months ago

mwhudson commented 8 months ago

As seen in this build https://launchpad.net/ubuntu/+source/qtwebkit-opensource-src/5.212.0~alpha4-34build1/+build/27850896 generate_offset_extractor fails when invoked with Ruby 3.2:

cd "/<<PKGBUILDDIR>>/obj-x86_64-linux-gnu/Source/JavaScriptCore" && /usr/bin/ruby "/<<PKGBUILDDIR>>/Source/JavaScriptCore/offlineasm/generate_offset_extractor.rb" "-I/<<PKGBUILDDIR>>/obj-x86_64-linux-gnu/DerivedSources/JavaScriptCore/" "/<<PKGBUILDDIR>>/Source/JavaScriptCore/llint/LowLevelInterpreter.asm" "/<<PKGBUILDDIR>>/obj-x86_64-linux-gnu/DerivedSources/JavaScriptCore/LLIntDesiredOffsets.h"
/<<PKGBUILDDIR>>/Source/JavaScriptCore/offlineasm/parser.rb:587:in `block in parseSequence': undefined method `=~' for #<Annotation:0x00007f22c34e91d8 @codeOrigin=#<CodeOrigin:0x00007f22c34e9318 @sourceFile=#<SourceFile:0x00007f22c7d04ff8 @name=#<Pathname:/<<PKGBUILDDIR>>/Source/JavaScriptCore/llint/LowLevelInterpreter64.asm>, @fileNumber=3>, @lineNumber=511>, @type=:local, @string="Check if there are some unaligned slots we can use"> (NoMethodError)
    from /<<PKGBUILDDIR>>/Source/JavaScriptCore/offlineasm/parser.rb:586:in `loop'
    from /<<PKGBUILDDIR>>/Source/JavaScriptCore/offlineasm/parser.rb:586:in `parseSequence'
    from /<<PKGBUILDDIR>>/Source/JavaScriptCore/offlineasm/parser.rb:654:in `block in parseSequence'
    from /<<PKGBUILDDIR>>/Source/JavaScriptCore/offlineasm/parser.rb:586:in `loop'
    from /<<PKGBUILDDIR>>/Source/JavaScriptCore/offlineasm/parser.rb:586:in `parseSequence'
    from /<<PKGBUILDDIR>>/Source/JavaScriptCore/offlineasm/parser.rb:814:in `parseData'
    from /<<PKGBUILDDIR>>/Source/JavaScriptCore/offlineasm/parser.rb:818:in `parse'
    from /<<PKGBUILDDIR>>/Source/JavaScriptCore/offlineasm/parser.rb:780:in `block in parseSequence'
    from /<<PKGBUILDDIR>>/Source/JavaScriptCore/offlineasm/parser.rb:586:in `loop'
    from /<<PKGBUILDDIR>>/Source/JavaScriptCore/offlineasm/parser.rb:586:in `parseSequence'
    from /<<PKGBUILDDIR>>/Source/JavaScriptCore/offlineasm/parser.rb:625:in `block in parseSequence'
    from /<<PKGBUILDDIR>>/Source/JavaScriptCore/offlineasm/parser.rb:586:in `loop'
    from /<<PKGBUILDDIR>>/Source/JavaScriptCore/offlineasm/parser.rb:586:in `parseSequence'
    from /<<PKGBUILDDIR>>/Source/JavaScriptCore/offlineasm/parser.rb:814:in `parseData'
    from /<<PKGBUILDDIR>>/Source/JavaScriptCore/offlineasm/parser.rb:818:in `parse'
    from /<<PKGBUILDDIR>>/Source/JavaScriptCore/offlineasm/generate_offset_extractor.rb:68:in `<main>'

This patch (i.e. adding a =~ method to Annotation)

--- a/Source/JavaScriptCore/offlineasm/parser.rb
+++ b/Source/JavaScriptCore/offlineasm/parser.rb
@@ -145,6 +145,10 @@
         @type = type
         @string = string
     end
+
+    def =~(other)
+        false
+    end
 end

 #

seems to fix the build but I don't really understand why -- nothing in the ruby 3.2 release notes suggests to me that invoking the =~ method on Annotation should work in 3.1 (which is pretty clearly still happening in this case) but fail in 3.2. But I barely speak Ruby so I'm just guessing here.

mwhudson commented 7 months ago

Oh upstream webkit fixed this in 2020 https://github.com/WebKit/WebKit/commit/c7d19a492d97f9282a546831beb918e03315f6ef