diff --git a/.github/workflows/bazelBuildAndTest.yml b/.github/workflows/bazelBuildAndTest.yml index 43630adcb..d0d11ad5a 100644 --- a/.github/workflows/bazelBuildAndTest.yml +++ b/.github/workflows/bazelBuildAndTest.yml @@ -58,6 +58,18 @@ jobs: -t torch-mlir:ci \ . + - name: Verify buildifier was run (bazel lint) + run: | + docker run --rm \ + -v "$(pwd)":"/opt/src/torch-mlir" \ + -v "${HOME}/.cache/bazel":"/root/.cache/bazel" \ + torch-mlir:ci \ + bazel run @torch-mlir//:buildifier + if [ -n "$(git status --porcelain)" ]; then + echo "Please 'bazel run @torch-mlir//:buildifier' and commit changes." + exit 1 + fi + - name: Bazel build torch-mlir run: | docker run --rm \ @@ -74,18 +86,6 @@ jobs: torch-mlir:ci \ bazel test @torch-mlir//test/... - - name: Verify buildifier was run (bazel lint) - run: | - docker run --rm \ - -v "$(pwd)":"/opt/src/torch-mlir" \ - -v "${HOME}/.cache/bazel":"/root/.cache/bazel" \ - torch-mlir:ci \ - bazel run @torch-mlir//:buildifier - if [ -n "$(git status --porcelain)" ]; then - echo "Please 'bazel run @torch-mlir//:buildifier' and commit changes." - exit 1 - fi - # Switch back bazel cache directory to user ownership # to allow GHA post-cache step to save cache without # permissions issue. diff --git a/utils/bazel/WORKSPACE.bazel b/utils/bazel/WORKSPACE.bazel index 374de7d39..910f86ec6 100644 --- a/utils/bazel/WORKSPACE.bazel +++ b/utils/bazel/WORKSPACE.bazel @@ -24,7 +24,7 @@ new_local_repository( path = "../../externals/llvm-project", ) -load("@llvm-raw//utils/bazel:configure.bzl", "llvm_configure", "llvm_disable_optional_support_deps") +load("@llvm-raw//utils/bazel:configure.bzl", "llvm_configure") llvm_configure( name = "llvm-project", @@ -36,8 +36,6 @@ llvm_configure( ], ) -llvm_disable_optional_support_deps() - local_repository( name = "mlir-hlo", path = "../../externals/mlir-hlo/", @@ -125,3 +123,14 @@ maybe( "https://github.com/facebook/zstd/releases/download/v1.5.2/zstd-1.5.2.tar.gz", ], ) + +maybe( + http_archive, + name = "llvm_zlib", + build_file = "@llvm-raw//utils/bazel/third_party_build:zlib-ng.BUILD", + sha256 = "e36bb346c00472a1f9ff2a0a4643e590a254be6379da7cddd9daeb9a7f296731", + strip_prefix = "zlib-ng-2.0.7", + urls = [ + "https://github.com/zlib-ng/zlib-ng/archive/refs/tags/2.0.7.zip", + ], +) diff --git a/utils/bazel/torch-mlir-overlay/BUILD.bazel b/utils/bazel/torch-mlir-overlay/BUILD.bazel index abfd3ea61..233532f90 100644 --- a/utils/bazel/torch-mlir-overlay/BUILD.bazel +++ b/utils/bazel/torch-mlir-overlay/BUILD.bazel @@ -104,6 +104,7 @@ cc_library( deps = [ ":MLIRTorchOpsIncGen", ":MLIRTorchTypesIncGen", + "@llvm-project//mlir:CastInterfaces", "@llvm-project//mlir:ControlFlowInterfaces", "@llvm-project//mlir:IR", "@llvm-project//mlir:InferTypeOpInterface", @@ -826,6 +827,7 @@ cc_binary( ":TorchMLIRInitAll", ":TorchMLIRTorchDialect", ":TorchMLIRTorchPasses", + "@llvm-project//mlir:AllExtensions", "@llvm-project//mlir:AllPassesAndDialects", "@llvm-project//mlir:MlirOptLib", ],