Skip to content

Commit

Permalink
Move fp16 dependency to Bazel & patch v8
Browse files Browse the repository at this point in the history
  • Loading branch information
garrettgu10 committed Apr 25, 2024
1 parent 0842e5e commit f1d81e2
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 2 deletions.
9 changes: 8 additions & 1 deletion WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,12 @@ git_repository(
remote = "https://chromium.googlesource.com/chromium/src/third_party/abseil-cpp.git",
)

git_repository(
name = "fp16",
commit = "0a92994d729ff76a58f692d3028ca1b64b145d91",
remote = "https://chromium.googlesource.com/external/github.com/Maratyszcza/FP16.git"
)

# Bindings for abseil libraries used by V8
[
bind(
Expand Down Expand Up @@ -449,7 +455,8 @@ http_archive(
"//:patches/v8/0012-Always-enable-continuation-preserved-data-in-the-bui.patch",
"//:patches/v8/0013-increase-visibility-of-virtual-method.patch",
"//:patches/v8/0014-Add-ValueSerializer-SetTreatFunctionsAsHostObjects.patch",
"//:patches/v8/0015-Set-torque-generator-path-to-external-v8.-This-allow.patch"
"//:patches/v8/0015-Set-torque-generator-path-to-external-v8.-This-allow.patch",
"//:patches/v8/0016-Modify-where-to-look-for-fp16-dependency.-This-depen.patch"
],
integrity = "sha256-C6bsXXbKgeCxmG1VNO/LScaPq0HVlmofpVHJ5kswoLg=",
strip_prefix = "v8-12.4.254.11",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ index e55defede9fed3eea9348bd7bd50d98f688a2a7b..faeef2b2ed71b4784050451a61a16feb
def _torque_files_impl(ctx):
- v8root = "."
+ v8root = "external/v8"

# Arguments
args = []
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
From 76d8cc9d39d0798155d0a7df176b9d3a1bdb7a55 Mon Sep 17 00:00:00 2001
From: Garrett Gu <[email protected]>
Date: Mon, 22 Apr 2024 10:10:21 -0500
Subject: =?UTF-8?q?Modify=20where=20to=20look=20for=20fp16=20dependency.?=
=?UTF-8?q?=20This=20dependency=20is=20normally=20downloaded=20by=20gn=20b?=
=?UTF-8?q?ut=20we=0Aneed=20to=20fetch=20it=20in=20Bazel.=20We=20do=20so?=
=?UTF-8?q?=20in=20the=20workerd=20repo=20in=20the=20WORKSPACE=20file.?=


diff --git a/BUILD.bazel b/BUILD.bazel
index f3e7958b39e5b7e42b06fad83a0bf6f7352ffd3c..acc8d6a9ed050ad95e799892a9df4be47203657b 100644
--- a/BUILD.bazel
+++ b/BUILD.bazel
@@ -3691,13 +3691,12 @@ filegroup(

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

0 comments on commit f1d81e2

Please sign in to comment.