Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion scripts/release/debian/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
apt-get update
# uuid-dev is used to build _uuid module: https://github.com/python/cpython/pull/3796
# 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
# lsb-release is used to determine whether install pymsalruntime
apt-get install -y libssl-dev libffi-dev python3-dev zlib1g-dev uuid-dev wget debhelper libbz2-dev lsb-release
# Git is not strictly necessary, but it would allow building an experimental package
# with dependency which is currently only available in its git repo feature branch.
apt-get install -y git
Expand All @@ -43,6 +44,10 @@ export PATH=$PATH:$WORKDIR/python_env/bin

find ${WORKDIR}/src/ -name setup.py -type f | xargs -I {} dirname {} | grep -v azure-cli-testsdk | xargs pip3 install --no-deps
pip3 install -r ${WORKDIR}/src/azure-cli/requirements.py3.$(uname).txt
# Only install pymsalruntime for Ubuntu, as it does not fully support other Linux distributions
if [[ "$(lsb_release --id --short)" == "Ubuntu" && "$(dpkg --print-architecture)" == "amd64" ]]; then
pip3 install pymsalruntime==0.20.2
fi
$WORKDIR/python_env/bin/python3 ${WORKDIR}/scripts/trim_sdk.py

# Create create directory for debian build
Expand Down
3 changes: 3 additions & 0 deletions scripts/release/debian/prepare.sh
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,9 @@ ${TAB}dh \$@ --sourcedirectory $source_dir
override_dh_clean:
${TAB}dh_clean --exclude=__pycache__

override_dh_shlibdeps:
${TAB}dh_shlibdeps --exclude=*/site-packages/pymsalruntime/*
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Exclude pymsalruntime dependency manually. The user needs to install libwebkit2gtk-4.1-dev manually.

dpkg-shlibdeps: error: cannot find library libdbus-1.so.3 needed by debian/azure-cli/opt/az/lib/python3.13/site-packages/pymsalruntime/libmsalruntime.so (ELF format: 'elf64-x86-64' abi: 'ELF:64:l:amd64:0'; RPATH: '')
dpkg-shlibdeps: error: cannot find library libcurl.so.4 needed by debian/azure-cli/opt/az/lib/python3.13/site-packages/pymsalruntime/libmsalruntime.so (ELF format: 'elf64-x86-64' abi: 'ELF:64:l:amd64:0'; RPATH: '')
dpkg-shlibdeps: error: cannot find library libwebkit2gtk-4.1.so.0 needed by debian/azure-cli/opt/az/lib/python3.13/site-packages/pymsalruntime/libmsalruntime.so (ELF format: 'elf64-x86-64' abi: 'ELF:64:l:amd64:0'; RPATH: '')
dpkg-shlibdeps: error: cannot find library libjavascriptcoregtk-4.1.so.0 needed by debian/azure-cli/opt/az/lib/python3.13/site-packages/pymsalruntime/libmsalruntime.so (ELF format: 'elf64-x86-64' abi: 'ELF:64:l:amd64:0'; RPATH: '')
dpkg-shlibdeps: error: cannot find library libgtk-3.so.0 needed by debian/azure-cli/opt/az/lib/python3.13/site-packages/pymsalruntime/libmsalruntime.so (ELF format: 'elf64-x86-64' abi: 'ELF:64:l:amd64:0'; RPATH: '')
dpkg-shlibdeps: error: cannot find library libgdk-3.so.0 needed by debian/azure-cli/opt/az/lib/python3.13/site-packages/pymsalruntime/libmsalruntime.so (ELF format: 'elf64-x86-64' abi: 'ELF:64:l:amd64:0'; RPATH: '')

Ref: https://learn.microsoft.com/en-us/entra/msal/python/advanced/linux-broker-py?tabs=ubuntudep#linux-dependencies
https://manpages.debian.org/unstable/debhelper/dh_shlibdeps.1.en.html#X

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What will happen if the user doesn't install libwebkit2gtk-4.1-dev manually and installs Azure CLI DEB package?

Copy link
Copy Markdown
Contributor Author

@bebound bebound Mar 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume the WAM windows can't be opened. Here is the example code for Linux: https://learn.microsoft.com/en-us/entra/msal/python/advanced/linux-broker-py?tabs=ubuntudep#create-project


override_dh_install:
${TAB}mkdir -p debian/azure-cli/opt/az
${TAB}cp -a python_env/* debian/azure-cli/opt/az
Expand Down
Loading