2020-06-22 22:36:54 -04:00
|
|
|
|
. ./env_var.sh
|
2020-07-24 02:20:30 -04:00
|
|
|
|
EL_USER=${USER}
|
2020-06-22 22:36:54 -04:00
|
|
|
|
EL_HOME=$PWD
|
2025-05-05 04:43:13 -04:00
|
|
|
|
EL_HOME_ODOO="${EL_HOME}/odoo${EL_ODOO_VERSION}/odoo"
|
2020-06-22 22:36:54 -04:00
|
|
|
|
#EL_INSTALL_WKHTMLTOPDF="True"
|
|
|
|
|
|
#EL_PORT="8069"
|
|
|
|
|
|
#EL_LONGPOLLING_PORT="8072"
|
|
|
|
|
|
#EL_SUPERADMIN="admin"
|
2021-07-21 16:20:25 -04:00
|
|
|
|
#EL_CONFIG_FILE="${EL_HOME}/config.conf"
|
2020-06-22 22:36:54 -04:00
|
|
|
|
#EL_CONFIG="${EL_USER}"
|
|
|
|
|
|
#EL_MINIMAL_ADDONS="False"
|
|
|
|
|
|
#EL_INSTALL_NGINX="True"
|
2025-05-05 04:43:13 -04:00
|
|
|
|
FILE_INSTALLATION_VERSION=".repo/installed_odoo_version.txt"
|
2020-06-22 22:36:54 -04:00
|
|
|
|
|
2024-02-23 13:01:10 -05:00
|
|
|
|
Red='\033[0;31m' # Red
|
|
|
|
|
|
Color_Off='\033[0m' # Text Reset
|
|
|
|
|
|
|
2024-08-25 15:54:24 -04:00
|
|
|
|
# example, 3.7.8 will be 3.7 into PYTHON_VERSION_MAJOR
|
2025-05-05 04:43:13 -04:00
|
|
|
|
PYTHON_VERSION_MAJOR=$(echo "$EL_PYTHON_ODOO_VERSION" | sed 's/\.[^\.]*$//')
|
|
|
|
|
|
VENV_ERPLIBRE_PATH=$(cat "conf/python-erplibre-venv" | xargs)
|
|
|
|
|
|
VENV_ODOO_PATH=".venv.${EL_ERPLIBRE_VERSION}"
|
|
|
|
|
|
POETRY_ODOO_PATH=${VENV_ERPLIBRE_PATH}/bin/poetry
|
2025-07-14 03:44:48 -04:00
|
|
|
|
export WITH_POETRY_INSTALLATION=1
|
2020-07-29 18:13:22 -04:00
|
|
|
|
|
2026-07-27 23:57:04 -04:00
|
|
|
|
# Verbosité de l'installation Poetry : silencieuse (-q) par défaut, les logs
|
|
|
|
|
|
# détaillés (-vvv) reviennent avec la variable d'environnement EL_VERBOSE=1.
|
|
|
|
|
|
if [[ "${EL_VERBOSE:-0}" == "1" ]]; then
|
|
|
|
|
|
POETRY_VERBOSE="-vvv"
|
|
|
|
|
|
else
|
|
|
|
|
|
POETRY_VERBOSE="-q"
|
|
|
|
|
|
fi
|
|
|
|
|
|
|
2026-03-30 22:08:00 -04:00
|
|
|
|
# EL_PHASE controls which steps to execute. Used by install_locally_dev.sh
|
|
|
|
|
|
# for parallel installation — do not set manually unless you know what you do.
|
|
|
|
|
|
# all (default) – full install: setup + poetry phases
|
|
|
|
|
|
# setup – prereqs only: venvs, pip-erplibre, git-repo
|
|
|
|
|
|
# poetry – python packages: poetry install + post-install
|
|
|
|
|
|
EL_PHASE=${EL_PHASE:-all}
|
|
|
|
|
|
|
|
|
|
|
|
# ── Setup phase (venvs + pip-erplibre + git-repo) ────────────────────────────
|
|
|
|
|
|
if [[ "${EL_PHASE}" != "poetry" ]]; then
|
|
|
|
|
|
./script/generate_config.sh
|
|
|
|
|
|
|
|
|
|
|
|
# Generate empty addons if missing
|
|
|
|
|
|
path_addons_addons="./odoo${EL_ODOO_VERSION}/addons/addons"
|
|
|
|
|
|
if [[ ! -d "${path_addons_addons}" ]]; then
|
|
|
|
|
|
mkdir -p "${path_addons_addons}"
|
|
|
|
|
|
fi
|
2020-07-24 02:20:30 -04:00
|
|
|
|
|
2026-03-30 22:08:00 -04:00
|
|
|
|
if [[ ! -n "${DOCKER_BUILD}" ]]; then
|
|
|
|
|
|
# Install ERPLibre venv
|
|
|
|
|
|
echo -e "Install ${VENV_ERPLIBRE_PATH} with ${EL_PYTHON_ERPLIBRE_VERSION}"
|
[ADD] install: mise as Python provider, pyenv as fallback
mise lays down a precompiled CPython where pyenv builds one: seconds
against one to three minutes, with no -dev package at all. The choice
lives in EL_PYTHON_PROVIDER -- auto, mise or pyenv -- and in a single
file, lib_python_provider.sh. The rest of the repository only knows venv
paths and needs to know none of this.
In auto mode an ALREADY installed interpreter wins, whichever provider put
it there. mise is never installed on its own, "curl | sh" commits too much
for a script to decide -- make install_mise carries that decision.
MISE_PYTHON_COMPILE=false forbids it from quietly compiling: without that
guard it would fall back to pyenv's own engine, giving us the slowness
without the tooling. That is also what stopped gcc from collapsing while
building CPython on a low-memory s390x guest, for nothing.
One real bug falls along the way: a failed venv did not stop the install,
which then went on and failed further down, far from the cause.
--- FR ---
mise pose un CPython précompilé là où pyenv en compile un : des secondes
contre une à trois minutes, et aucun paquet -dev. Le choix vit dans
EL_PYTHON_PROVIDER — auto, mise ou pyenv — et dans un seul fichier,
lib_python_provider.sh. Le reste du dépôt ne connaît que des chemins de
venv et n'a rien à savoir de tout cela.
En mode auto, un interpréteur DÉJÀ posé l'emporte, quel qu'en soit le
fournisseur. mise n'est jamais installé de lui-même, « curl | sh » engage
trop pour qu'un script en décide — make install_mise porte cette décision.
MISE_PYTHON_COMPILE=false lui interdit de compiler en silence : sans ce
garde, il retomberait sur le moteur de pyenv, et nous aurions sa lenteur
sans son outillage. C'est aussi ce qui a évité que gcc s'écroule en
bâtissant CPython sur une VM s390x à faible mémoire, inutilement.
Un vrai défaut tombe au passage : un venv raté n'arrêtait pas
l'installation, qui continuait et échouait plus loin, loin de la cause.
Assisted-by: Claude Opus 5
2026-08-11 22:03:40 -04:00
|
|
|
|
# Le code de retour n'était PAS regardé : quand l'interpréteur ne
|
|
|
|
|
|
# pouvait pas être obtenu, le script continuait, et tout ce qui suit
|
|
|
|
|
|
# échouait à son tour sur un venv inexistant. Le log devenait une
|
|
|
|
|
|
# cascade de « No such file or directory » répartie sur trois fichiers,
|
|
|
|
|
|
# où la cause réelle — pas de compilateur C — se perdait tout en haut.
|
|
|
|
|
|
if ! ./script/install/install_venv.sh "ERPLibre" "${VENV_ERPLIBRE_PATH}" "${EL_PYTHON_ERPLIBRE_VERSION}"; then
|
|
|
|
|
|
echo "Echec de creation de ${VENV_ERPLIBRE_PATH}, arret."
|
|
|
|
|
|
exit 1
|
|
|
|
|
|
fi
|
2026-03-30 22:08:00 -04:00
|
|
|
|
# Install Odoo venv
|
|
|
|
|
|
echo -e "Install ${VENV_ODOO_PATH} with ${EL_PYTHON_ODOO_VERSION}"
|
[ADD] install: mise as Python provider, pyenv as fallback
mise lays down a precompiled CPython where pyenv builds one: seconds
against one to three minutes, with no -dev package at all. The choice
lives in EL_PYTHON_PROVIDER -- auto, mise or pyenv -- and in a single
file, lib_python_provider.sh. The rest of the repository only knows venv
paths and needs to know none of this.
In auto mode an ALREADY installed interpreter wins, whichever provider put
it there. mise is never installed on its own, "curl | sh" commits too much
for a script to decide -- make install_mise carries that decision.
MISE_PYTHON_COMPILE=false forbids it from quietly compiling: without that
guard it would fall back to pyenv's own engine, giving us the slowness
without the tooling. That is also what stopped gcc from collapsing while
building CPython on a low-memory s390x guest, for nothing.
One real bug falls along the way: a failed venv did not stop the install,
which then went on and failed further down, far from the cause.
--- FR ---
mise pose un CPython précompilé là où pyenv en compile un : des secondes
contre une à trois minutes, et aucun paquet -dev. Le choix vit dans
EL_PYTHON_PROVIDER — auto, mise ou pyenv — et dans un seul fichier,
lib_python_provider.sh. Le reste du dépôt ne connaît que des chemins de
venv et n'a rien à savoir de tout cela.
En mode auto, un interpréteur DÉJÀ posé l'emporte, quel qu'en soit le
fournisseur. mise n'est jamais installé de lui-même, « curl | sh » engage
trop pour qu'un script en décide — make install_mise porte cette décision.
MISE_PYTHON_COMPILE=false lui interdit de compiler en silence : sans ce
garde, il retomberait sur le moteur de pyenv, et nous aurions sa lenteur
sans son outillage. C'est aussi ce qui a évité que gcc s'écroule en
bâtissant CPython sur une VM s390x à faible mémoire, inutilement.
Un vrai défaut tombe au passage : un venv raté n'arrêtait pas
l'installation, qui continuait et échouait plus loin, loin de la cause.
Assisted-by: Claude Opus 5
2026-08-11 22:03:40 -04:00
|
|
|
|
if ! ./script/install/install_venv.sh "Odoo" "${VENV_ODOO_PATH}" "${EL_PYTHON_ODOO_VERSION}"; then
|
|
|
|
|
|
echo "Echec de creation de ${VENV_ODOO_PATH}, arret."
|
|
|
|
|
|
exit 1
|
|
|
|
|
|
fi
|
2026-03-30 22:08:00 -04:00
|
|
|
|
else
|
|
|
|
|
|
mkdir .venv
|
|
|
|
|
|
fi
|
2025-05-05 04:43:13 -04:00
|
|
|
|
|
2026-03-30 22:08:00 -04:00
|
|
|
|
source ./${VENV_ERPLIBRE_PATH}/bin/activate
|
|
|
|
|
|
echo -e "Upgrade pip to ${VENV_ERPLIBRE_PATH}"
|
|
|
|
|
|
pip install --upgrade pip
|
|
|
|
|
|
pip install -r requirement/erplibre_require-ments.txt
|
2025-05-05 04:43:13 -04:00
|
|
|
|
|
2026-03-30 22:08:00 -04:00
|
|
|
|
./script/install/install_git_repo.sh
|
|
|
|
|
|
fi
|
2020-07-29 18:13:22 -04:00
|
|
|
|
|
2026-03-30 22:08:00 -04:00
|
|
|
|
# ── Poetry phase (install python packages + post-install) ────────────────────
|
|
|
|
|
|
if [[ "${EL_PHASE}" != "setup" ]]; then
|
|
|
|
|
|
source ${VENV_ODOO_PATH}/bin/activate
|
|
|
|
|
|
echo -e "Upgrade pip to ${VENV_ODOO_PATH}"
|
|
|
|
|
|
pip install --upgrade pip
|
2022-12-21 00:22:20 -05:00
|
|
|
|
|
2026-03-30 22:08:00 -04:00
|
|
|
|
echo -e "\n---- Installing poetry dependency ----"
|
2025-07-25 15:59:53 -04:00
|
|
|
|
|
2026-03-30 22:08:00 -04:00
|
|
|
|
if [[ -z "${EL_POETRY_VERSION}" ]]; then
|
|
|
|
|
|
echo -e "${Red}Error${Color_Off} missing poetry version, please check file .poetry-version"
|
|
|
|
|
|
cat .poetry-version
|
|
|
|
|
|
ls -la
|
2022-12-21 00:22:20 -05:00
|
|
|
|
exit 1
|
|
|
|
|
|
fi
|
2022-12-21 00:25:29 -05:00
|
|
|
|
|
[REM] install: drop Ubuntu 20.04 and 22.04
Two blockers on 20.04, neither worth carrying. "TypeError: unsupported
operand type(s) for |" fired before the install even started:
update_env_version.py imports erplibre_state as the very first thing
"make install_os" does, hence before pyenv, on the system Python 3.8,
where a "str | None" annotation is evaluated at import. And cryptography
now demands OpenSSL 3, while focal ships 1.1.1.
Annotations are therefore deferred, a contract the bootstrap file already
stated in a comment and now holds across script/version and
script/install. But the releases themselves go: pikepdf requires
qpdf >= 12.2, compiled in C++20, when focal ships GCC 9.
--- FR ---
Deux blocages sur 20.04, aucun ne méritant d'être porté. « TypeError:
unsupported operand type(s) for | » se déclenchait avant même le début de
l'installation : update_env_version.py importe erplibre_state en tout
premier lieu de « make install_os », donc avant pyenv, sur le Python 3.8
du système, où une annotation « str | None » est évaluée à l'import. Et
cryptography exige désormais OpenSSL 3, quand focal livre 1.1.1.
Les annotations sont donc différées, contrat que le fichier d'amorçage
énonçait déjà en commentaire et qui tient maintenant sur script/version et
script/install. Mais les versions elles-mêmes partent : pikepdf réclame
qpdf >= 12.2, compilé en C++20, quand focal livre GCC 9.
Assisted-by: Claude Opus 5
2026-08-11 08:03:32 -04:00
|
|
|
|
# s390x UNIQUEMENT — la borne ci-dessous ne doit toucher aucune autre
|
|
|
|
|
|
# architecture, et le test d'architecture vient donc en premier.
|
|
|
|
|
|
#
|
|
|
|
|
|
# Poetry tire keyring, donc SecretStorage, donc cryptography, dont la
|
|
|
|
|
|
# DERNIÈRE version : rien ne la borne à cette étape. Partout ailleurs c'est
|
|
|
|
|
|
# sans conséquence, pip y pose une roue manylinux qui embarque son propre
|
|
|
|
|
|
# OpenSSL en statique — vérifié, la 50.0.0 en publie pour x86_64, aarch64,
|
|
|
|
|
|
# ppc64le et armv7l. s390x est la SEULE sans roue : elle compile, contre
|
|
|
|
|
|
# l'OpenSSL du système.
|
|
|
|
|
|
#
|
|
|
|
|
|
# Or cryptography 47 a retiré le support d'OpenSSL 1.1.1 — vérifié version
|
|
|
|
|
|
# par version, les gardes « CRYPTOGRAPHY_OPENSSL_300_OR_GREATER » de
|
|
|
|
|
|
# fips.rs disparaissent entre la 46 et la 47 — et Ubuntu 20.04 livre
|
|
|
|
|
|
# 1.1.1f. D'où « EVP_default_properties_is_fips_enabled not found in ffi ».
|
|
|
|
|
|
# Sur s390x en 22.04 et au-delà, OpenSSL est en 3.x : aucune borne.
|
|
|
|
|
|
PIP_CONSTRAINT_CRYPTO=""
|
|
|
|
|
|
if [[ "$(uname -m)" == "s390x" ]]; then
|
|
|
|
|
|
OPENSSL_VER="$(pkg-config --modversion openssl 2>/dev/null \
|
|
|
|
|
|
|| openssl version 2>/dev/null | awk '{print $2}')"
|
|
|
|
|
|
case "${OPENSSL_VER}" in
|
|
|
|
|
|
3.* | 4.*) ;;
|
|
|
|
|
|
"") echo "s390x : version d'OpenSSL indeterminee, aucune borne." ;;
|
|
|
|
|
|
*)
|
|
|
|
|
|
echo "s390x, OpenSSL ${OPENSSL_VER} < 3 : cryptography borne a <47 pour poetry."
|
|
|
|
|
|
PIP_CONSTRAINT_CRYPTO="cryptography<47"
|
|
|
|
|
|
;;
|
|
|
|
|
|
esac
|
|
|
|
|
|
fi
|
|
|
|
|
|
|
2026-03-30 22:08:00 -04:00
|
|
|
|
# Delete artifacts created by pip, cause error in next "poetry install"
|
|
|
|
|
|
if [[ ! -f "${POETRY_ODOO_PATH}" ]]; then
|
|
|
|
|
|
echo -e "Install Poetry ${POETRY_ODOO_PATH}"
|
[REM] install: drop Ubuntu 20.04 and 22.04
Two blockers on 20.04, neither worth carrying. "TypeError: unsupported
operand type(s) for |" fired before the install even started:
update_env_version.py imports erplibre_state as the very first thing
"make install_os" does, hence before pyenv, on the system Python 3.8,
where a "str | None" annotation is evaluated at import. And cryptography
now demands OpenSSL 3, while focal ships 1.1.1.
Annotations are therefore deferred, a contract the bootstrap file already
stated in a comment and now holds across script/version and
script/install. But the releases themselves go: pikepdf requires
qpdf >= 12.2, compiled in C++20, when focal ships GCC 9.
--- FR ---
Deux blocages sur 20.04, aucun ne méritant d'être porté. « TypeError:
unsupported operand type(s) for | » se déclenchait avant même le début de
l'installation : update_env_version.py importe erplibre_state en tout
premier lieu de « make install_os », donc avant pyenv, sur le Python 3.8
du système, où une annotation « str | None » est évaluée à l'import. Et
cryptography exige désormais OpenSSL 3, quand focal livre 1.1.1.
Les annotations sont donc différées, contrat que le fichier d'amorçage
énonçait déjà en commentaire et qui tient maintenant sur script/version et
script/install. Mais les versions elles-mêmes partent : pikepdf réclame
qpdf >= 12.2, compilé en C++20, quand focal livre GCC 9.
Assisted-by: Claude Opus 5
2026-08-11 08:03:32 -04:00
|
|
|
|
pip install ${PIP_CONSTRAINT_CRYPTO} poetry==${EL_POETRY_VERSION}
|
2026-03-30 22:08:00 -04:00
|
|
|
|
poetry --version
|
|
|
|
|
|
# Fix broken poetry by installing ignored dependence
|
|
|
|
|
|
# poetry lock --no-update
|
|
|
|
|
|
# To fix keyring problem when installation is blocked, use
|
|
|
|
|
|
export PYTHON_KEYRING_BACKEND=keyring.backends.null.Keyring
|
|
|
|
|
|
if [[ ${WITH_POETRY_INSTALLATION} -ne 0 ]]; then
|
2026-07-27 23:57:04 -04:00
|
|
|
|
poetry install --no-root ${POETRY_VERBOSE}
|
2026-03-30 22:08:00 -04:00
|
|
|
|
fi
|
|
|
|
|
|
retVal=$?
|
|
|
|
|
|
if [[ $retVal -ne 0 ]]; then
|
|
|
|
|
|
echo "Poetry installation error with status ${retVal}"
|
[IMP] install: support Fedora, Debian, Ubuntu and Arch
Adds a Fedora dependency installer, rewrites the Arch one on pacman rather
than an AUR helper absent from cloud images, and repairs the Debian path:
apt lock timeout, PostGIS best-effort, Ubuntu 26.04, Node 22.
--- FR ---
Ajoute un installeur de dépendances Fedora, réécrit celui d'Arch sur pacman
plutôt qu'un assistant AUR absent des images cloud, et répare le chemin
Debian : attente du verrou apt, PostGIS best-effort, Ubuntu 26.04, Node 22.
Assisted-by: Claude Opus 4.8
Assisted-by: Claude Opus 5
2026-08-07 03:22:26 -04:00
|
|
|
|
# « -q » masque la CAUSE. On rejoue en « -vvv » (debug) car c'est
|
|
|
|
|
|
# le SEUL niveau où Poetry affiche la sortie des sous-processus
|
|
|
|
|
|
# (git clone/checkout, build pip) — donc l'erreur réelle d'une
|
|
|
|
|
|
# dépendance VCS/build. Capturé dans le log pour diagnostic.
|
|
|
|
|
|
echo "---- Poetry: rejeu -vvv pour diagnostic ----"
|
|
|
|
|
|
poetry install --no-root -vvv 2>&1 || true
|
2026-03-30 22:08:00 -04:00
|
|
|
|
exit 1
|
|
|
|
|
|
fi
|
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
# Delete artifacts created by pip, cause error in next "poetry install"
|
|
|
|
|
|
rm -rf artifacts
|
2020-07-24 02:20:30 -04:00
|
|
|
|
|
2026-03-30 22:08:00 -04:00
|
|
|
|
# Link for dev tools into Odoo
|
|
|
|
|
|
echo -e "\n---- Add link dependency in site-packages of Python ----"
|
|
|
|
|
|
# TODO this link can break, the symbolic link is maybe not created
|
|
|
|
|
|
ln -fs "${EL_HOME_ODOO}/odoo" "${EL_HOME}/${VENV_ODOO_PATH}/lib/python${PYTHON_VERSION_MAJOR}/site-packages/"
|
2025-05-05 04:43:13 -04:00
|
|
|
|
|
2026-03-30 22:08:00 -04:00
|
|
|
|
# Force to return to erplibre source
|
|
|
|
|
|
source ./${VENV_ERPLIBRE_PATH}/bin/activate
|
2025-05-05 04:43:13 -04:00
|
|
|
|
|
2026-03-30 22:08:00 -04:00
|
|
|
|
# Add trace of installation
|
|
|
|
|
|
LINE_TO_ADD="odoo${EL_ODOO_VERSION}"
|
|
|
|
|
|
mkdir -p "$(dirname "$FILE_INSTALLATION_VERSION")"
|
|
|
|
|
|
touch "$FILE_INSTALLATION_VERSION"
|
|
|
|
|
|
if ! grep -qxF "$LINE_TO_ADD" "$FILE_INSTALLATION_VERSION"; then
|
|
|
|
|
|
echo "$LINE_TO_ADD" >> "$FILE_INSTALLATION_VERSION"
|
|
|
|
|
|
fi
|
2025-05-05 04:43:13 -04:00
|
|
|
|
fi
|