Page MenuHomeWildfire Games

Tentative support for building sm91 with py3.12
Needs ReviewPublic

Authored by s0600204 on Dec 31 2023, 10:34 PM.
This revision needs review, but there are no reviewers specified.

Details

Reviewers
None
Trac Tickets
#6895
Summary

As title, this revision attempts to patch the spidermonkey tarball to permit it to build using python 3.12.

This means updating various instances of vendored python package six (one copy vendored by spidermonkey directly, one copy vendored by urllib3, one copy vendored by virtualenv, and various copies vendored in the instances of urllib3 vendored inside the pip wheels vendored by virtualenv).

The sequence also replaces some (but not all) instances of distutils used within the build process. Essentially as few as possible to get this to build. Seriously: distutils is used a lot.

I tried to put this together in such a way as to hopefully make adapting this to work on ESR102 easier than it could be otherwise.

Yes, I know this is a mess. Looking at it makes me feel uncomfortable, and I realise I'm probably going to get flak for certain aspects of it. I figured it was worth sharing if only to show that it's possible. If anyone wishes to take this and clean it up - feel free.

Test Plan

Attempt to build spidermonkey on a system with python 3.12

Make sure it still builds with earlier python versions.

Event Timeline

s0600204 created this revision.Dec 31 2023, 10:34 PM
s0600204 created this object with visibility "All Users".
Owners added a subscriber: Restricted Owners Package.Dec 31 2023, 10:34 PM

Successful build - Chance fights ever on the side of the prudent.

Link to build: https://jenkins.wildfiregames.com/job/vs2015-differential/8671/display/redirect

Build failure - The Moirai have given mortals hearts that can endure.

builderr-debug-macos.txt
fatal errorfatal error: fatal error: fatal errorfile '/Users/wfg/Jenkins/workspace/macos-differential/build/workspaces/gcc/../../../libraries/source/spidermonkey/include-unix-debug/jspubtd.h' has been modified since the precompiled header 'obj/simulation2_Debug/precompiled.h.gch' was built
: : file '/Users/wfg/Jenkins/workspace/macos-differential/build/workspaces/gcc/../../../libraries/source/spidermonkey/include-unix-debug/jspubtd.h' has been modified since the precompiled header 'obj/simulation2_Debug/precompiled.h.gch' was builtfile '/Users/wfg/Jenkins/workspace/macos-differential/build/workspaces/gcc/../../../libraries/source/spidermonkey/include-unix-debug/jspubtd.h' has been modified since the precompiled header 'obj/simulation2_Debug/precompiled.h.gch' was builtnote: please rebuild precompiled header 'obj/simulation2_Debug/precompiled.h.gch'


file '/Users/wfg/Jenkins/workspace/macos-differential/build/workspaces/gcc/../../../libraries/source/spidermonkey/include-unix-debug/jspubtd.h' has been modified since the precompiled header 'obj/simulation2_Debug/precompiled.h.gch' was built
notenote: please rebuild precompiled header 'obj/simulation2_Debug/precompiled.h.gch'
note: : please rebuild precompiled header 'obj/simulation2_Debug/precompiled.h.gch'
please rebuild precompiled header 'obj/simulation2_Debug/precompiled.h.gch'
1 error generated.
1 error generated.
make[1]: *** [obj/simulation2_Debug/CCmpOverlayRenderer.o] Error 1
make[1]: *** Waiting for unfinished jobs....
make[1]: *** [obj/simulation2_Debug/CCmpParticleManager.o] Error 1
1 error generated.
make[1]: *** [obj/simulation2_Debug/CCmpPathfinder.o] Error 1
1 error generated.
make[1]: *** [obj/simulation2_Debug/CCmpAIManager.o] Error 1
make: *** [simulation2] Error 2

Link to build: https://jenkins.wildfiregames.com/job/macos-differential/7589/display/redirect

s0600204 requested review of this revision.Dec 31 2023, 11:41 PM
Stan added a subscriber: sera.Jan 1 2024, 12:26 PM
sera added a subscriber: wraitii.Jan 1 2024, 1:42 PM

The packaging tarball and the wheels could be hosted as a tarball like the mozjs tarball or bundled with it instead of committed to svn. Actually the mozjs tarball isn't pristine (subset of firefox tarball), @wraitii already runs autoconf first, so just plain updating vendored python packages doesn't seem that big of a leap anymore. Just let us name it mozjs-ps-91.13.1.tar.xz

If you update virtualenv you might also update to a later version to not require the Fedora patch and some distutils fixes:

https://github.com/pypa/virtualenv/commit/8da79db86d8a5c74d03667a40e64ff832076445e

guess you kept it at that version for ease of use in sm102 should we switch.

Mozilla later vendors looseversion:

https://phabricator.services.mozilla.com/D151062
https://phabricator.services.mozilla.com/D151064
https://phabricator.services.mozilla.com/D155919
bb added a subscriber: bb.Feb 22 2024, 1:52 PM

For some reason the tarball is not recognized as such by tar so had to extract it and retar it (this could very well be arcanist disliking anything but text files).

Kudos for allowing me to build the game again!

libraries/source/spidermonkey/patch.sh
67–70

For me (at Fedora 39) to get this to work I needed to change this

s0600204 changed the visibility from "All Users" to "Public (No Login Required)".Apr 25 2024, 7:31 PM
phosit added a subscriber: phosit.Mon, May 20, 5:35 PM

I can't decompress packaging-23.2.tar.gz:

gzip -d packaging-23.2.tar.gz
gzip: packaging-23.2.tar.gz: unexpected end of file

phosit added a comment.EditedSat, May 25, 9:20 PM

I had to get packaging-23.2.tar.gz from https://github.com/pypa/packaging/releases and the whl files from their respective https://pypi.org site.

Now it builds. Thank you.