itch icon indicating copy to clipboard operation
itch copied to clipboard

Out of date Mac sandbox documentation and unexpected blocked behaviors (aiohttp and afplay)

Open robclewley opened this issue 4 months ago • 0 comments

I succeeded in using butler to deploy my (draft) downloadable pygame app using your launcher, which has been successfully built into a .app using nuitka.

My game is intended to work on PC and Mac (Intel and Apple Silicon). I'm testing on an M1 Pro Macbook pro running Ventura 13.6.7 and an Intel MBP running Monterey 12.6.8, with the latest itch application 26.1.9. In my itch application settings, I do not have the "Enable itch.io sandbox" checked, despite the problems below!

The game runs and the UI works. But I want to be future-proof and support Mac sandboxing, and there are two issues I'd like help with.

  1. The macos-template.js mentioned at https://itch.io/docs/itch/using/sandbox/macos.html no longer exists in the main trunk, and I can't see anything similar to it. So I am not sure which policies are currently being applied to deployments with sandbox = true in the toml file, and that leads me to issue 2.

  2. When I have sandbox = true, two game features do not work that work when I run my build locally.

2a) One is that the theme tune does not play during start up on the M1 (but is OK on the Intel), possibly because I'm using a 3rd party sound utility, https://pypi.org/project/preferredsoundplayer/. I previously used pygame's system for the theme but the sound stutters so much while loading data and I can't seem to fix that. Pygame sounds work fine sandboxed or not. As it says in the github code here, MacOS uses the afplay module which is present OS X 10.5 and later. Are you able to comment on why the sandbox would prevent that from working, and whether there could be adjustments to the policy to allow it?

2b) My game is a hardcore coding / hacking simulator and puzzle game, and it launches a thread that runs a local webserver that hosts HTTP API endpoints on localhost for the player to control or automate parts of the game from their own code outside. I realize this is unusual, but it's central to the gameplay. I use aiohttp.web_runner and my logs show that there were errors starting it only with sandbox mode for both Mac systems. An endpoint to test liveness is 127.0.0.1:50505/status. Could you help me work through this please?

My app is named testingit and is currently private in draft mode while I'm testing, and my itch username is transient-dynamic. Feel free to look at that with and without the sandbox mode on, assuming you can edit the toml yourselves.

Thanks in advance!

robclewley avatar Oct 15 '24 01:10 robclewley