Skip to content

[Packaging] Install pymsalruntime on Ubuntu#31832

Draft
bebound wants to merge 8 commits intoAzure:devfrom
bebound:install-pymsalruntime
Draft

[Packaging] Install pymsalruntime on Ubuntu#31832
bebound wants to merge 8 commits intoAzure:devfrom
bebound:install-pymsalruntime

Conversation

@bebound
Copy link
Contributor

@bebound bebound commented Jul 17, 2025

Description

Install pymsalruntime on amd64 Ubuntu package.

The disk usage increases by 46MB.

Users need to manually install libwebkit2gtk-4.1-dev to use WAM, which takes about 740MB disk space. (That's why I don't add it as a dependency of azure-cli)

Ref: https://learn.microsoft.com/en-us/entra/msal/python/advanced/linux-broker-py?tabs=ubuntudep#linux-dependencies

Related work items:

@azure-client-tools-bot-prd
Copy link

azure-client-tools-bot-prd bot commented Jul 17, 2025

️✔️AzureCLI-FullTest
️✔️acr
️✔️latest
️✔️3.12
️✔️3.13
️✔️acs
️✔️latest
️✔️3.12
️✔️3.13
️✔️advisor
️✔️latest
️✔️3.12
️✔️3.13
️✔️ams
️✔️latest
️✔️3.12
️✔️3.13
️✔️apim
️✔️latest
️✔️3.12
️✔️3.13
️✔️appconfig
️✔️latest
️✔️3.12
️✔️3.13
️✔️appservice
️✔️latest
️✔️3.12
️✔️3.13
️✔️aro
️✔️latest
️✔️3.12
️✔️3.13
️✔️backup
️✔️latest
️✔️3.12
️✔️3.13
️✔️batch
️✔️latest
️✔️3.12
️✔️3.13
️✔️batchai
️✔️latest
️✔️3.12
️✔️3.13
️✔️billing
️✔️latest
️✔️3.12
️✔️3.13
️✔️botservice
️✔️latest
️✔️3.12
️✔️3.13
️✔️cdn
️✔️latest
️✔️3.12
️✔️3.13
️✔️cloud
️✔️latest
️✔️3.12
️✔️3.13
️✔️cognitiveservices
️✔️latest
️✔️3.12
️✔️3.13
️✔️compute_recommender
️✔️latest
️✔️3.12
️✔️3.13
️✔️computefleet
️✔️latest
️✔️3.12
️✔️3.13
️✔️config
️✔️latest
️✔️3.12
️✔️3.13
️✔️configure
️✔️latest
️✔️3.12
️✔️3.13
️✔️consumption
️✔️latest
️✔️3.12
️✔️3.13
️✔️container
️✔️latest
️✔️3.12
️✔️3.13
️✔️containerapp
️✔️latest
️✔️3.12
️✔️3.13
️✔️core
️✔️latest
️✔️3.12
️✔️3.13
️✔️cosmosdb
️✔️latest
️✔️3.12
️✔️3.13
️✔️databoxedge
️✔️latest
️✔️3.12
️✔️3.13
️✔️dls
️✔️latest
️✔️3.12
️✔️3.13
️✔️dms
️✔️latest
️✔️3.12
️✔️3.13
️✔️eventgrid
️✔️latest
️✔️3.12
️✔️3.13
️✔️eventhubs
️✔️latest
️✔️3.12
️✔️3.13
️✔️feedback
️✔️latest
️✔️3.12
️✔️3.13
️✔️find
️✔️latest
️✔️3.12
️✔️3.13
️✔️hdinsight
️✔️latest
️✔️3.12
️✔️3.13
️✔️identity
️✔️latest
️✔️3.12
️✔️3.13
️✔️iot
️✔️latest
️✔️3.12
️✔️3.13
️✔️keyvault
️✔️latest
️✔️3.12
️✔️3.13
️✔️lab
️✔️latest
️✔️3.12
️✔️3.13
️✔️managedservices
️✔️latest
️✔️3.12
️✔️3.13
️✔️maps
️✔️latest
️✔️3.12
️✔️3.13
️✔️marketplaceordering
️✔️latest
️✔️3.12
️✔️3.13
️✔️monitor
️✔️latest
️✔️3.12
️✔️3.13
️✔️mysql
️✔️latest
️✔️3.12
️✔️3.13
️✔️netappfiles
️✔️latest
️✔️3.12
️✔️3.13
️✔️network
️✔️latest
️✔️3.12
️✔️3.13
️✔️policyinsights
️✔️latest
️✔️3.12
️✔️3.13
️✔️postgresql
️✔️latest
️✔️3.12
️✔️3.13
️✔️privatedns
️✔️latest
️✔️3.12
️✔️3.13
️✔️profile
️✔️latest
️✔️3.12
️✔️3.13
️✔️rdbms
️✔️latest
️✔️3.12
️✔️3.13
️✔️redis
️✔️latest
️✔️3.12
️✔️3.13
️✔️relay
️✔️latest
️✔️3.12
️✔️3.13
️✔️resource
️✔️latest
️✔️3.12
️✔️3.13
️✔️role
️✔️latest
️✔️3.12
️✔️3.13
️✔️search
️✔️latest
️✔️3.12
️✔️3.13
️✔️security
️✔️latest
️✔️3.12
️✔️3.13
️✔️servicebus
️✔️latest
️✔️3.12
️✔️3.13
️✔️serviceconnector
️✔️latest
️✔️3.12
️✔️3.13
️✔️servicefabric
️✔️latest
️✔️3.12
️✔️3.13
️✔️signalr
️✔️latest
️✔️3.12
️✔️3.13
️✔️sql
️✔️latest
️✔️3.12
️✔️3.13
️✔️sqlvm
️✔️latest
️✔️3.12
️✔️3.13
️✔️storage
️✔️latest
️✔️3.12
️✔️3.13
️✔️synapse
️✔️latest
️✔️3.12
️✔️3.13
️✔️telemetry
️✔️latest
️✔️3.12
️✔️3.13
️✔️util
️✔️latest
️✔️3.12
️✔️3.13
️✔️vm
️✔️latest
️✔️3.12
️✔️3.13

@azure-client-tools-bot-prd
Copy link

azure-client-tools-bot-prd bot commented Jul 17, 2025

️✔️AzureCLI-BreakingChangeTest
️✔️Non Breaking Changes

@yonzhan
Copy link
Collaborator

yonzhan commented Jul 17, 2025

Thank you for your contribution! We will review the pull request and get back to you soon.

@github-actions
Copy link

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).
After that please run the following commands to enable git hooks:

pip install azdev --upgrade
azdev setup -c <your azure-cli repo path> -r <your azure-cli-extensions repo path>

@microsoft-github-policy-service microsoft-github-policy-service bot added the Auto-Assign Auto assign by bot label Jul 17, 2025
@bebound bebound force-pushed the install-pymsalruntime branch from fa9bbc6 to db4386b Compare July 18, 2025 02:17
@bebound bebound changed the title [Packaging] Install pymsalruntime on Debian and Ubuntu [Packaging] Install pymsalruntime on Ubuntu Jul 30, 2025
@bebound
Copy link
Contributor Author

bebound commented Jul 30, 2025

pymsalruntime only some distros. In unsupported platform such Debian 11 or arm64, it raises

+ pip install pymsalruntime==0.18.1
ERROR: Ignored the following yanked versions: 0.13.11, 0.13.13, 0.14.1
ERROR: Could not find a version that satisfies the requirement pymsalruntime==0.18.1 (from versions: 0.3.0, 0.3.1, 0.3.2, 0.4.0, 0.5.0, 0.6.0, 0.7.0, 0.8.0, 0.8.1, 0.9.0, 0.10.0, 0.11.0, 0.11.2, 0.12.4, 0.13.0, 0.13.1, 0.13.2, 0.13.9, 0.13.12, 0.14.0, 0.14.2a1, 0.14.2, 0.15.0a1)
ERROR: No matching distribution found for pymsalruntime==0.18.1

pymsalruntime provides manylinux_2_35_x86_64.whl, which only supports glibc >=2.35. The glibc version can be find with ldd --version.

OS glibc version
Ubuntu 22.04 2.35
Ubuntu 24.04 2.39
Debian 11 2.31
Debian 12 2.36
RHEL 8 2.28
RHEL 9 2.34
RHEL 10 2.39
Azure Linux 3.0 2.38

@bebound bebound force-pushed the install-pymsalruntime branch 4 times, most recently from 0072e69 to 2544078 Compare July 31, 2025 02:31
@bebound
Copy link
Contributor Author

bebound commented Jul 31, 2025

Deb build fails after installing pymsalruntime, which should be fixed by msal.

debugedit: debian/azure-cli/opt/az/lib/python3.12/site-packages/pymsalruntime/libmsalruntime.so: Unknown DWARF DW_FORM_0x25
debugedit: Cannot handle 8-byte build ID
dh_strip: error: debugedit --build-id --build-id-seed=azure-cli/2.75.0-1\~noble debian/azure-cli/opt/az/lib/python3.12/site-packages/pymsalruntime/libmsalruntime.so returned exit code 1
dh_strip: error: Aborting due to earlier error
make[1]: Leaving directory '/mnt/repo'
make[1]: *** [debian/rules:25: override_dh_strip] Error 25
make: *** [debian/rules:8: binary] Error 2
dpkg-buildpackage: error: debian/rules binary subprocess returned exit status 2

Ref: https://dev.azure.com/azclitools/public/_build/results?buildId=264248&view=logs&j=eb02f1c3-60c9-53a0-bf8e-1053edde95f5&t=5f755f83-063d-50a3-5fe8-26188313b50b

@bebound bebound force-pushed the install-pymsalruntime branch 5 times, most recently from 377ee22 to df54281 Compare February 14, 2026 03:04
apt install -y apt-transport-https git gcc python3-dev

dpkg -i /mnt/artifacts/azure-cli_$CLI_VERSION-1~${DISTRO}_*.deb
apt-get install -y /mnt/artifacts/azure-cli_$CLI_VERSION-1~${DISTRO}_*.deb
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Use apt-get to install dependency.

dpkg -i /mnt/artifacts/azure-cli_$CLI_VERSION-1~${DISTRO}_*.deb
+ dpkg -i /mnt/artifacts/azure-cli_2.83.0-1~bookworm_arm64.deb
Selecting previously unselected package azure-cli.
(Reading database ... 16988 files and directories currently installed.)
Preparing to unpack .../azure-cli_2.83.0-1~bookworm_arm64.deb ...
Unpacking azure-cli (2.83.0-1~bookworm) ...
dpkg: dependency problems prevent configuration of azure-cli:
 azure-cli depends on libwebkit2gtk-4.1-dev; however:
  Package libwebkit2gtk-4.1-dev is not installed.

dpkg: error processing package azure-cli (--install):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 azure-cli

@bebound bebound force-pushed the install-pymsalruntime branch 2 times, most recently from bde125c to 135b861 Compare February 25, 2026 03:25
@bebound bebound force-pushed the install-pymsalruntime branch from 135b861 to 1671148 Compare February 26, 2026 03:17
${TAB}dh_clean --exclude=__pycache__
override_dh_shlibdeps:
${TAB}dh_shlibdeps --exclude=*/site-packages/pymsalruntime/*
Copy link
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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants