Closed CarlGao4 closed 7 months ago
Adding scipy through the a-Shell-commands mechanism is not possible: scipy needs to be integrated with the existing Python in a-Shell, so it would have to be using native Arm64 binaries, not WebAssembly. Native Arm64 binaries have to be present in the app when the app is being reviewed by Apple, so they have to be present at install time. It's technically possible (after all, Scipy is already integrated with Carnets-Jupyter, and a-Shell shares a lot of code with Carnets), but it would significantly increase the size of the app. It will be done, but not immediately.
I have another idea. Though adding binaries is not allowed in iOS apps, adding dylib seems possible. Last time I manually installed torch (built for M1 Mac) on iPad and the error is that the dylib is built for macOS but not iPadOS. Maybe we can use numpy as a test, by building a NumPy wheel and install it in a-Shell mini. If it succeeds, then we can open a new PyPI repo and use it to host installable Python packages
I'm afraid I already tried that. You can add a dynamic library, but you cannot open it. You can only open a dynamic library if:
$APPDIR/Frameworks
, which is a directory that can only be accessed at install time, not after that. What if it is a symbolic link? I mean, we just put a symbolic link in the place it could be opened, pointing to a path which does not exist, and it would be available once the user has installed it
Symbolic links are forbidden inside the entire $APPDIR
directory (I know this because I accidentally left one at some time, and the app was summarily rejected). There is also the fact that you do not know in advance the position of $HOME
, which is the directory where you can write as you want, since it contains a UUID that is recomputed at each reboot (try pwd -P
to see what I mean).
You have to keep in mind that Apple has spent a lot of time perfecting their system against any kind of attack, so anything obvious is unlikely to work. And adding dynamic libraries to an existing app is useful for Python, but it's also exactly the kind of stuff an attacker would do.
I understand. Besides, I remember that scipy is not so big, like only 50MB?
Is it possible?