Skip to content

build fails with ruby 3.2 #36

@mwhudson

Description

@mwhudson

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions