Skip to content
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

{Packaging} Prioritize official package over the dist one #20557

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

orgads
Copy link
Contributor

@orgads orgads commented Nov 30, 2021

Description
The unofficial package can have a version that is greater than
the official one, and the latest version is installed by default.

Solve by assigning the official repository high priority.


This checklist is used to make sure that common guidelines for a pull request are followed.

The unofficial package can have a version that is greater than
the official one, and the latest version is installed by default.

Solve by assigning the official repository high priority.
@ghost ghost added the customer-reported Issues that are reported by GitHub users external to the Azure organization. label Nov 30, 2021
@ghost
Copy link

ghost commented Nov 30, 2021

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

@orgads
Copy link
Contributor Author

orgads commented Nov 30, 2021

I'm not sure if this is considered a "customer facing" change. This fixes a bug in debian testing/sid (Debian stable and ubuntu have older versions, so they're not affected). Should I change it to [] and add a history section?

@yonzhan
Copy link
Collaborator

yonzhan commented Nov 30, 2021

@jiasli for awareness

@yonzhan yonzhan added this to the Dec 2021 (2022-01-04) milestone Nov 30, 2021
@jiasli
Copy link
Member

jiasli commented Nov 30, 2021

I saw python3-azure-cli (2.30.0-2) is distributed at https://packages.debian.org/sid/python3-azure-cli.

I am able to repro:

> docker run -it --rm debian:sid

# apt-get update
# apt-get install curl --yes
# curl -sL https://aka.ms/InstallAzureCLIDeb | bash

# az -v
azure-cli                         2.30.0

core                              2.30.0
telemetry                          1.0.6

Extensions:
azure-devops                      0.22.0

Python location '/usr/bin/python3'
Extensions directory '/root/.azure/cliextensions'
Extensions system directory '/usr/lib/python3/dist-packages/azure-cli-extensions'

# apt-cache policy azure-cli
azure-cli:
  Installed: 2.30.0-2
  Candidate: 2.30.0-2
  Version table:
 *** 2.30.0-2 500
        500 http://deb.debian.org/debian sid/main amd64 Packages
        100 /var/lib/dpkg/status
     2.30.0-1~buster 500
        500 https://packages.microsoft.com/repos/azure-cli buster/main amd64 Packages
        500 https://packages.microsoft.com/repos/azure-cli buster/main all Packages

Notice the system /usr/bin/python3 is used, instead of our bundled /opt/az/bin/python3.

@bluca, I think this is causing problem for Debian sid users as they can't install from Microsoft official repo https://packages.microsoft.com/ by default.

Comment on lines +86 to +89
echo 'Package: azure-cli
Pin: origin "packages.microsoft.com"
Pin-Priority: 1001' \
> /etc/apt/preferences.d/azure-cli
Copy link
Member

@jiasli jiasli Nov 30, 2021

Choose a reason for hiding this comment

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

Copy link
Member

@jiasli jiasli Jun 15, 2022

Choose a reason for hiding this comment

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

Meaning of 1001:

P >= 1000
causes a version to be installed even if this constitutes a downgrade of the package

This makes sure the unofficial ones are removed and replaced by our official one.

@jiasli
Copy link
Member

jiasli commented Jun 15, 2022

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 2 pipeline(s).

@jiasli
Copy link
Member

jiasli commented Jun 15, 2022

This script currently is not uploaded automatically to https://aka.ms/InstallAzureCLIDeb. I have updated the release pipeline to do that automatically during each release: https://dev.azure.com/azure-sdk/internal/_releaseDefinition?definitionId=78&_a=definition-tasks&environmentId=159

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
customer-reported Issues that are reported by GitHub users external to the Azure organization. do-not-merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants