Skip to content

Commit

Permalink
Fetch fp16 dependency of v8, and patch v8 to find it
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Warres <[email protected]>
  • Loading branch information
mpwarres committed Aug 16, 2024
1 parent b2f6c54 commit b40e90b
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 1 deletion.
23 changes: 22 additions & 1 deletion bazel/external/v8.patch
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@
# 3. Revert v8 commit b26554ec368e9553782012c96aa5e99b163eaff2, which removed
# use of _allowlist_function_transition from v8 bazel/defs.bzl, since it is
# still required by the version of Bazel we currently use (6.5.0).
# 4. Tweak where v8 looks for its fp16 dependency, since it isn't downloaded by
# gn.

diff --git a/BUILD.bazel b/BUILD.bazel
index 30be47fa333..d03d1e4d522 100644
index 30be47fa333..093599d47df 100644
--- a/BUILD.bazel
+++ b/BUILD.bazel
@@ -220,7 +220,7 @@ v8_int(
Expand All @@ -17,6 +19,25 @@ index 30be47fa333..d03d1e4d522 100644
)

# Default setting for v8_enable_pointer_compression.
@@ -3698,13 +3698,14 @@ filegroup(

v8_library(
name = "lib_fp16",
- srcs = ["third_party/fp16/src/include/fp16.h"],
+ srcs = ["@fp16//:include/fp16.h"],
hdrs = [
- "third_party/fp16/src/include/fp16/fp16.h",
- "third_party/fp16/src/include/fp16/bitcasts.h",
+ "@fp16//:include/fp16/fp16.h",
+ "@fp16//:include/fp16/bitcasts.h",
],
+ include_prefix = "third_party/fp16/src",
includes = [
- "third_party/fp16/src/include",
+ "@fp16//:include",
],
)

diff --git a/bazel/defs.bzl b/bazel/defs.bzl
index 520a311595e..246c4ecf27a 100644
--- a/bazel/defs.bzl
Expand Down
8 changes: 8 additions & 0 deletions bazel/repositories.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,14 @@ def proxy_wasm_cpp_host_repositories():
actual = "@com_google_absl//absl/container:flat_hash_set",
)

maybe(
git_repository,
name = "fp16",
commit = "0a92994d729ff76a58f692d3028ca1b64b145d91",
build_file_content = "exports_files(glob([\"**\"]))",
remote = "https://chromium.googlesource.com/external/github.com/Maratyszcza/FP16.git",
)

# WAMR with dependencies.

maybe(
Expand Down

0 comments on commit b40e90b

Please sign in to comment.