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

[Build]: Fix the unexpected version of the python packages installed issue #9019

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

xumia
Copy link
Collaborator

@xumia xumia commented Oct 20, 2021

Why I did it

Fix the unexpected version of the python packages installed issue.

It is expected the redis=3.5.3 should be installed in branch 202012, see https://github.com/Azure/sonic-buildimage/blob/82d0539c4eb2634f66458ac1bdd83c616fe595dd/files/build/versions/build/build-sonic-slave-buster/versions-py2#L11, but the version 4.0.0b1 installed, see build: https://dev.azure.com/mssonic/build/_build/results?buildId=44510&view=logs&j=88ce9a53-729c-5fa9-7b6e-3d98f2488e3f&t=8d99be27-49d0-54d0-99b1-cfc0d47f0318

Error logs in detail:

[ building ] [ target/python-wheels/redis_dump_load-1.1-py2-none-any.whl ] 
Applying patch ../redis-dump-load.patch/0001-Use-pipelines-when-dumping-52.patch
patching file redisdl.py

Applying patch ../redis-dump-load.patch/0002-Fix-setup.py-for-test-and-bdist_wheel.patch
patching file setup.py

Now at patch ../redis-dump-load.patch/0002-Fix-setup.py-for-test-and-bdist_wheel.patch
[ finished ] [ target/python-wheels/redis_dump_load-1.1-py2-none-any.whl ] 
[ FAIL LOG START ] [ target/python-wheels/redis_dump_load-1.1-py2-none-any.whl ]
[ REASON ] :      target/python-wheels/redis_dump_load-1.1-py2-none-any.whl does not exist  
[ FLAGS  FILE    ] : [] 
[ FLAGS  DEPENDS ] : [broadcom] 
[ FLAGS  DIFF    ] : [broadcom ] 
/sonic/src/redis-dump-load /sonic
running test
Searching for redis
Reading https://pypi.org/simple/redis/
Downloading https://files.pythonhosted.org/packages/62/ab/6491b41bbfb938afbc4424164983d1def3c59434c77e8cf710213be03fed/redis-4.0.0b1.tar.gz#sha256=f778e27d542ba1f43a6b02a80fa904d8a49e5d3b824ec5fb3f0d5cbdba11e4cd
Best match: redis 4.0.0b1
Processing redis-4.0.0b1.tar.gz
Writing /tmp/easy_install-SncEVh/redis-4.0.0b1/setup.cfg
Running redis-4.0.0b1/setup.py -q bdist_egg --dist-dir /tmp/easy_install-SncEVh/redis-4.0.0b1/egg-dist-tmp-ERmW81
Traceback (most recent call last):
  File "setup.py", line 41, in <module>
    'Topic :: System :: Archiving',

How I did it

Install the packages before building the targets using the pip command.

How to verify it

Verified it in 202012 branch.

  1. Revoke the patch 8555e41, to reproduce the issue
  2. It will be fixed after applying the current fix.

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

  • 201811
  • 201911
  • 202006
  • 202012
  • 202106

Description for the changelog

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

@xumia xumia requested a review from qiluo-msft October 20, 2021 09:44
@xumia xumia changed the title [Build]: Fix the unexpected python packages installed issue [Build]: Fix the unexpected version of the python packages installed issue Oct 20, 2021
@qiluo-msft
Copy link
Collaborator

qiluo-msft commented Oct 20, 2021

You may revert the old fix in this PR


In reply to: 947593834

@xumia
Copy link
Collaborator Author

xumia commented Oct 22, 2021

You may revert the old fix in this PR

@qiluo-msft , this fix is only for the branches with reproducible feature enabled, the feature is not enabled in master, we still need the previous fix. We can only revert the previous fix in 202012 branch.

([ "$ENABLE_VERSION_CONTROL_DEB" == "y" ] && [ -f $VERSION_DEB_PREFERENCE ]) && sudo cp -f $VERSION_DEB_PREFERENCE /etc/apt/preferences.d/

# Install the python packages if existing, skipping none existing packages
([ "$ENABLE_VERSION_CONTROL_PY2" == "y" ] && [ -f $BUILDINFO_PATH/versions/versions-py2 ]) && filter_packages $BUILDINFO_PATH/versions/versions-py2 | xargs -n 1 pip2 install >>$LOG_PATH/error.log 2>&1
Copy link
Collaborator

Choose a reason for hiding this comment

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

$LOG_PATH/error.log

Do you want to make sure the file is emtpy before using it?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@qiluo-msft , we only append the logs in the file, not overwrite it, do you think it is good or not?

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.

2 participants