""" V8 and its dependencies Note that googlesource does not generate tarballs deterministically, so we cannot use http_archive: https://github.com/google/gitiles/issues/84 It would seem that googlesource would rather we use git protocol. Fine, we can do that. We previously used shallow_since for our git-based dependencies, but this may actually be harmful: https://github.com/bazelbuild/bazel/issues/12857 There is an official mirror for V8 itself on GitHub, but not for dependencies like zlib (Chromium fork), icu (Chromium fork), and trace_event, so we still have to use git for them. """ http_archive = use_repo_rule("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") git_repository = use_repo_rule("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository") VERSION = "14.8.180" INTEGRITY = "sha256-VQdRoKnkJKBl0GAChhM2Gk+X5HOnZqh8A3PhTtRXoBs=" PATCHES = [ "0001-Allow-manually-setting-ValueDeserializer-format-vers.patch", "0002-Allow-manually-setting-ValueSerializer-format-versio.patch", "0003-Allow-Windows-builds-under-Bazel.patch", "0004-Disable-bazel-whole-archive-build.patch", "0005-Speed-up-V8-bazel-build-by-always-using-target-cfg.patch", "0006-Implement-Promise-Context-Tagging.patch", "0007-Randomize-the-initial-ExecutionContextId-used-by-the.patch", "0008-increase-visibility-of-virtual-method.patch", "0009-Add-ValueSerializer-SetTreatFunctionsAsHostObjects.patch", "0010-Modify-where-to-look-for-fp16-dependency.-This-depen.patch", "0011-Revert-heap-Add-masm-specific-unwinding-annotations-.patch", "0012-Update-illegal-invocation-error-message-in-v8.patch", "0013-Implement-cross-request-context-promise-resolve-hand.patch", "0014-Add-another-slot-in-the-isolate-for-embedder.patch", "0015-Add-ValueSerializer-SetTreatProxiesAsHostObjects.patch", "0016-Disable-memory-leak-assert-when-shutting-down-V8.patch", "0017-Enable-V8-shared-linkage.patch", "0018-Modify-where-to-look-for-fast_float-and-simdutf.patch", "0019-Remove-unneded-latomic-linker-flag.patch", "0020-Add-methods-to-get-heap-and-external-memory-sizes-di.patch", "0021-Port-concurrent-mksnapshot-support.patch", "0022-Port-V8_USE_ZLIB-support.patch", "0023-Modify-where-to-look-for-dragonbox.patch", "0024-Disable-slow-handle-check.patch", "0025-Workaround-for-builtin-can-allocate-issue.patch", "0026-Implement-additional-Exception-construction-methods.patch", "0027-Export-icudata-file-to-facilitate-embedding-it.patch", "0028-bind-icu-to-googlesource.patch", "0029-Add-v8-String-IsFlat-API.patch", "0030-Expose-AdjustAmountOfExternalAllocatedMemoryImpl-as-.patch", "0031-Add-verify_write_barriers-flag-in-V8-s-bazel-config.patch", "0032-Change-lamba-signature-to-get-around-windows-build-f.patch", "0033-Return-false-on-Object.hasOwnProperty-with-intercept.patch", "0034-Remove-V8-MODULE.bazel-llvm-toolchain-and-libcxx-rep.patch", "0035-Remove-libcxx-dep-from-defs.bzl-not-resolvable-via-h.patch", "0036-Fix-non-conforming-braced-init-list-in-value_or.patch", "0037-Fix-non-portable-std-atomic_flag-construction-in-run.patch", ] http_archive( name = "v8", integrity = INTEGRITY, patch_args = ["-p1"], patches = ["//:patches/v8/" + p for p in PATCHES], strip_prefix = "v8-" + VERSION, url = "https://github.com/v8/v8/archive/refs/tags/" + VERSION + ".tar.gz", ) git_repository( name = "com_googlesource_chromium_icu", build_file = "@v8//:bazel/BUILD.icu", commit = "ee5f27adc28bd3f15b2c293f726d14d2e336cbd5", patch_cmds = ["find source -name BUILD.bazel | xargs rm"], patch_cmds_win = ["Get-ChildItem -Path source -File -Include BUILD.bazel -Recurse | Remove-Item"], remote = "https://chromium.googlesource.com/chromium/deps/icu.git", ) # For use with perfetto, see https://github.com/google/perfetto/blob/main/bazel/standalone/README.md local_path_override( module_name = "perfetto_cfg", path = "build/perfetto", ) # perfetto is managed in deps.jsonc with use_bazel_dep: true bazel_dep(name = "workerd-v8") # Tell workerd code where to find v8. # # We indirect through `@workerd-v8` to allow dependents to override how and where `v8` is built. # This is overridden in the internal non-OSS repo. # # TODO(cleanup): There must be a better way to do this? # TODO(soon): Figure out how to build v8 with perfetto enabled. It does not appear # as if the v8 bazel build currently includes support for building with # perfetto enabled as an option. local_path_override( module_name = "workerd-v8", path = "build/workerd-v8", ) bazel_dep(name = "google_benchmark") local_path_override( module_name = "google_benchmark", path = "build/google-benchmark", )