{Packaging} Install bz2 module in embedded Python on Linux#32163
{Packaging} Install bz2 module in embedded Python on Linux#32163
Conversation
️✔️AzureCLI-FullTest
|
|
Hi @mainred, |
There was a problem hiding this comment.
Pull Request Overview
This PR addresses a ModuleNotFoundError for the '_bz2' module by adding the libbz2-dev package to the Debian build dependencies. The error was occurring when the aks-agent extension tried to import the bz2 module, which requires the underlying C library to be available during Python compilation.
- Added
libbz2-devto the list of packages installed during Debian build process
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
️✔️AzureCLI-BreakingChangeTest
|
|
Thank you for your contribution! We will review the pull request and get back to you soon. |
|
The git hooks are available for azure-cli and azure-cli-extensions repos. They could help you run required checks before creating the PR. Please sync the latest code with latest dev branch (for azure-cli) or main branch (for azure-cli-extensions). pip install azdev --upgrade
azdev setup -c <your azure-cli repo path> -r <your azure-cli-extensions repo path>
|
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
Co-authored-by: Hang <bebound@gmail.com>
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
| # uuid-dev is used to build _uuid module: https://github.com/python/cpython/pull/3796 | ||
| apt-get install -y libssl-dev libffi-dev python3-dev zlib1g-dev uuid-dev wget debhelper | ||
| # libbz2-dev is used to install bz2 module: https://github.com/Azure/azure-cli/pull/32163 | ||
| apt-get install -y libssl-dev libffi-dev python3-dev zlib1g-dev uuid-dev wget debhelper libbz2-dev |
There was a problem hiding this comment.
How about RPM? Does the system Python installed by RPM already have bz2 support?
There was a problem hiding this comment.
Yes, the RPM system Python contains this module.
| # uuid-dev is used to build _uuid module: https://github.com/python/cpython/pull/3796 | ||
| apt-get install -y libssl-dev libffi-dev python3-dev zlib1g-dev uuid-dev wget debhelper | ||
| # libbz2-dev is used to install bz2 module: https://github.com/Azure/azure-cli/pull/32163 | ||
| apt-get install -y libssl-dev libffi-dev python3-dev zlib1g-dev uuid-dev wget debhelper libbz2-dev |
There was a problem hiding this comment.
The optional package libbz2-dev is documented by https://devguide.python.org/getting-started/setup-building/#install-dependencies under the Linux tab.
If you want to build all optional modules, install the following packages and their dependencies:
sudo apt-get install build-essential gdb lcov pkg-config \ libbz2-dev libffi-dev libgdbm-dev libgdbm-compat-dev liblzma-dev \ libncurses5-dev libreadline6-dev libsqlite3-dev libssl-dev \ lzma lzma-dev tk-dev uuid-dev zlib1g-dev libmpdec-dev libzstd-dev \ inetutils-inetd
| # uuid-dev is used to build _uuid module: https://github.com/python/cpython/pull/3796 | ||
| apt-get install -y libssl-dev libffi-dev python3-dev zlib1g-dev uuid-dev wget debhelper | ||
| # libbz2-dev is used to install bz2 module: https://github.com/Azure/azure-cli/pull/32163 | ||
| apt-get install -y libssl-dev libffi-dev python3-dev zlib1g-dev uuid-dev wget debhelper libbz2-dev |
There was a problem hiding this comment.
It's better to mention bz2 is required by aks-agent and aks-preview (Azure/azure-cli-extensions#8984) extensions.
There was a problem hiding this comment.
Never mind, this comment already serves this purpose.
Related command
Description
To address Azure/azure-cli-extensions#8984
Testing Guide
History Notes
[Component Name 1] BREAKING CHANGE:
az command a: Make some customer-facing breaking change[Component Name 2]
az command b: Add some customer-facing featureThis checklist is used to make sure that common guidelines for a pull request are followed.
The PR title and description has followed the guideline in Submitting Pull Requests.
I adhere to the Command Guidelines.
I adhere to the Error Handling Guidelines.