Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build fails with ruby 3.2 #36

Open
mwhudson opened this issue Mar 13, 2024 · 1 comment
Open

build fails with ruby 3.2 #36

mwhudson opened this issue Mar 13, 2024 · 1 comment

Comments

@mwhudson
Copy link

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
Copy link
Author

Oh upstream webkit fixed this in 2020 WebKit/WebKit@c7d19a4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant