6 Commits

Author SHA1 Message Date
Keith Smiley
5d0957fc23
[bazel] Allow overriding py_test rule for lit_test (#119460)
This allows replacing this implementation with another one, such as the
one from aspect_rules_py
2024-12-10 14:22:15 -08:00
Keith Smiley
3903cb4695
[bazel] Use rules_python load statements (#113213)
With bazel 8.x these are strongly encouraged, and this disambiguates
which version of these rules we get for older versions. Specifically the
native.py_test was using the wrong version of py_test.
2024-10-21 13:19:21 -07:00
Abhinav Gunjal
dd5797505e
lit_test : check if there is already a deps key in kwargs (#87290)
This change checks if there is already a `deps` key in `kwargs` and
concatenate it to avoid multiple values for `deps` key argument.

background:
https://github.com/llvm/llvm-project/pull/87022 recently added explicit
`deps` to the lit_test. This is causing StableHLO bazel build failures
at
https://github.com/openxla/stablehlo/actions/runs/8511888283/job/23312383380?pr=2147

Tested: local build run is successful
2024-04-01 19:36:09 -05:00
Keith Smiley
89bae852dd
[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
2024-03-28 19:07:22 -07:00
Christian Sigg
a6e91040ea [Bazel] Allow lit_test() macro to be used from other repos.
Wrap implicit dependencies in Label() so that they refer to @llvm-project, see https://bazel.build/rules/lib/Label#Label.

This change allows lit_test() to be used from other bazel repositories.
2022-09-17 11:06:07 +02:00
Christian Sigg
70ac466676 [Bazel] Add lit tests to bazel builds.
Add BUILD.bazel files for most of the MLIR tests and lit tests itself.

Reviewed By: mehdi_amini

Differential Revision: https://reviews.llvm.org/D133455
2022-09-15 07:49:37 +02:00