Skip to content

Downgrading from 0.4.7 to 0.4.5 worked #53

Closed as not planned
Closed as not planned

Description

@GabeThe21stGamer

I have been having trouble making a Mac or iOS app since I updated to 0.4.7. It always gave me [RED] Direct RomFS image builds require Python 3.12 or newer even though I had 3.15 installed (and never had this error prior to upgrading to 0.4.7). I downgraded back to 0.4.5 and it worked! Here's the Gemini-assisted explanation if that's ok (sorry I'm not at that technological level yet).

"What happened came down to a mismatch between how the GUI app was updated and how it interacts with macOS system paths.

Here is a breakdown of what went wrong and why rolling back to version 0.4.5 solved it:

  1. Hardcoded Python Path in Version 0.4.7
    In version 0.4.7, the developers updated the app's internal Swift code to call /usr/bin/python3 directly when executing background terminal scripts (such as build_ipa_from_nsp.py).

Why this broke: On macOS, /usr/bin/python3 points to Apple's built-in Command Line Tools Python stub (which is typically Python 3.9 or 3.10).

When the script ran, build_ipa_from_nsp.py checked its runtime environment, saw it was executing on Apple's system Python (3.9/3.10), and immediately threw the error:

[RED] Direct RomFS image builds require Python 3.12 or newer

  1. Why macOS GUI Apps Ignore Terminal Settings
    You had installed Python 3.12 via Homebrew and unlinked 3.15, which fixed your terminal environment. However, macOS GUI applications (.app bundles launched from Finder) do not inherit environment variables or PATH settings from your terminal shell (zsh).

Even though running python3 in your terminal opened Python 3.12, clicking the NS Port Builder GUI app launched it in a isolated environment where it could only see standard system binaries—meaning it kept calling /usr/bin/python3.

  1. Why Changing the Script Didn't Help
    When we modified the script or re-linked Python using Homebrew, the 0.4.7 GUI app binary continued to pass the exact literal string /usr/bin/python3 as the argument to execute the script process, bypassing any local environment configurations or symlinks.

  2. Why Rolling Back to 0.4.5 Fixed It
    Version 0.4.5 uses a flexible lookup mechanism. Instead of hardcoding /usr/bin/python3, version 0.4.5 scans standard paths (including Homebrew's /opt/homebrew/bin/python3 or /opt/homebrew/opt/python@3.12/bin/python3) and selects the first Python interpreter that satisfies the version check and has the required modules installed.

Once you went back to 0.4.5, it detected your clean Python 3.12.16 Homebrew setup instantly!"

Activity

  1. LNPANDY commented on Oct 27, 2026

    @LNPANDY
    Owner

    You are right, and your Gemini summary is close enough to be useful — but the cause is simpler than a hardcoded path, and it is my bug either way. Fixed in 1a5b7f65.

    What actually happened. Two faults, both in the Mac app:

    1. The interpreter floor was wrong. The app checked for Python ≥ 3.9, but the build script itself refuses anything below 3.12 (build_ipa_from_nsp.py:1911, the exact message you saw). So a 3.9 interpreter passed the app's check, the app handed it to the script, and the script rejected it. The comment right above that constant even said 3.12 — the value was simply never raised.
    2. A race made it worse. The app finds a usable interpreter on a background queue when it opens. If you went straight to Build game, that had not finished, and the fallback was the literal /usr/bin/python3 — Apple's 3.9. startBuild now does the lookup itself, so the choice cannot depend on timing.

    So it is not that 0.4.5 "scanned and 0.4.7 hardcoded": both versions scan. 0.4.7 is when the RomFS image step began requiring 3.12, which is what turned the too-low floor into a visible failure. Your 3.15 was always there and always usable; the app just never got as far as asking it.

    What this does not explain, and I want to be straight about it: you said 0.4.5 worked. If your 0.4.5 picked a 3.12+ interpreter, it means the candidate list found Homebrew's Python — which the same code does today. The difference was the floor, so both statements can be true at once.

    To confirm on your machine, the next build from main will either build or say plainly that no interpreter ≥ 3.12 was found. If it still refuses, run this and paste the output — it tells us which interpreters exist and whether they have the packages:

    for p in /opt/homebrew/bin/python3 /usr/local/bin/python3 /usr/bin/python3; do
      [ -x "$p" ] && echo "$p -> $("$p" -V 2>&1)"; done

    Also worth knowing: PR #60 merged today makes the app fast-forward its own checkout when it opens (only on main, only with no local changes, only when no build is running). That addresses the other half of your report without you having to press Pull — a checkout that is days behind builds with tools that have already been fixed.

  2. GabeThe21stGamer commented on Oct 28, 2026

    @GabeThe21stGamer
    Author

    Hi! Just a quick update, I still encountered the error on 0.5.0. It had something to do with the romfs image file in the ~/Library. A Gemini search helped me by telling me to put this code

    "Bash

    1. Remove the old/misconfigured virtual environment used by the app
      rm -rf ~/Library/Application\ Support/NS\ Port\ Builder/venv

    2. Create a fresh virtual environment using your Homebrew Python 3.12
      /opt/homebrew/opt/python@3.12/libexec/bin/python3 -m venv ~/Library/Application\ Support/NS\ Port\ Builder/venv

    3. Upgrade pip inside the new environment
      ~/Library/Application\ Support/NS\ Port\ Builder/venv/bin/python3 -m pip install --upgrade pip

    4. Install all required build dependencies required by the builder scripts~/Library/Application\ Support/NS\ Port\ Builder/venv/bin/python3 -m pip install lz4 capstone f"

    (EDIT: I removed the hashtags/pound signs from the numbers)

    and it worked. Just wanted to update you just in case it might be helpful to other players as well.

    PS, 0.5.0 is running smoothly and as expected. It gave me an iPad app. :)

  3. v0lumehi commented on Oct 28, 2026

    @v0lumehi
    Collaborator

    Same cause as #75 (the app handed a 3.9 Python to a script that needs 3.12). Fixed in 1a5b7f6 (v0.4.9). Closing as a duplicate of #75. Please use 0.5.0.

  4. added
    duplicate
    on Oct 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    duplicate

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions