Skip to content

Conversation

@qiluo-msft
Copy link
Collaborator

Why I did it

If one python wheel is already installed inside slave container, it will not install again. Below is a sample log:

sed: -e expression #1, char 11: extra characters after command
WARNING: The directory '/var/user/.cache/pip' or its parent directory is not owned or is not writable by the current user. The cache has been disabled. Check the permissions and owner of that directory. If executing pip with sudo, you should use sudo's -H flag.
Processing ./target/python-wheels/bookworm/sonic_yang_models-1.0-py3-none-any.whl
sonic-yang-models is already installed with the same version as the provided wheel. Use --force-reinstall to force an installation of the wheel.
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager, possibly rendering your system unusable.It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv. Use the --root-user-action option if you know what you are doing and want to suppress this warning.

[notice] A new release of pip is available: 24.2 -> 25.3
[notice] To update, run: python3 -m pip install --upgrade pip
Build end time: Wed Dec 3 22:53:07 UTC 2025
Elapsed time: 0h 0m 1s

However, we expect to reinstall the python wheel for target $(PYTHON_WHEELS_PATH)/%-install

Work item tracking
  • Microsoft ADO (number only):

How I did it

Update slave.mk to enasure force install the python wheel.

How to verify it

After this change, local build will successfully force install the python wheel. See new logs:

sed: -e expression #1, char 11: extra characters after command
WARNING: The directory '/var/qiluo/.cache/pip' or its parent directory is not owned or is not writable by the current user. The cache has been disabled. Check the permissions and owner of that directory. If executing pip with sudo, you should use sudo's -H flag.
Processing ./target/python-wheels/bookworm/sonic_yang_models-1.0-py3-none-any.whl
Installing collected packages: sonic-yang-models
  Attempting uninstall: sonic-yang-models
    Found existing installation: sonic-yang-models 1.0
    Uninstalling sonic-yang-models-1.0:
      Successfully uninstalled sonic-yang-models-1.0
Successfully installed sonic-yang-models-1.0
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager, possibly rendering your system unusable.It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv. Use the --root-user-action option if you know what you are doing and want to suppress this warning.

[notice] A new release of pip is available: 24.2 -> 25.3
[notice] To update, run: python3 -m pip install --upgrade pip
Build end time: Wed Dec 3 23:59:31 UTC 2025

Which release branch to backport (provide reason below if selected)

  • 202205
  • 202211
  • 202305
  • 202311
  • 202405
  • 202411
  • 202505

Tested branch (Please provide the tested image version)

Description for the changelog

Link to config_db schema for YANG module changes

A picture of a cute animal (not mandatory but encouraged)

@mssonicbld
Copy link
Collaborator

/azp run Azure.sonic-buildimage

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link
Collaborator

/azp run Azure.sonic-buildimage

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

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 fixes an issue where Python wheels are not reinstalled during the build process if they're already installed in the slave container. The fix adds the --force-reinstall flag to the pip install command to ensure wheels are always reinstalled for the $(PYTHON_WHEELS_PATH)/%-install target.

Key changes:

  • Added --force-reinstall flag to pip install command in the standard build path

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Co-authored-by: Copilot <[email protected]>
@mssonicbld
Copy link
Collaborator

/azp run Azure.sonic-buildimage

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Co-authored-by: Copilot <[email protected]>
@mssonicbld
Copy link
Collaborator

/azp run Azure.sonic-buildimage

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@qiluo-msft qiluo-msft marked this pull request as ready for review December 4, 2025 00:43
Copilot AI review requested due to automatic review settings December 4, 2025 00:43
Copilot finished reviewing on behalf of qiluo-msft December 4, 2025 00:45
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

Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@qiluo-msft qiluo-msft marked this pull request as draft December 4, 2025 02:06
@mssonicbld
Copy link
Collaborator

/azp run Azure.sonic-buildimage

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants