fix(reactive_scripts_editor): make Python embedding opt-in to unblock Linux marketplace install#83
Merged
facontidavide merged 3 commits intoMay 12, 2026
Conversation
… Linux marketplace install The v1.4.2 marketplace artifact carried a NEEDED dependency on the libpython present on the CI runner (Ubuntu 22.04 ships libpython3.10), so the plugin failed to dlopen on user machines without that exact runtime installed. The underlying discovery bug (pybind11's bundled FindPythonLibsNew hijacks the Python lookup and ignores the dependency manager's cpython package) is documented separately and not addressed here. This change makes Python embedding compile-time optional. New CMake option PJ_REACTIVE_ENABLE_PYTHON defaults to OFF: the build links no libpython, ships no Python stdlib, and the dialog renders the Python radio as disabled so Lua remains the only callable backend. Set the option to ON for local developer builds where Python is known to be available. UI behaviour with Python disabled: - Language radio: "Python" disabled, "Lua" remains active. - onToggled: rejects late "radio_python" checked events (e.g. from a restored config) so language_ stays on lua. - onTick validation: returns a Lua-only message when language_ is python. - executeScript dispatch: returns an explicit "Python not available in this build" error instead of crashing. Contents: - toolbox_reactive_scripts_editor/CMakeLists.txt: gate libpython linking and Python stdlib install behind PJ_REACTIVE_ENABLE_PYTHON (default OFF). - toolbox_reactive_scripts_editor/reactive_script_editor.cpp: disable Python radio in dialog, reject late checked events, narrow validation/execute paths to Lua when Python is unavailable at build time. - toolbox_reactive_scripts_editor/manifest.json: version 1.4.2 -> 1.4.1 (Python-disabled build is functionally equivalent to the pre-Python release).
2 tasks
…allback Resolves format conflicts from PR #84 (chore: apply clang-format). The reactive_script_editor.cpp conflicts all sit on lines where PR #83 wraps Python-specific code in #ifdef PJ_REACTIVE_HAS_PYTHON; resolved by keeping PR #83's semantic version (the whole point of the PR) and relying on the prior chore commit to align everything else with main's formatting.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The v1.4.2 marketplace artifact of
toolbox_reactive_scripts_editorcarried a NEEDED dependency on thelibpythonpresent on the CI runner (Ubuntu 22.04 shipslibpython3.10), so the plugin failed todlopenon user machines without that exact runtime installed.The underlying discovery bug —
pybind11's bundledFindPythonLibsNewhijacks the Python lookup and ignores the dependency manager's cpython package — is documented separately and not addressed here. This PR is the pragmatic unblocker so Linux users can install the plugin from the marketplace today.Approach
Make Python embedding compile-time optional.
PJ_REACTIVE_ENABLE_PYTHON, defaults to OFF.libpython, ships no Python stdlib, and the dialog renders the Python radio as disabled so Lua remains the only callable backend.PJ_REACTIVE_ENABLE_PYTHON=ONfor local developer builds where Python is known to be available.UI behaviour with Python disabled
onToggled: rejects lateradio_pythonchecked events (e.g. from a restored config) solanguage_stays onlua.onTickvalidation: returns a Lua-only message whenlanguage_is python.executeScriptdispatch: returns an explicit"Python not available in this build"error instead of crashing.Files
toolbox_reactive_scripts_editor/CMakeLists.txtlibpythonlinking and Python stdlib install behindPJ_REACTIVE_ENABLE_PYTHON(default OFF).toolbox_reactive_scripts_editor/reactive_script_editor.cpptoolbox_reactive_scripts_editor/manifest.json1.4.2→1.4.1— the Python-disabled build is functionally equivalent to the pre-Python release.Total: +111 / -54 across 3 files.
Test plan
PJ_REACTIVE_ENABLE_PYTHON): plugin links cleanly,lddshows nolibpythonNEEDED entry,dlopensucceeds on a clean Ubuntu withoutlibpython3.10installed.PJ_REACTIVE_ENABLE_PYTHON=ON: Python radio active, Python scripts run as before.language_.language=python: dialog falls back to Lua, no crash on tick or execute.