-
Notifications
You must be signed in to change notification settings - Fork 41
Fix/spidermonkey-build: SpiderMonkey build system breaks on Python 3.11 #22
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
Conversation
…longer accepts 'U' in the file mode
see also: |
https://github.com/Distributive-Network/PythonMonkey/actions/runs/5084446135/jobs/9136751622 doesn't fail because it uses a cached SpiderMonkey built with Python 3.10 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
echo "Building spidermonkey" | ||
cd firefox-102.2.0/python/mozbuild/mozbuild | ||
# the build system breaks on Python 3.11 (`io.open()` no longer accepts 'U' in the file mode) | ||
sed -i 's/"rU"/"r"/g' util.py preprocessor.py action/process_define_files.py backend/base.py |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is awfully broad: you're better off with a tighter expression like
sed -i 's/\(io\.open(\)\([^,]*,\)\( *["']rU['"] *\)/\1\2 "r"/g'
sed -i 's/"rU"/"r"/g' util.py preprocessor.py action/process_define_files.py backend/base.py | ||
cd - | ||
cd firefox-102.2.0/js | ||
sed -i 's/bool Unbox/JS_PUBLIC_API bool Unbox/g' ./public/Class.h # need to manually add JS_PUBLIC_API to js::Unbox until it gets fixed in Spidermonkey |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Has a bug been filed with Mozilla? It should have been. A link to the bug should be in a comment here.
https://github.com/Distributive-Network/PythonMonkey/actions/runs/5084218550/jobs/9136227002#step:6:1102
https://docs.python.org/3/whatsnew/3.11.html#porting-to-python-3-11