coin: Explicitly specify SBOM_PYTHON_APPS_PATH for all platforms

Instead of relying on the qtbase coin instructions to compute the
SBOM_PYTHON_APPS_PATH path based on the platform, which does not work
reliably, especially when multiple python installations are present,
explicitly specify the path in the provisioning scripts.

Amends 1f2fb6312c

Task-number: QTBUG-122899
Task-number: QTBUG-124453
Task-number: QTBUG-125211
Change-Id: I097fd1c4119a203d82f88c477dbf0fc0f67f19f2
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 6f991b55a3)
This commit is contained in:
Alexandru Croitor
2024-10-07 16:41:27 +02:00
parent db32c6b6ef
commit 81d2c30cb4
13 changed files with 55 additions and 0 deletions

View File

@@ -30,6 +30,7 @@ echo "Configure pip"
SetEnvVar "PYTHON3_PATH" "/Library/Frameworks/Python.framework/Versions/3.9/bin"
SetEnvVar "PIP3_PATH" "/Library/Frameworks/Python.framework/Versions/3.9/bin"
SetEnvVar "SBOM_PYTHON_APPS_PATH" "/Library/Frameworks/Python.framework/Versions/3.9/bin"
# Install Python certificates. Required at least for emsdk installation
open /Applications/Python\ 3.9/Install\ Certificates.command

View File

@@ -262,6 +262,10 @@ keyring --disable
pip install --user -r "${BASH_SOURCE%/*}/../common/shared/sbom_requirements.txt"
source "${BASH_SOURCE%/*}/../common/unix/SetEnvVar.sh"
SetEnvVar "SBOM_PYTHON_APPS_PATH" "/home/qt/.local/bin"
# SetEnvVar "PATH" "/usr/lib/nodejs-mozilla/bin:\$PATH"
#OpenSSLVersion="$(openssl version |cut -b 9-14)"

View File

@@ -169,6 +169,8 @@ sudo pip config --user set global.extra-index-url https://pypi.org/simple/
sudo pip3 install virtualenv wheel
sudo python3.11 -m pip install virtualenv wheel
sudo python3.11 -m pip install -r "${BASH_SOURCE%/*}/../common/shared/sbom_requirements.txt"
# For now we don't set QT_SBOM_PYTHON_APPS_PATH here, and rely on the build system to find the
# system python3.11.
sudo /usr/bin/pip3 install wheel
sudo /usr/bin/pip3 install dataclasses

View File

@@ -170,6 +170,8 @@ sudo pip3 install virtualenv wheel
# Just make sure we have virtualenv to run with python3.8 -m virtualenv
sudo python3.11 -m pip install virtualenv wheel
sudo python3.11 -m pip install -r "${BASH_SOURCE%/*}/../common/shared/sbom_requirements.txt"
# For now we don't set QT_SBOM_PYTHON_APPS_PATH here, and rely on the build system to find the
# system python3.11.
sudo /usr/bin/pip3 install wheel
sudo /usr/bin/pip3 install dataclasses

View File

@@ -186,6 +186,12 @@ sudo python -m pip install -r "${BASH_SOURCE%/*}/../common/shared/sbom_requireme
sudo /usr/bin/pip3 install wheel
sudo /usr/bin/pip3 install -r "${BASH_SOURCE%/*}/../common/shared/sbom_requirements.txt"
# Provisioning during installation says:
# 'The script sbom2doc is installed in '/usr/local/bin' which is not on PATH.'
# hence the explicit assignment to SBOM_PYTHON_APPS_PATH.
source "${BASH_SOURCE%/*}/../common/unix/SetEnvVar.sh"
SetEnvVar "SBOM_PYTHON_APPS_PATH" "/usr/local/bin"
# Make FindPython3.cmake to find python3
sudo ln -s /usr/bin/python3 /usr/local/bin/python3

View File

@@ -76,3 +76,8 @@ pip3 install --user -r "${BASH_SOURCE%/*}/../common/shared/sbom_requirements.txt
# shellcheck source=../common/unix/SetEnvVar.sh
source "${BASH_SOURCE%/*}/../common/unix/SetEnvVar.sh"
SetEnvVar "PYTHON3_PATH" "/usr/local/bin"
# Provisioning during installation says:
# 'The script sbom2doc is installed in '/home/qt/.local/bin' which is not on PATH.'
# hence the explicit assignment to SBOM_PYTHON_APPS_PATH.
SetEnvVar "SBOM_PYTHON_APPS_PATH" "/home/qt/.local/bin"

View File

