Skip to content

Commit 48e8467

Browse files
authored
Merge pull request #10894 from The-OpenROAD-Project-staging/bazel-test-no-pyc-writeback
test: suppress .pyc writeback in bazel test runs
2 parents 12073df + 7354256 commit 48e8467

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

test/bazel_test.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,12 @@ export RESULTS_DIR="${TEST_UNDECLARED_OUTPUTS_DIR}/results"
99
export REGRESSION_TEST=$(realpath $REGRESSION_TEST)
1010
if [ -n "${TEST_SRCDIR:-}" ]; then
1111
export BAZEL_TEST=1
12+
# Tests cd into their source directory, so importing a shared helper
13+
# (helpers.py, ppl_aux.py, ...) makes CPython write __pycache__ .pyc
14+
# files back into the source tree mid-action. Bazel then sees a
15+
# concurrent modification and skips caching the result
16+
# (--guard_against_concurrent_changes). Suppress bytecode writing.
17+
export PYTHONDONTWRITEBYTECODE=1
1218
workspace_root="${TEST_SRCDIR}/${TEST_WORKSPACE:-_main}"
1319
python_paths="${workspace_root}"
1420
if [ -d "${workspace_root}/python" ]; then

0 commit comments

Comments
 (0)