From 280238bbd7ac7d6197b47b8dfb45ac1f508f2bcc Mon Sep 17 00:00:00 2001 From: pc-heini Date: Tue, 16 Jun 2026 03:43:59 +0200 Subject: [PATCH] Point O3DE's engine-path resolution at the read-only engine root With the non-editable o3de install, the package lives in the per-user venv, so manifest.get_this_engine_path() (which walks up from the package __file__) resolved into the venv and engine.json wasn't found -> "Failed to get engine info" / "Failed to initialize". O3DE has a built-in override for this immutable-install case: when SNAP and SNAP_BUILD are set, get_this_engine_path returns "$SNAP/$SNAP_BUILD". The wrapper now sets them to the engine root. Verified by launching with these vars set: the Project Manager opens with no engine.json errors. Co-Authored-By: Claude Opus 4.8 --- o3de-wrapper.sh | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/o3de-wrapper.sh b/o3de-wrapper.sh index b68fb23e..c754555f 100755 --- a/o3de-wrapper.sh +++ b/o3de-wrapper.sh @@ -37,6 +37,21 @@ export LD_LIBRARY_PATH="$(dirname "$O3DE_BIN"):${LD_LIBRARY_PATH}" PYTHON_SH=$(find "$O3DE_ROOT" -type f -path '*/python/python.sh' 2>/dev/null | head -n 1) GET_PYTHON=$(find "$O3DE_ROOT" -type f -path '*/python/get_python.sh' 2>/dev/null | head -n 1) if [ -n "$GET_PYTHON" ]; then + ENGINE_ROOT=$(dirname "$(dirname "$GET_PYTHON")") + + # O3DE's Python derives the engine path from the o3de package's __file__. That + # breaks with our non-editable install (the package lives in the per-user venv, + # not the engine tree), so engine.json is looked for under the venv and not + # found ("Failed to get engine info"). O3DE has a built-in override for exactly + # this immutable-install case: if SNAP and SNAP_BUILD are set, manifest.py's + # get_this_engine_path() returns "$SNAP/$SNAP_BUILD". Point them at the engine + # root. (Verified nothing else in O3DE - Python or the C++ binaries - reads + # these two vars, so there are no snap-specific side effects.) + SNAP=$(dirname "$ENGINE_ROOT") + SNAP_BUILD=$(basename "$ENGINE_ROOT") + export SNAP SNAP_BUILD + + # Bootstrap the per-user Python venv if needed (the GUI doesn't do it itself). if ! "$PYTHON_SH" --version >/dev/null 2>&1; then echo "O3DE: setting up the per-user Python environment." >&2 echo "O3DE: first launch downloads Python and can take several minutes..." >&2