Skip to content

Commit f1966f8

Browse files
authored
Merge pull request #1 from tangm/m1fix
Update m1 fix to match current google/ml-metadata
2 parents 35806b4 + 37f2415 commit f1966f8

File tree

8 files changed

+1072
-1101
lines changed

8 files changed

+1072
-1101
lines changed

.bazelrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
# This macro is needed in order for mlmd to build with ZetaSQL which can only
1616
# be compiled upon c++17 or higher.
1717
build --cxxopt="-std=c++17"
18+
build --host_cxxopt="-std=c++17"
1819

1920
# Needed to avoid zetasql proto error.
2021
build --protocopt=--experimental_allow_proto3_optional

WORKSPACE

Lines changed: 16 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ http_archive(
1414
],
1515
)
1616

17+
1718
#Install bazel platform version 0.0.6
1819
http_archive(
1920
name = "platforms",
@@ -41,19 +42,24 @@ http_archive(
4142
load("@rules_foreign_cc//foreign_cc:repositories.bzl", "rules_foreign_cc_dependencies")
4243
rules_foreign_cc_dependencies()
4344

45+
# lts_20230125.3
46+
ABSL_COMMIT = "c2435f8342c2d0ed8101cb43adfd605fdc52dca2"
4447
http_archive(
4548
name = "com_google_absl",
46-
urls = ["https://github.com/abseil/abseil-cpp/archive/940c06c25d2953f44310b68eb8aab6114dba11fb.zip"],
47-
strip_prefix = "abseil-cpp-940c06c25d2953f44310b68eb8aab6114dba11fb",
48-
sha256 = "0e800799aa64d0b4d354f3ff317bbd5fbf42f3a522ab0456bb749fc8d3b67415",
49+
sha256 = "9892836ab0d3f099b8c15076c6f4168144f452d097bd49da215fe0df36a2d48c",
50+
strip_prefix = "abseil-cpp-%s" % ABSL_COMMIT,
51+
urls = [
52+
"https://github.com/abseil/abseil-cpp/archive/%s.tar.gz" % ABSL_COMMIT,
53+
],
4954
)
5055

56+
BORINGSSL_COMMIT = "adde128bd706c6caf26dd595e631871b09f40bf6"
5157
http_archive(
5258
name = "boringssl",
53-
sha256 = "1188e29000013ed6517168600fc35a010d58c5d321846d6a6dfee74e4c788b45",
54-
strip_prefix = "boringssl-7f634429a04abc48e2eb041c81c5235816c96514",
59+
sha256 = "7fc7632ce455575025be2cac610a23377753b01a4932d94a452cf831a5b32e9e",
60+
strip_prefix = "boringssl-%s" % BORINGSSL_COMMIT,
5561
urls = [
56-
"https://github.com/google/boringssl/archive/7f634429a04abc48e2eb041c81c5235816c96514.tar.gz",
62+
"https://github.com/google/boringssl/archive/%s.tar.gz" % BORINGSSL_COMMIT,
5763
],
5864
)
5965

@@ -69,10 +75,10 @@ http_archive(
6975

7076
http_archive(
7177
name = "com_google_googletest",
72-
sha256 = "ff7a82736e158c077e76188232eac77913a15dac0b22508c390ab3f88e6d6d86",
73-
strip_prefix = "googletest-b6cd405286ed8635ece71c72f118e659f4ade3fb",
78+
sha256 = "b976cf4fd57b318afdb1bdb27fc708904b3e4bed482859eb94ba2b4bdd077fe2",
79+
strip_prefix = "googletest-f8d7d77c06936315286eb55f8de22cd23c188571",
7480
urls = [
75-
"https://github.com/google/googletest/archive/b6cd405286ed8635ece71c72f118e659f4ade3fb.zip",
81+
"https://github.com/google/googletest/archive/f8d7d77c06936315286eb55f8de22cd23c188571.zip",
7682
],
7783
)
7884

@@ -107,26 +113,6 @@ http_archive(
107113
build_file = "//ml_metadata/third_party:six.BUILD"
108114
)
109115

110-
http_archive(
111-
name = "com_google_protobuf",
112-
sha256 = "930c2c3b5ecc6c9c12615cf5ad93f1cd6e12d0aba862b572e076259970ac3a53",
113-
strip_prefix = "protobuf-3.21.12",
114-
urls = ["https://github.com/protocolbuffers/protobuf/archive/v3.21.12.tar.gz"],
115-
)
116-
117-
load("@com_google_protobuf//:protobuf_deps.bzl", "protobuf_deps")
118-
119-
protobuf_deps()
120-
121-
# Needed by Protobuf.
122-
http_archive(
123-
name = "zlib",
124-
build_file = "@com_google_protobuf//:third_party/zlib.BUILD",
125-
sha256 = "d8688496ea40fb61787500e863cc63c9afcbc524468cedeb478068924eb54932",
126-
strip_prefix = "zlib-1.2.12",
127-
urls = ["https://github.com/madler/zlib/archive/v1.2.12.tar.gz"],
128-
)
129-
130116
http_archive(
131117
name = "pybind11_bazel",
132118
strip_prefix = "pybind11_bazel-faf56fb3df11287f26dbc66fdedf60a2fc2c6631",
@@ -146,12 +132,6 @@ http_archive(
146132
load("@pybind11_bazel//:python_configure.bzl", "python_configure")
147133
python_configure(name = "local_config_python")
148134

149-
# Needed by @com_google_protobuf.
150-
bind(
151-
name = "python_headers",
152-
actual = "@local_config_python//:python_headers",
153-
)
154-
155135
# Note - use @com_github_google_re2 instead of more canonical
156136
# @com_google_re2 for consistency with dependency grpc
157137
# which uses @com_github_google_re2.
@@ -210,7 +190,7 @@ go_repository(
210190

211191
go_rules_dependencies()
212192

213-
go_register_toolchains("host")
193+
go_register_toolchains()
214194

215195
gazelle_dependencies()
216196

ml_metadata/.bazelversion

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@
1111
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
14-
5.3.0
14+
5.3.2

ml_metadata/libmysqlclient.BUILD

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ genrule(
3636
config_setting(
3737
name = "macos",
3838
constraint_values = [
39-
"@bazel_tools//platforms:osx",
39+
"@platforms//os:osx",
4040
],
4141
visibility = ["//visibility:public"],
4242
)

ml_metadata/move_generated_files.sh

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,11 @@ function mlmd::move_generated_files() {
4444
cp -f ${BUILD_WORKSPACE_DIRECTORY}/${bazel_genfiles}/ml_metadata/simple_types/proto/simple_types_pb2.py \
4545
${BUILD_WORKSPACE_DIRECTORY}/ml_metadata/simple_types/proto
4646

47-
4847
MLMD_EXTENSION="ml_metadata/metadata_store/pywrap/metadata_store_extension.so"
49-
cp -f ${BUILD_WORKSPACE_DIRECTORY}/bazel-bin/${MLMD_EXTENSION} \
50-
${BUILD_WORKSPACE_DIRECTORY}/${MLMD_EXTENSION}
48+
DEST_FILE="${BUILD_WORKSPACE_DIRECTORY}/${MLMD_EXTENSION}"
49+
# remove old .so file first to avoid catastrophic failure on macOS due to codesign.
50+
rm -f "$DEST_FILE"
51+
cp -f ${BUILD_WORKSPACE_DIRECTORY}/bazel-bin/${MLMD_EXTENSION} "${DEST_FILE}"
5152

5253
chmod +w "${BUILD_WORKSPACE_DIRECTORY}/${MLMD_EXTENSION}"
5354
}

0 commit comments

Comments
 (0)