-
Notifications
You must be signed in to change notification settings - Fork 3.4k
[Packaging] Bump Python to 3.12 on RHEL and CentOS Stream #31264
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,7 +5,7 @@ ARG image=registry.access.redhat.com/ubi8/ubi:8.4 | |
|
|
||
| FROM ${image} AS build-env | ||
| ARG cli_version=dev | ||
| ARG python_package=python39 | ||
| ARG python_package=python3.12 | ||
|
|
||
| RUN yum update -y | ||
| RUN yum install -y wget rpm-build gcc libffi-devel ${python_package}-devel openssl-devel make bash diffutils patch dos2unix perl | ||
|
|
@@ -18,7 +18,7 @@ COPY . . | |
| # We have to explicitly specify 'python39' to install Python 3.9. | ||
| RUN --mount=type=secret,id=PIP_INDEX_URL export PIP_INDEX_URL=$(cat /run/secrets/PIP_INDEX_URL) && \ | ||
| dos2unix ./scripts/release/rpm/azure-cli.spec && \ | ||
| REPO_PATH=$(pwd) CLI_VERSION=$cli_version PYTHON_PACKAGE=$python_package PYTHON_CMD=python3.9 \ | ||
| REPO_PATH=$(pwd) CLI_VERSION=$cli_version PYTHON_PACKAGE=$python_package PYTHON_CMD=$python_package \ | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In RHEL8, the In python3.12, both distros use I'm unsure if these values will differ in the future; keep these variables for now. |
||
| rpmbuild -v -bb --clean scripts/release/rpm/azure-cli.spec && \ | ||
| cp /root/rpmbuild/RPMS/*/azure-cli-${cli_version}-1.*.rpm /azure-cli-dev.rpm && \ | ||
| mkdir /out && cp /root/rpmbuild/RPMS/*/azure-cli-${cli_version}-1.*.rpm /out/ | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/root/rpmbuild/BUILDROOT/azure-cli-2.71.0-1.el9.x86_64/usr/lib64/az/pyvenv.cfgcontent isIt raises this error during build.
In 3.9,
pyvenv.cfgdoes not include rpmbuild root:There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/usr/lib/rpm/check-buildrootwants to make sure the RPM build path/root/rpmbuild/BUILDROOT/azure-cli-2.71.0-1.el9.x86_64does not exist in any of the installed file, butpyvenv.cfgcontainscommand = /usr/bin/python3.12 -m venv /root/rpmbuild/BUILDROOT/azure-cli-2.71.0-1.el9.x86_64/usr/lib64/azwhich makes/usr/lib/rpm/check-buildrootfail.pyvenv.cfgcause any side effect?sedorperl(L60) to only removecommand = /usr/bin/python3.12 -m venv /root/rpmbuild/BUILDROOT/azure-cli-2.71.0-1.el9.x86_64/usr/lib64/az?Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pyvenv.cfgcontains some metadata of the venv. We only need thesite-pacakgesfolder in the venv.This is the RPM entry script:
azure-cli/scripts/release/rpm/azure-cli.spec
Line 79 in 81de68b
I thinks it's fine to remove it. As a proof, we have explicitly excluded the
binfolder created by venv:azure-cli/scripts/release/rpm/azure-cli.spec
Line 88 in 81de68b
PS: Although
{cli_lib_dir}/bin/is excluded in RPM, it still checks whether this path contains hard-coded buildroot during the build. Line 60 is still necessary.