Skip to content

Commit

Permalink
Fix test source directory
Browse files Browse the repository at this point in the history
Please see bazelbuild/bazel#18128
Workspace names are going away.
  • Loading branch information
fzakaria committed Feb 13, 2024
1 parent 8e1183a commit 086cee7
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 11 deletions.
10 changes: 7 additions & 3 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,15 @@
# For more details, please check https://github.com/bazelbuild/bazel/issues/18958
###############################################################################
bazel_dep(name = "bazel_skylib", version = "1.3.0")

bazel_dep(name = "rules_python", version = "0.30.0")

python = use_extension("@rules_python//python/extensions:python.bzl", "python")

# There is a problem at the moment running lit using Python311
# Our CI system enforces Python310 to get around it but we should set the toolchain
# in Bazel itself to avoid this problem.
# https://github.com/llvm/llvm-project/issues/75963
python.toolchain(
python_version = "3.10",
is_default = True,
)
python_version = "3.10",
)
4 changes: 2 additions & 2 deletions stablehlo/conversions/linalg/tests/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ expand_template(
testonly = True,
out = "lit.site.cfg.py",
substitutions = {
"\"@STABLEHLO_SOURCE_DIR@\"": "os.path.join(os.environ['TEST_SRCDIR'], 'stablehlo')",
"\"@STABLEHLO_TOOLS_DIR@\"": "os.path.join(os.environ['TEST_SRCDIR'], 'stablehlo')",
"\"@STABLEHLO_SOURCE_DIR@\"": "os.path.join(os.environ['TEST_SRCDIR'], '_main')",
"\"@STABLEHLO_TOOLS_DIR@\"": "os.path.join(os.environ['TEST_SRCDIR'], '_main')",
"@LIT_SITE_CFG_IN_HEADER@": "# Autogenerated, do not edit.",
"@LLVM_TOOLS_DIR@": package_path("@llvm-project//llvm:BUILD"),
},
Expand Down
4 changes: 2 additions & 2 deletions stablehlo/conversions/tosa/tests/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ expand_template(
testonly = True,
out = "lit.site.cfg.py",
substitutions = {
"\"@STABLEHLO_SOURCE_DIR@\"": "os.path.join(os.environ['TEST_SRCDIR'], 'stablehlo')",
"\"@STABLEHLO_TOOLS_DIR@\"": "os.path.join(os.environ['TEST_SRCDIR'], 'stablehlo')",
"\"@STABLEHLO_SOURCE_DIR@\"": "os.path.join(os.environ['TEST_SRCDIR'], '_main')",
"\"@STABLEHLO_TOOLS_DIR@\"": "os.path.join(os.environ['TEST_SRCDIR'], '_main')",
"@LIT_SITE_CFG_IN_HEADER@": "# Autogenerated, do not edit.",
"@LLVM_TOOLS_DIR@": package_path("@llvm-project//llvm:BUILD"),
},
Expand Down
4 changes: 2 additions & 2 deletions stablehlo/testdata/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ expand_template(
testonly = True,
out = "lit.site.cfg.py",
substitutions = {
"\"@STABLEHLO_SOURCE_DIR@\"": "os.path.join(os.environ['TEST_SRCDIR'], 'stablehlo')",
"\"@STABLEHLO_TOOLS_DIR@\"": "os.path.join(os.environ['TEST_SRCDIR'], 'stablehlo')",
"\"@STABLEHLO_SOURCE_DIR@\"": "os.path.join(os.environ['TEST_SRCDIR'], '_main')",
"\"@STABLEHLO_TOOLS_DIR@\"": "os.path.join(os.environ['TEST_SRCDIR'], '_main')",
"@LIT_SITE_CFG_IN_HEADER@": "# Autogenerated, do not edit.",
"@LLVM_TOOLS_DIR@": package_path("@llvm-project//llvm:BUILD"),
},
Expand Down
4 changes: 2 additions & 2 deletions stablehlo/tests/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,8 @@ expand_template(
testonly = True,
out = "lit.site.cfg.py",
substitutions = {
"\"@STABLEHLO_SOURCE_DIR@\"": "os.path.join(os.environ['TEST_SRCDIR'], 'stablehlo')",
"\"@STABLEHLO_TOOLS_DIR@\"": "os.path.join(os.environ['TEST_SRCDIR'], 'stablehlo')",
"\"@STABLEHLO_SOURCE_DIR@\"": "os.path.join(os.environ['TEST_SRCDIR'], '_main')",
"\"@STABLEHLO_TOOLS_DIR@\"": "os.path.join(os.environ['TEST_SRCDIR'], '_main')",
"@LIT_SITE_CFG_IN_HEADER@": "# Autogenerated, do not edit.",
"@LLVM_TOOLS_DIR@": package_path("@llvm-project//llvm:BUILD"),
},
Expand Down

0 comments on commit 086cee7

Please sign in to comment.