Skip to content

Commit 524d05b

Browse files
authored
Install symlink to Python 3 to work around AzP diff coverage issue (#3803)
What I did In Azure Pipelines, the PythonScript task appears to default to expecting the Python interpreter to be present at /usr/bin/python. This task type is used as part of diff coverage reporting. However, on Ubuntu 22.04 and newer, only Python 3 is present by default, which means /usr/bin/python isn't present. As a workaround, install the python-is-python3 package, which just adds a symlink from /usr/bin/python to /usr/bin/python3. This makes the PythonScript task happy now that it can run Python commands using the interpreter at /usr/bin/python. When the steps that add the diff coverage task set pythonInterpreter: '/usr/bin/python3' so that PythonScript runs the script using /usr/bin/python3, or PythonScript falls back to looking for /usr/bin/python3 if /usr/bin/python is not present, then this workaround can be removed.
1 parent 83464ce commit 524d05b

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

.azure-pipelines/test-docker-sonic-vs-template.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,3 +215,8 @@ jobs:
215215
displayName: "Check ASAN reports"
216216
condition: eq('${{ parameters.asan }}', true)
217217
continueOnError: true
218+
219+
- script: |
220+
sudo apt-get -o DPkg::Lock::Timeout=600 install -y python-is-python3
221+
222+
displayName: "Install temporary workaround to add a symlink to python 3"

0 commit comments

Comments
 (0)