Skip to content

fix(launcher): bypass broken shebang by invoking bin/odoo through python#68

Merged
trisdoan merged 4 commits intomainfrom
hotfix/fix-launcher
Mar 26, 2026
Merged

fix(launcher): bypass broken shebang by invoking bin/odoo through python#68
trisdoan merged 4 commits intomainfrom
hotfix/fix-launcher

Conversation

@trisdoan
Copy link
Copy Markdown
Collaborator

@trisdoan trisdoan commented Mar 19, 2026

Root Cause

uv pip install -e writes a broken shebang in bin/odoo pointing to a temporary build directory (e.g. ~/.cache/uv/builds-v0/.tmpdJaf0T/bin/python) that is deleted after installation. The launcher script called odoo directly, hitting this broken interpreter.

Fix

Replace CMD=("odoo") with CMD=("python" "$VENV_DIR/bin/odoo") in the launcher template. This runs the existing bin/odoo script through the venv's Python interpreter, bypassing the broken shebang while preserving each Odoo version's own import logic (which differs between v12 and v19).

@trisdoan trisdoan marked this pull request as draft March 19, 2026 11:15
@trisdoan trisdoan force-pushed the hotfix/fix-launcher branch 4 times, most recently from 53cc299 to f5e17c7 Compare March 20, 2026 05:41
@trisdoan trisdoan changed the title fix(launcher): use python -c to invoke Odoo instead of bin/odoo script fix(launcher): bypass broken shebang by invoking bin/odoo through python Mar 20, 2026
@trisdoan trisdoan force-pushed the hotfix/fix-launcher branch 11 times, most recently from e32eb61 to 107841e Compare March 24, 2026 03:38
uv pip install -e writes a temporary build path as the shebang in
bin/odoo, which breaks after installation. Instead of calling bin/odoo
directly, run it via 'python $VENV_DIR/bin/odoo' to ignore the shebang
and use the venv's Python interpreter.
…ke master

Use get_odoo_version from odoo-addons-path to detect the actual Odoo
major version when the branch name is non-numeric (e.g. "master").
Previously the launcher was named odoo-vmaster instead of odoo-v19,
causing the e2e smoke test to fail with "command not found".

Bump odoo-addons-path dependency to >=1.2.0 for get_odoo_version.
@trisdoan trisdoan force-pushed the hotfix/fix-launcher branch from e8bc8ee to 98c1437 Compare March 25, 2026 03:07
@trisdoan trisdoan marked this pull request as ready for review March 25, 2026 03:28
@trisdoan trisdoan marked this pull request as draft March 25, 2026 04:04
The `master` branch doesn't follow the `X.0` pattern, so
`${version%%.*}` yields "master" instead of a numeric major.
Read the real major from release.py for master entries.
odoo-addons-path 1.2.0 always calls detect_codebase_layout() on the
CWD. In CI the CWD is the odoo-venv checkout (not an Odoo project),
causing exit 1 before odoo-venv create even runs. Pass the Odoo
source dir as the positional codebase argument so layout detection
succeeds.
@trisdoan trisdoan force-pushed the hotfix/fix-launcher branch from 98c1437 to 969362d Compare March 25, 2026 04:05
@trisdoan trisdoan marked this pull request as ready for review March 25, 2026 07:29
@trisdoan
Copy link
Copy Markdown
Collaborator Author

trisdoan commented Mar 25, 2026

NameError: name 'basestring' is not defined is fixed in #76

@trisdoan trisdoan requested a review from nilshamerlinck March 25, 2026 07:52
@trisdoan trisdoan merged commit 9e4946f into main Mar 26, 2026
34 of 36 checks passed
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