Skip to content

Commit 3b76ec2

Browse files
author
Release Manager
committed
gh-40821: Devcontainer: use devcontainer id as key for venv and build directory ... otherwise different devcontainers would try to reuse the same venv/build directory - which will not work as the underlying os of the devcontainer can be quite different. <!-- ^ Please provide a concise and informative title. --> <!-- ^ Don't put issue numbers in the title, do this in the PR description below. --> <!-- ^ For example, instead of "Fixes #12345" use "Introduce new method to calculate 1 + 2". --> <!-- v Describe your changes below in detail. --> <!-- v Why is this change required? What problem does it solve? --> <!-- v If this PR resolves an open issue, please link to it here. For example, "Fixes #12345". --> ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. --> - [ ] The title is concise and informative. - [ ] The description explains in detail what this PR is about. - [ ] I have linked a relevant issue or discussion. - [ ] I have created tests covering the changes. - [ ] I have updated the documentation and checked the documentation preview. ### ⌛ Dependencies <!-- List all open PRs that this PR logically depends on. For example, --> <!-- - #12345: short description why this is a dependency --> <!-- - #34567: ... --> URL: #40821 Reported by: Tobias Diez Reviewer(s): Dima Pasechnik
2 parents 1eb2b9a + 90f6c93 commit 3b76ec2

File tree

8 files changed

+32
-3
lines changed

8 files changed

+32
-3
lines changed

.devcontainer/onCreate-meson.sh

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
SYSTEM=$(build/bin/sage-guess-package-system)
44

5-
if [ "$SYSTEM" = "fedora" ]; then
5+
if [ "$SYSTEM" = "fedora" ] && [ -f /etc/fedora-release ]; then
66
# Need to use --setopt=tsflags="" to avoid errors with gphelp
77
dnf5 install -y pari-gp --setopt=tsflags=""
88

@@ -16,7 +16,8 @@ eval $(build/bin/sage-print-system-package-command $SYSTEM --yes --ignore-missin
1616

1717
# Disable build isolation following the advice of https://mesonbuild.com/meson-python/how-to-guides/editable-installs.html#build-dependencies
1818
# Install build dependencies manually as workaround for https://github.com/astral-sh/uv/issues/1516
19-
uv venv
19+
uv venv --clear
20+
. $UV_PROJECT_ENVIRONMENT/bin/activate # https://github.com/astral-sh/uv/issues/14022
2021
uv pip install \
2122
meson-python \
2223
"cypari2 >=2.2.1" \
@@ -27,4 +28,4 @@ uv pip install \
2728
"numpy >=1.25" \
2829
jinja2 \
2930
setuptools
30-
uv sync --frozen --inexact --no-build-isolation --config-settings=builddir=build/build-$SYSTEM
31+
uv sync --frozen --inexact --no-build-isolation -v --config-settings=builddir=build/build-$SYSTEM-$devcontainerId

.devcontainer/portability-archlinux/devcontainer.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@
1313
"version": "latest"
1414
}
1515
},
16+
"containerEnv": {
17+
"devcontainerId": "${devcontainerId}",
18+
"UV_PROJECT_ENVIRONMENT": ".venv-${devcontainerId}"
19+
},
1620
"customizations": {
1721
"vscode": {
1822
"extensions": [

.devcontainer/portability-fedora-41/devcontainer.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@
1010
"version": "latest"
1111
}
1212
},
13+
"containerEnv": {
14+
"devcontainerId": "${devcontainerId}",
15+
"UV_PROJECT_ENVIRONMENT": ".venv-${devcontainerId}"
16+
},
1317
"customizations": {
1418
"vscode": {
1519
"extensions": [

.devcontainer/portability-fedora-42/devcontainer.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@
1010
"version": "latest"
1111
}
1212
},
13+
"containerEnv": {
14+
"devcontainerId": "${devcontainerId}",
15+
"UV_PROJECT_ENVIRONMENT": ".venv-${devcontainerId}"
16+
},
1317
"customizations": {
1418
"vscode": {
1519
"extensions": [

.devcontainer/portability-ubuntu-2204/devcontainer.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@
1010
"version": "latest"
1111
}
1212
},
13+
"containerEnv": {
14+
"devcontainerId": "${devcontainerId}",
15+
"UV_PROJECT_ENVIRONMENT": ".venv-${devcontainerId}"
16+
},
1317
"customizations": {
1418
"vscode": {
1519
"extensions": [

.devcontainer/portability-ubuntu-2404/devcontainer.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@
1010
"version": "latest"
1111
}
1212
},
13+
"containerEnv": {
14+
"devcontainerId": "${devcontainerId}",
15+
"UV_PROJECT_ENVIRONMENT": ".venv-${devcontainerId}"
16+
},
1317
"customizations": {
1418
"vscode": {
1519
"extensions": [

.devcontainer/portability-ubuntu-2504/devcontainer.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@
1010
"version": "latest"
1111
}
1212
},
13+
"containerEnv": {
14+
"devcontainerId": "${devcontainerId}",
15+
"UV_PROJECT_ENVIRONMENT": ".venv-${devcontainerId}"
16+
},
1317
"customizations": {
1418
"vscode": {
1519
"extensions": [

.devcontainer/portability-void/devcontainer.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@
1414
"version": "latest"
1515
}
1616
},
17+
"containerEnv": {
18+
"devcontainerId": "${devcontainerId}",
19+
"UV_PROJECT_ENVIRONMENT": ".venv-${devcontainerId}"
20+
},
1721
"customizations": {
1822
"vscode": {
1923
"extensions": [

0 commit comments

Comments
 (0)