[all-commits] [llvm/llvm-project] 89bae8: [bazel] Fix lit tests with python 3.11+ (#87022)

Keith Smiley via All-commits all-commits at lists.llvm.org
Thu Mar 28 19:07:43 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 89bae852dddeb2b66a1843dbe5eea21184e54814
      https://github.com/llvm/llvm-project/commit/89bae852dddeb2b66a1843dbe5eea21184e54814
  Author: Keith Smiley <keithbsmiley at gmail.com>
  Date:   2024-03-28 (Thu, 28 Mar 2024)

  Changed paths:
    M utils/bazel/llvm-project-overlay/llvm/BUILD.bazel
    M utils/bazel/llvm-project-overlay/llvm/lit_test.bzl

  Log Message:
  -----------
  [bazel] Fix lit tests with python 3.11+ (#87022)

In python3.11 there is a new environment variable PYTHONSAFEPATH which
stops python from setting the current directory as the first entry in
sys.path. Bazel started setting this to ensure that python targets
don't accidentally access things that aren't in their dependency tree.
This resulted in lit tests breaking because sys.path didn't include the
directory to the lit source files. This is fixed by adding the lit
binary to the dependency tree and propagating the import path from it.

Fixes https://github.com/llvm/llvm-project/issues/75963



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list