Skip to content

Conversation

@jiasli
Copy link
Member

@jiasli jiasli commented Jun 9, 2025

Description
msal[broker] 1.33.0b1 starts to install pymsalruntime on Linux (AzureAD/microsoft-authentication-library-for-python#766):

    # PyMsalRuntime 0.18+ is expected to support broker on Linux
    pymsalruntime>=0.18,<0.19; python_version>='3.8' and platform_system=='Linux'

but there is some problem with pymsalruntime that breaks the package build process on various Linux distributions: #31563 (comment).

As Azure CLI currently only supports broker on Windows, we only install pymsalruntime on Windows.

See

Copilot AI review requested due to automatic review settings June 9, 2025 08:08
@azure-client-tools-bot-prd
Copy link

azure-client-tools-bot-prd bot commented Jun 9, 2025

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

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

azure-client-tools-bot-prd bot commented Jun 9, 2025

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

@yonzhan
Copy link
Collaborator

yonzhan commented Jun 9, 2025

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

@github-actions
Copy link

github-actions bot commented Jun 9, 2025

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>

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR updates the MSAL dependency so that the broker extra (pymsalruntime) is only installed on Windows, while non-Windows platforms receive MSAL without the broker extra.

  • Split the msal[broker] requirement into two conditional specifiers based on sys_platform
  • Ensures Windows installs the broker-enabled MSAL; all other platforms get plain MSAL
Comments suppressed due to low confidence (1)

src/azure-cli-core/setup.py:57

  • [nitpick] Add a brief comment above these lines to explain that the broker extra is only installed on Windows, reflecting Azure CLI's current broker support limitation for future maintainers.
    'msal[broker]==1.33.0b1; sys_platform == "win32"',

'microsoft-security-utilities-secret-masker~=1.0.0b4',
'msal-extensions==1.2.0',
'msal[broker]==1.33.0b1',
'msal[broker]==1.33.0b1; sys_platform == "win32"',
Copy link

Copilot AI Jun 9, 2025

Choose a reason for hiding this comment

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

[nitpick] Consider defining the MSAL version in a single variable (e.g. msal_version = '1.33.0b1') to avoid duplicating the version string across multiple dependency lines: this makes future updates less error-prone.

Copilot uses AI. Check for mistakes.
Comment on lines +57 to +58
'msal[broker]==1.33.0b1; sys_platform == "win32"',
'msal==1.33.0b1; sys_platform != "win32"',
Copy link
Member Author

Choose a reason for hiding this comment

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

MSAL uses platform_system:

https://github.com/AzureAD/microsoft-authentication-library-for-python/blob/d49296c1b2a929a6ab11380e237daa89a5298512/setup.cfg#L69

    pymsalruntime>=0.18,<0.19; python_version>='3.8' and platform_system=='Linux'

but I prefer using sys_platform which Azure CLI has be using for a long time:

'distro; sys_platform == "linux"',

'psutil>=5.9; sys_platform != "cygwin"',

@bebound
Copy link
Contributor

bebound commented Jun 9, 2025

Need to change requirements.py3.Darwin.txt and requirements.py3.Linux.txt as well.

@jiasli
Copy link
Member Author

jiasli commented Jun 10, 2025

CI task Build Rpm Package: Azure Linux failed:

https://dev.azure.com/azclitools/public/_build/results?buildId=249351&view=logs&jobId=4ba98bd3-22e3-513f-d055-3a6f67c9317c&j=4ba98bd3-22e3-513f-d055-3a6f67c9317c&t=5d77c093-e5c0-5b36-ef73-41f3c51885e3

> [build-env 3/6] RUN tdnf install -y binutils file rpm-build gcc libffi-devel python3-devel openssl-devel make diffutils patch     dos2unix perl sed kernel-headers glibc-devel binutils ca-certificates:
20.08 Installing/Updating: rpm-build-4.18.2-1.azl3.x86_64
20.09 Installing/Updating: python3-devel-3.12.9-1.azl3.x86_64
20.12 Installing/Updating: openssl-devel-3.3.3-2.azl3.x86_64
20.68 Installing/Updating: libffi-devel-3.4.4-1.azl3.x86_64
20.69 Installing/Updating: kernel-headers-6.6.85.1-4.azl3.noarch
20.83 Installing/Updating: dos2unix-7.5.1-1.azl3.x86_64
20.85 Installing/Updating: glibc-devel-2.38-10.azl3.x86_64
20.91 Installing/Updating: ca-certificates-1:3.0.0-8.azl3.noarch
21.48 Installing/Updating: systemd-rpm-macros-255-21.azl3.noarch
23.18 Error(1525) : rpm transaction failed

This seems to be microsoft/azurelinux#13971.

@jiasli
Copy link
Member Author

jiasli commented Jun 10, 2025

CI task Test Homebrew Formula failed:

https://dev.azure.com/azclitools/public/_build/results?buildId=249351&view=logs&j=ebe8970d-a8af-5d7e-4086-8f4ce0be006b&t=3f22f999-770c-5d06-3bb8-1a936f5d8384

echo == Install azure-cli.rb formula ==
brew install --build-from-source $SYSTEM_ARTIFACTSDIRECTORY/homebrew/azure-cli.rb
== Install azure-cli.rb formula ==
Error: azure-cli: 'because' argument should use valid symbol or a string!

@jiasli
Copy link
Member Author

jiasli commented Jun 10, 2025

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@jiasli jiasli merged commit 31e701c into Azure:dev Jun 10, 2025
78 of 80 checks passed
@jiasli jiasli deleted the pymsalruntime branch June 10, 2025 07:21
bebound added a commit that referenced this pull request Dec 2, 2025
…e to 0.18.1, only install `pymsalruntime` on Windows (#32460)
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.

4 participants