takeshich
### What happened? / 何が起きましたか? **【概要】** Pyxel v2.5.4以降で、`pyxel play ***.pyxapp` を使用してパッケージを実行した際の一時ディレクトリ(`/tmp/.pyxel/play/` 配下等)の命名規則が、従来の「プロセスID(PID)」から「`UUID`」もしくは「`PID_UUID`」の形式に変更されました。 (参考コミット: [2ba6319](https://github.com/kitao/pyxel/commit/2ba631953f45adbf301b73fe910578a85915e0ef)) v2.5.4以降の新しいバージョンで `pyxel play hogehoge.pyxapp` を実行するとこの新しい形式のディレクトリがTMPDIR上に残ります。 この状態のまま、古いバージョン(v2.5.4より前)の Pyxel を使って `pyxel play hogehoge.pyxapp` を実行しようとすると、古いバージョンのPyxelで `PID_UUID` の文字列を整数としてキャストできずにエラーとなり、ゲームが起動しない問題が発生します。 **【再現手順】** 1. Pyxel v2.5.4以降の環境で `pyxel play hogehoge.pyxapp` を実行し、終了する。 → これにより、`/tmp/.pyxel/play/` 配下に `PID_UUID` 形式の一時ディレクトリが作成され、残存します。 2. 古いバージョンのPyxel(v2.5.4より前)で `pyxel play hogehoge.pyxapp` を実行する。 **【期待される動作】** 古いPyxelの起動時クリーンアップ処理が、自身が理解できない形式のディレクトリ名(数値以外)をスキップ等の処理でやり過ごし、クラッシュせずにアプリケーションが起動すること。 **【実際の動作】** 古いバージョンのPyxelの起動時に、新しく作られたディレクトリ名(`PID_UUID`)をプロセスIDとして整数にキャスト`int()`しようとして `ValueError` 例外が発生し、ハンドリングされずにゲームの起動前にクラッシュします。 **【環境】** - OS: Linux (PortMaster環境等の複数のPyxelバージョンが混在するシステム) - Pyxel バージョン: v2.5.4以降と v2.5.3以前が同じシステム上で使用される環境 **【補足・影響範囲】** Linuxベースのレトロゲーム用OSで動く「PortMaster」というプラットフォームでは、ゲーム(ポート)ごとに異なるバージョンのPyxelランタイムが実行される仕様となっています。 そのため、ユーザーが「新しいPyxel(v2.9.5等)を使用するゲーム」を一度でも`pyxel play hogehoge.pyxapp`するとTMPDIR上の `.pyxel/play/` フォルダに `PID_UUID` のディレクトリが作られて残り、その後「古いPyxel(v2.2.8等)に依存する既存のゲーム」を`pyxel play hogehoge.pyxapp`しようとした際、起動できなくなるという影響が出ています。 現在、PortMaster側では個人的なテスト中ではありますが、新しいランタイムの起動スクリプトで `export TMPDIR="/tmp/.pyxel-v295up"` のように環境変数を上書きし、新しいPyxelの一時ディレクトリのパス自体を古いバージョンものと別にすることで回避しています。 既にリリース済みの古いバージョンのPyxelを修正することは難しいと承知しておりますが、新しいバージョンを遊ぶと古いバージョンが動かなくなるという非互換性・競合が生じている事実をご報告・共有させていただきます。 --- **[Overview]** Since Pyxel v2.5.4, the naming convention for temporary directories created under `/tmp/.pyxel/` (or `/tmp/.pyxel/play/`) when running a package via `pyxel play example.pyxapp` was changed from a simple "Process ID (PID)" to a "`UUID`" or "`PID_UUID`" format. (Reference commit: [2ba6319](https://github.com/kitao/pyxel/commit/2ba631953f45adbf301b73fe910578a85915e0ef)) When you run `pyxel play example.pyxapp` on a newer version (v2.5.4 or later), this new-format directory remains on TMPDIR. If you attempt to run `pyxel play example.pyxapp` using an older version of Pyxel (prior to v2.5.4) while in this state, the older Pyxel fails to cast the `PID_UUID` string to an integer, causing an error that prevents the game from starting. **[Steps to Reproduce]** 1. In an environment with Pyxel v2.5.4 or later, run `pyxel play example.pyxapp` and exit. -> This creates and leaves behind a `PID_UUID` formatted temporary directory under `/tmp/.pyxel/play/`. 2. Run `pyxel play example.pyxapp` using an older version of Pyxel (prior to v2.5.4). **[Expected Behavior]** The startup cleanup process of the older Pyxel version should gracefully skip or ignore directory names it cannot parse (non-numeric names), allowing the application to launch without crashing. **[Actual Behavior]** During the startup of the older version of Pyxel, it attempts to cast the newly created directory name (`PID_UUID`) into an integer as a Process ID using `int()`. This throws an unhandled `ValueError` exception, causing Pyxel to crash before the game starts. **[Environment]** - OS: Linux (Systems where multiple Pyxel versions coexist, such as PortMaster) - Pyxel Version: An environment where v2.5.4 or later and v2.5.3 or earlier are used on the same system. **[Additional Context / Impact]** On "PortMaster", a platform running on Linux-based retro gaming OSes, different games (ports) rely on their own specific versions of the Pyxel runtime. As a result, if a user runs `pyxel play example.pyxapp` on a game utilizing a newer Pyxel runtime (e.g., v2.9.5) even once, a `PID_UUID` directory is created and remains in the `.pyxel/play/` folder on TMPDIR. If they subsequently try to run `pyxel play example.pyxapp` for an existing legacy game relying on an older Pyxel runtime (e.g., v2.2.8), the legacy game becomes unplayable. Currently, as a personal test on PortMaster, we are working around this by overriding the environment variable in the launch script for newer runtimes (e.g., `export TMPDIR="/tmp/.pyxel-v295up"`) to separate the temporary directory path from the older versions. We understand that patching already released older versions of Pyxel is difficult. However, we wanted to report and share the fact that playing a newer version causes an incompatibility conflict that breaks older versions. ### OS Linux ### Pyxel Version / Pyxelバージョン _No response_ ### Python Version / Pythonバージョン 3.11 ### Screenshots or code (optional) / スクリーンショットやコード(任意) _No response_