Skip to content

build: recreate broken local venv before runner setup#6465

Open
AlexeyKuznetsov-DD wants to merge 1 commit intomainfrom
alexeyk/auto-fix-venv
Open

build: recreate broken local venv before runner setup#6465
AlexeyKuznetsov-DD wants to merge 1 commit intomainfrom
alexeyk/auto-fix-venv

Conversation

@AlexeyKuznetsov-DD
Copy link
Contributor

@AlexeyKuznetsov-DD AlexeyKuznetsov-DD commented Mar 10, 2026

Motivation

Improve DevEx if Python updated via brew or manually.

My build failed with error like:

Build runner
dyld[21311]: Library not loaded: /opt/homebrew/Cellar/python@3.12/3.12.12_2/Frameworks/Python.framework/Versions/3.12/Python
  Referenced from: .../system-tests/venv/bin/python
  Reason: tried: '/opt/homebrew/.../Versions/3.12/Python' (no such file),
  '/System/Volumes/.../Python.framework/Versions/3.12/Python' (no such file),
  '/opt/homebrew/.../Versions/3.12/Python' (no such file)
 ./utils/build/build.sh: line 141: 21311 Abort trap: 6
 python -m pip install --upgrade pip setuptools==75.8.0
❌ Attempt 1 failed with exit code 134

Changes

Updated utils/build/build.sh to make runner environment setup resilient to stale virtualenvs.
Before using an existing venv, the script now runs a lightweight health check (venv/bin/python -V).
If that check fails, it removes and recreates venv automatically, preventing build failures caused by invalid Python paths after local Python/Homebrew upgrades.

Workflow

  1. ⚠️ Create your PR as draft ⚠️
  2. Work on you PR until the CI passes
  3. Mark it as ready for review
    • Test logic is modified? -> Get a review from RFC owner.
    • Framework is modified, or non obvious usage of it -> get a review from R&P team

🚀 Once your PR is reviewed and the CI green, you can merge it!

🛟 #apm-shared-testing 🛟

Reviewer checklist

  • Anything but tests/ or manifests/ is modified ? I have the approval from R&P team
  • A docker base image is modified?
    • the relevant build-XXX-image label is present
  • A scenario is added, removed or renamed?

@AlexeyKuznetsov-DD AlexeyKuznetsov-DD self-assigned this Mar 10, 2026
@AlexeyKuznetsov-DD AlexeyKuznetsov-DD requested a review from a team as a code owner March 10, 2026 23:05
@github-actions
Copy link
Contributor

CODEOWNERS have been resolved as:

utils/build/build.sh                                                    @DataDog/system-tests-core

@datadog-prod-us1-3
Copy link

datadog-prod-us1-3 bot commented Mar 10, 2026

✅ Tests

🎉 All green!

❄️ No new flaky tests detected
🧪 All tests passed

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 3dedb2c | Docs | Datadog PR Page | Was this helpful? React with 👍/👎 or give us feedback!

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