Skip to content

Commit

Permalink
Clean up new_git_repository and update documentation
Browse files Browse the repository at this point in the history
- Based on bazelbuild/bazel#16064 git_repository
  supports the same arguments as new_git_repository and the latter
  should no longer be used.
- Update documentation to reflect that v8 is now used as a http_archive
  dependency.
  • Loading branch information
fhanau committed Jan 23, 2024
1 parent 14dfa83 commit fd48dcd
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 14 deletions.
9 changes: 4 additions & 5 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ workspace(name = "workerd")
# ========================================================================================
# Bazel basics

load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository", "new_git_repository")
load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository")
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive", "http_file")

http_archive(
Expand Down Expand Up @@ -172,7 +172,7 @@ http_archive(
# old for tcmalloc. Absurdly, Bazel simply ignores later attempts to define the same repo name,
# rather than erroring out. Thus this leads to confusing compiler errors in tcmalloc complaining
# that ABSL_ATTRIBUTE_PURE_FUNCTION is not defined.
new_git_repository(
git_repository(
name = "com_google_absl",
remote = "https://chromium.googlesource.com/chromium/src/third_party/abseil-cpp.git",
commit = "0764ad493e54a79c7e3e02fc3412ef55b4835b9e",
Expand Down Expand Up @@ -430,7 +430,7 @@ http_archive(
url = "https://github.com/v8/v8/archive/refs/tags/12.1.285.26.tar.gz",
)

new_git_repository(
git_repository(
name = "com_googlesource_chromium_icu",
build_file = "@v8//:bazel/BUILD.icu",
commit = "a622de35ac311c5ad390a7af80724634e5dc61ed",
Expand All @@ -451,7 +451,6 @@ http_archive(
strip_prefix = "perfetto-39.0",
type = "tgz",
url = "https://github.com/google/perfetto/archive/refs/tags/v39.0.tar.gz",

)

# For use with perfetto
Expand All @@ -470,7 +469,7 @@ new_local_repository(
build_file_content = ""
)

new_git_repository(
git_repository(
name = "com_googlesource_chromium_base_trace_event_common",
build_file = "@v8//:bazel/BUILD.trace_event_common",
commit = "29ac73db520575590c3aceb0a6f1f58dda8934f6",
Expand Down
15 changes: 7 additions & 8 deletions docs/v8-updates.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ To update the version of V8 used by workerd, the steps are:

4. Sync the local copy of V8 to the version used by workerd.

First find, the commit hash of the "v8" `git_repository` in the workerd [WORKSPACE](../WORKSPACE) file.
First find, the tag of the "v8" `http_archive` in the workerd [WORKSPACE](../WORKSPACE) file.

Then sync your fetched version v8 so that it corresponds to that hash.
Then sync your fetched version v8 based on the tag.

```sh
cd v8/v8
git checkout <commit_hash>
git checkout <tag>
gclient sync
```

Expand Down Expand Up @@ -58,16 +58,15 @@ To update the version of V8 used by workerd, the steps are:
8. Remove the existing patches from `workerd/patches/v8` and copy the latest patches
for the V8 directory there.
9. Update the `git_repository` for V8 in the `workerd/WORKSPACE` file.
9. Update the `http_archive` for V8 in the `workerd/WORKSPACE` file.
The list of patches should be refreshed if new patches are being added or existing
patches are being removed.
The `commit` in the `git_repository` for V8 should be updated to match
the version corresponding to the version of V8 being updated. This can be found
by running `git rev-parse <version>` in the local V8 git repo, e.g. `git rev-parse 11.4.183.8`.
`strip_prefix` and `url` in the `http_archive` for V8 should be updated based on the new V8
version/tag.
See [V8 git_repository in WORKSPACE](https://github.com/cloudflare/workerd/blob/2d124ecd2d1132537d37bd5e166ac1aec4f7397f/WORKSPACE#L263)
See [V8 http_archive in WORKSPACE](https://github.com/cloudflare/workerd/blob/587ad90dd1e91d2660c271018056f4189fca3501/WORKSPACE#L408)
10. Update V8's dependencies in `workerd/WORKSPACE`.

Expand Down
1 change: 0 additions & 1 deletion src/workerd/jsg/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,6 @@ wd_cc_capnp_library(
wd_cc_capnp_library(
name = "rtti_test_capnp",
srcs = ["rtti-test.capnp"],
data = glob(["rtti-test-*.js"]),
deps = [":modules_capnp"],
)

Expand Down

0 comments on commit fd48dcd

Please sign in to comment.