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

Broken libraries #109

Closed
qTich opened this issue Dec 13, 2023 · 4 comments · Fixed by #110
Closed

Broken libraries #109

qTich opened this issue Dec 13, 2023 · 4 comments · Fixed by #110

Comments

@qTich
Copy link
Contributor

qTich commented Dec 13, 2023

adb8b02 - breaks launching on android, i guess it affects all 3 libraries - pyjnius, pyobjus, steam

2023-12-13 06:01:20.698  2630-2780  python                  com.package              I  Traceback (most recent call last):
2023-12-13 06:01:20.698  2630-2780  python                  com.package              I    File "/data/user/0/com.package/files/main.py", line 260, in <module>
2023-12-13 06:01:20.699  2630-2780  python                  com.package              I      main()
2023-12-13 06:01:20.699  2630-2780  python                  com.package              I    File "/data/user/0/com.package/files/main.py", line 256, in main
2023-12-13 06:01:20.699  2630-2780  python                  com.package              I      renpy.bootstrap.bootstrap(renpy_base)
2023-12-13 06:01:20.699  2630-2780  python                  com.package              I    File "renpy/bootstrap.py", line 321, in bootstrap
2023-12-13 06:01:20.699  2630-2780  python                  com.package              I    File "renpy/__init__.py", line 406, in import_all
2023-12-13 06:01:20.699  2630-2780  python                  com.package              I    File "renpy/loader.py", line 75, in <module>
2023-12-13 06:01:20.699  2630-2780  python                  com.package              I    File "lib/python3.9/android/__init__.py", line 1, in <module>
2023-12-13 06:01:20.699  2630-2780  python                  com.package              I    File "lib/python3.9/__init__.py", line 12, in <module>
2023-12-13 06:01:20.699  2630-2780  python                  com.package              I  ImportError: bad magic number in 'jnius.env': b'\xa7\r\r\n'
@mal
Copy link
Member

mal commented Dec 13, 2023

The magic number from renpy-8.2.0.23121103+nightly-sdk-ci/lib/python3.9/jnius/env.pyc is 61 0d 0d 0a.
The magic number from the python3.9 binary that ships with the same Ren'Py SDK matches:

>>> print(*('{:02x}'.format(x) for x in importlib.util.MAGIC_NUMBER))
61 0d 0d 0a

The a7 0d 0d 0a magic number (aka b'\xa7\r\r\n' from OP) is the magic number of py3.11.

Given the above, it seems unlikely that this behaviour was observed by building from a nightly SDK (if I'm incorrect in this, please provide the exact version). If resulting from your own builds, is it possible that you built the web version prior to building the android version?

@qTich
Copy link
Contributor Author

qTich commented Dec 13, 2023

The magic number from renpy-8.2.0.23121103+nightly-sdk-ci/lib/python3.9/jnius/env.pyc is 61 0d 0d 0a. The magic number from the python3.9 binary that ships with the same Ren'Py SDK matches:

>>> print(*('{:02x}'.format(x) for x in importlib.util.MAGIC_NUMBER))
61 0d 0d 0a

The a7 0d 0d 0a magic number (aka b'\xa7\r\r\n' from OP) is the magic number of py3.11.

Given the above, it seems unlikely that this behaviour was observed by building from a nightly SDK (if I'm incorrect in this, please provide the exact version). If resulting from your own builds, is it possible that you built the web version prior to building the android version?

I think it's enough to build The Question on one of the last two nightly builds to see the problem.

@qTich
Copy link
Contributor Author

qTich commented Dec 13, 2023

Broken .pyc:

'/lib/python3.9/steamapi.pyc': b'\xa7\r\r\n',
'/lib/python3.9/jnius/signatures.pyc': b'\xa7\r\r\n',
'/lib/python3.9/jnius/reflect.pyc': b'\xa7\r\r\n'

@mal
Copy link
Member

mal commented Dec 13, 2023

Bytecode generated for the web version was leaking (pseudo-randomly due to glob order), a more targeted filter should ensure we always get the correct files.

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

Successfully merging a pull request may close this issue.

2 participants