Skip to content

fix(reactive_scripts_editor): make Python embedding opt-in to unblock Linux marketplace install#83

Merged
facontidavide merged 3 commits into
mainfrom
fix/reactive-scripts-editor-disable-python-fallback
May 12, 2026
Merged

fix(reactive_scripts_editor): make Python embedding opt-in to unblock Linux marketplace install#83
facontidavide merged 3 commits into
mainfrom
fix/reactive-scripts-editor-disable-python-fallback

Conversation

@pabloinigoblasco
Copy link
Copy Markdown
Contributor

Summary

The v1.4.2 marketplace artifact of toolbox_reactive_scripts_editor 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 PR is the pragmatic unblocker so Linux users can install the plugin from the marketplace today.

Approach

Make Python embedding compile-time optional.

  • New CMake option PJ_REACTIVE_ENABLE_PYTHON, defaults to OFF.
  • With Python disabled 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 PJ_REACTIVE_ENABLE_PYTHON=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.

Files

File Change
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.21.4.1 — the Python-disabled build is functionally equivalent to the pre-Python release.

Total: +111 / -54 across 3 files.

Test plan

  • Build with default options (no PJ_REACTIVE_ENABLE_PYTHON): plugin links cleanly, ldd shows no libpython NEEDED entry, dlopen succeeds on a clean Ubuntu without libpython3.10 installed.
  • Build with PJ_REACTIVE_ENABLE_PYTHON=ON: Python radio active, Python scripts run as before.
  • Dialog: Python radio is disabled (greyed out) in default build; clicking it does not toggle language_.
  • Restored config with language=python: dialog falls back to Lua, no crash on tick or execute.

… 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).
…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.
@facontidavide facontidavide merged commit edb3008 into main May 12, 2026
3 checks passed
@facontidavide facontidavide deleted the fix/reactive-scripts-editor-disable-python-fallback branch May 12, 2026 12:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants