mach: recreate .venv when .python-version changes (#34712)

The new images published in servo/ci-runners#12 should have `uv`
installed already and the initial build of servo triggered during the
base image construction will force the installation of the Python
version mentioned at the time of the image construction (3.12). When
.python-version changes, we can no longer use the .venv baked into the
image and must recreate the it to avoid activating the environment.

Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>
This commit is contained in:
Mukilan Thiyagarajan 2024-12-20 15:25:21 +05:30 committed by GitHub
parent 50c9c72778
commit adfee3daa5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
12 changed files with 46 additions and 46 deletions

View file

@ -80,18 +80,18 @@ jobs:
run: cargo install --path support/crown
- name: Bootstrap
run: |
python3 ./mach bootstrap --skip-lints
./mach bootstrap --skip-lints
brew install gnu-tar
- name: Build (${{ inputs.profile }})
run: |
python3 ./mach build --use-crown --locked --${{ inputs.profile }}
./mach build --use-crown --locked --${{ inputs.profile }}
cp -r target/cargo-timings target/cargo-timings-macos
- name: Smoketest
uses: nick-fields/retry@v3
with: # See https://github.com/servo/servo/issues/30757
timeout_minutes: 5
max_attempts: 2
command: python3 ./mach smoketest --${{ inputs.profile }}
command: ./mach smoketest --${{ inputs.profile }}
- name: Script tests
run: ./mach test-scripts
- name: Unit tests
@ -100,9 +100,9 @@ jobs:
with:
timeout_minutes: 40 # https://github.com/servo/servo/issues/30275
max_attempts: 3 # https://github.com/servo/servo/issues/30683
command: python3 ./mach test-unit --${{ inputs.profile }}
command: ./mach test-unit --${{ inputs.profile }}
- name: Build mach package
run: python3 ./mach package --${{ inputs.profile }}
run: ./mach package --${{ inputs.profile }}
- name: Run DMG smoketest
uses: nick-fields/retry@v3
with: # See https://github.com/servo/servo/issues/30757
@ -123,7 +123,7 @@ jobs:
- name: Upload nightly
if: ${{ inputs.upload }}
run: |
python3 ./mach upload-nightly mac --secret-from-environment \
./mach upload-nightly mac --secret-from-environment \
--github-release-id ${{ inputs.github-release-id }}
env:
S3_UPLOAD_CREDENTIALS: ${{ secrets.S3_UPLOAD_CREDENTIALS }}