Skip to content

Commit

Permalink
[ci] fix build llvm on macos 13
Browse files Browse the repository at this point in the history
  • Loading branch information
PikachuHy committed Jan 20, 2024
1 parent 7d64697 commit d62f842
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 2 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/macos_bazel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@ jobs:
- name: Test
run: bazel test \:all --config=macos --test_output=errors

- name: Build with MLIR
run: bazel build \:all --config=macos --define codegen=mlir

- name: Test with MLIR
run: bazel test \:all --config=macos --define codegen=mlir --test_output=errors

- name: Build ios App
# build with c++20
# workaround from https://github.com/bazelbuild/bazel/issues/12716#issuecomment-1113754835
Expand Down
Empty file added 3rd/patch/BUILD.bazel
Empty file.
13 changes: 13 additions & 0 deletions 3rd/patch/llvm/fix_build_on_macos_13.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff mlir/lib/Dialect/SparseTensor/Transforms/SparseTensorRewriting.cpp mlir/lib/Dialect/SparseTensor/Transforms/SparseTensorRewriting.cpp
index ebbe88ee9029..21e128d61cc6 100644
--- mlir/lib/Dialect/SparseTensor/Transforms/SparseTensorRewriting.cpp
+++ mlir/lib/Dialect/SparseTensor/Transforms/SparseTensorRewriting.cpp
@@ -1094,7 +1094,7 @@ private:
});
rewriter.setInsertionPointAfter(op);
src = rewriter.create<LoadOp>(loc, foreachOp.getResult(0), true);
- if (bufferTp != dstTp) {
+ if (bufferTp != dstTp.getRankedTensorType()) {
rewriter.replaceOpWithNewOp<ConvertOp>(op, dstTp.getRankedTensorType(),
src);
rewriter.create<DeallocTensorOp>(loc, src);
7 changes: 5 additions & 2 deletions WORKSPACE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,9 @@ new_git_repository(
name = "llvm-raw",
build_file_content = "# empty",
commit = "6009708b4367171ccdbf4b5905cb6a803753fe18",
patches = [
"@dev_pscm//3rd/patch:llvm/fix_build_on_macos_13.patch",
],
remote = "https://github.com/llvm/llvm-project.git"
)

Expand Down Expand Up @@ -319,6 +322,6 @@ maybe(
sha256 = "7c42d56fac126929a6a85dbc73ff1db2411d04f104fae9bdea51305663a83fd0",
strip_prefix = "zstd-1.5.2",
urls = [
"https://github.com/facebook/zstd/releases/download/v1.5.2/zstd-1.5.2.tar.gz"
"https://github.com/facebook/zstd/releases/download/v1.5.2/zstd-1.5.2.tar.gz",
],
)
)

0 comments on commit d62f842

Please sign in to comment.