@@ -253,5 +253,10 @@ pip install --user -r "${BASH_SOURCE%/*}/../common/shared/sbom_requirements.txt"
source "${BASH_SOURCE%/*}/../common/unix/SetEnvVar.sh"
# SetEnvVar "PATH" "/usr/lib/nodejs-mozilla/bin:\$PATH"
# Provisioning during installation says:
# 'The script sbom2doc is installed in '/home/qt/.local/bin' which is not on PATH.'
# hence the explicit assignment to SBOM_PYTHON_APPS_PATH.
SetEnvVar "SBOM_PYTHON_APPS_PATH" "/home/qt/.local/bin"
OpenSSLVersion="$(openssl version |cut -b 9-14)"
echo "System's OpenSSL = $OpenSSLVersion" >> ~/versions.txt

View File

@@ -255,5 +255,10 @@ pip install --user -r "${BASH_SOURCE%/*}/../common/shared/sbom_requirements.txt"
source "${BASH_SOURCE%/*}/../common/unix/SetEnvVar.sh"
# SetEnvVar "PATH" "/usr/lib/nodejs-mozilla/bin:\$PATH"
# Provisioning during installation says:
# 'The script sbom2doc is installed in '/home/qt/.local/bin' which is not on PATH.'
# hence the explicit assignment to SBOM_PYTHON_APPS_PATH.
SetEnvVar "SBOM_PYTHON_APPS_PATH" "/home/qt/.local/bin"
OpenSSLVersion="$(openssl version |cut -b 9-14)"
echo "System's OpenSSL = $OpenSSLVersion" >> ~/versions.txt

View File

@@ -258,5 +258,10 @@ pip config --user set global.extra-index-url https://pypi.org/simple/
source "${BASH_SOURCE%/*}/../common/unix/SetEnvVar.sh"
# SetEnvVar "PATH" "/usr/lib/nodejs-mozilla/bin:\$PATH"
# Provisioning during installation says:
# 'The script sbom2doc is installed in '/home/qt/.local/bin' which is not on PATH.'
# hence the explicit assignment to SBOM_PYTHON_APPS_PATH.
SetEnvVar "SBOM_PYTHON_APPS_PATH" "/home/qt/.local/bin"
OpenSSLVersion="$(openssl version |cut -b 9-14)"
echo "System's OpenSSL = $OpenSSLVersion" >> ~/versions.txt

View File

@@ -17,3 +17,8 @@ python3.11 -m pip install selenium netifaces scache webdriver-manager
python3.11 -m pip install -r "${BASH_SOURCE%/*}/../common/shared/sbom_requirements.txt"
SetEnvVar "PYTHON3_EXECUTABLE" "/usr/bin/python3.11"
# Provisioning during installation says:
# 'Defaulting to user installation because normal site-packages is not writeable'
# So it implicitly uses pip install --user, hence the path.
SetEnvVar "SBOM_PYTHON_APPS_PATH" "/home/qt/.local/bin"

View File

@@ -18,6 +18,11 @@ SetEnvVar "PIP3_PATH" "/Users/qt/.pyenv/versions/3.9.7/bin/"
# Use 3.9 as a default python
SetEnvVar "PATH" "\$PYTHON3_PATH:\$PATH"
# Provisioning during installation says:
# 'The script sbom2doc is installed in '/home/qt/.local/bin' which is not on PATH.'
# hence the explicit assignment to SBOM_PYTHON_APPS_PATH.
SetEnvVar "SBOM_PYTHON_APPS_PATH" "/home/qt/.local/bin"
# QtWebengine still requires python2
pyenv install 2.7.18
SetEnvVar "PYTHON2_PATH" "/Users/qt/.pyenv/versions/2.7.18/bin/"

View File

@@ -18,6 +18,11 @@ SetEnvVar "PIP3_PATH" "/Users/qt/.pyenv/versions/3.9.7/bin/"
# Use 3.9 as a default python
SetEnvVar "PATH" "\$PYTHON3_PATH:\$PATH"
# Provisioning during installation says:
# 'The script sbom2doc is installed in '/home/qt/.local/bin' which is not on PATH.'
# hence the explicit assignment to SBOM_PYTHON_APPS_PATH.
SetEnvVar "SBOM_PYTHON_APPS_PATH" "/home/qt/.local/bin"
# QtWebengine still requires python2
pyenv install 2.7.18
SetEnvVar "PYTHON2_PATH" "/Users/qt/.pyenv/versions/2.7.18/bin/"

View File

@@ -18,4 +18,9 @@ SetEnvVar "PIP3_PATH" "/Users/qt/.pyenv/versions/3.9.7/bin/"
# Use 3.9 as a default python
SetEnvVar "PATH" "\$PYTHON3_PATH:\$PATH"
# Provisioning during installation says:
# 'The script sbom2doc is installed in '/home/qt/.local/bin' which is not on PATH.'
# hence the explicit assignment to SBOM_PYTHON_APPS_PATH.
SetEnvVar "SBOM_PYTHON_APPS_PATH" "/home/qt/.local/bin"
echo "python3 = 3.9.7" >> ~/versions.txt