|
| 1 | +""" |
| 2 | +V8 and its dependencies |
| 3 | + |
| 4 | +Note that googlesource does not generate tarballs deterministically, so we cannot use |
| 5 | +http_archive: https://github.com/google/gitiles/issues/84 |
| 6 | + |
| 7 | +It would seem that googlesource would rather we use git protocol. |
| 8 | +Fine, we can do that. |
| 9 | + |
| 10 | +We previously used shallow_since for our git-based dependencies, but this may actually be |
| 11 | +harmful: https://github.com/bazelbuild/bazel/issues/12857 |
| 12 | + |
| 13 | +There is an official mirror for V8 itself on GitHub, but not for dependencies like zlib (Chromium |
| 14 | +fork), icu (Chromium fork), and trace_event, so we still have to use git for them. |
| 15 | +""" |
| 16 | +bazel_dep(name = "perfetto", version = "0.0.0") |
| 17 | + |
| 18 | +http_archive = use_repo_rule("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") |
| 19 | +git_repository = use_repo_rule("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository") |
| 20 | + |
| 21 | +VERSION = "14.1.146.1" |
| 22 | + |
| 23 | +INTEGRITY = "sha256-2HdTM2N2J1XBI6617Icx73S2qs5+Qd/h4hQUek8CUFU=" |
| 24 | + |
| 25 | +PATCHES = [ |
| 26 | + "0001-Allow-manually-setting-ValueDeserializer-format-vers.patch", |
| 27 | + "0002-Allow-manually-setting-ValueSerializer-format-versio.patch", |
| 28 | + "0003-Allow-Windows-builds-under-Bazel.patch", |
| 29 | + "0004-Disable-bazel-whole-archive-build.patch", |
| 30 | + "0005-Speed-up-V8-bazel-build-by-always-using-target-cfg.patch", |
| 31 | + "0006-Implement-Promise-Context-Tagging.patch", |
| 32 | + "0007-Randomize-the-initial-ExecutionContextId-used-by-the.patch", |
| 33 | + "0008-increase-visibility-of-virtual-method.patch", |
| 34 | + "0009-Add-ValueSerializer-SetTreatFunctionsAsHostObjects.patch", |
| 35 | + "0010-Modify-where-to-look-for-fp16-dependency.-This-depen.patch", |
| 36 | + "0011-Revert-heap-Add-masm-specific-unwinding-annotations-.patch", |
| 37 | + "0012-Update-illegal-invocation-error-message-in-v8.patch", |
| 38 | + "0013-Implement-cross-request-context-promise-resolve-hand.patch", |
| 39 | + "0014-Add-another-slot-in-the-isolate-for-embedder.patch", |
| 40 | + "0015-Add-ValueSerializer-SetTreatProxiesAsHostObjects.patch", |
| 41 | + "0016-Disable-memory-leak-assert-when-shutting-down-V8.patch", |
| 42 | + "0017-Enable-V8-shared-linkage.patch", |
| 43 | + "0018-Modify-where-to-look-for-fast_float-and-simdutf.patch", |
| 44 | + "0019-Remove-unneded-latomic-linker-flag.patch", |
| 45 | + "0020-Add-methods-to-get-heap-and-external-memory-sizes-di.patch", |
| 46 | + "0021-Remove-DCHECK-from-WriteOneByteV2-to-skip-v8-fatal.patch", |
| 47 | + "0022-Port-concurrent-mksnapshot-support.patch", |
| 48 | + "0023-Port-V8_USE_ZLIB-support.patch", |
| 49 | + "0024-Modify-where-to-look-for-dragonbox.patch", |
| 50 | + "0025-Disable-slow-handle-check.patch", |
| 51 | + "0026-Workaround-for-builtin-can-allocate-issue.patch", |
| 52 | + "0027-Implement-additional-Exception-construction-methods.patch", |
| 53 | + "0028-Export-icudata-file-to-facilitate-embedding-it.patch", |
| 54 | + "0029-IsGraphAsync-module-cast-check.patch", |
| 55 | +] |
| 56 | + |
| 57 | +http_archive( |
| 58 | + name = "v8", |
| 59 | + integrity = INTEGRITY, |
| 60 | + patch_args = ["-p1"], |
| 61 | + patches = ["//:patches/v8/" + p for p in PATCHES], |
| 62 | + strip_prefix = "v8-" + VERSION, |
| 63 | + url = "https://github.com/v8/v8/archive/refs/tags/" + VERSION + ".tar.gz", |
| 64 | +) |
| 65 | + |
| 66 | +git_repository( |
| 67 | + name = "com_googlesource_chromium_icu", |
| 68 | + build_file = "@v8//:bazel/BUILD.icu", |
| 69 | + commit = "1b2e3e8a421efae36141a7b932b41e315b089af8", |
| 70 | + patch_cmds = ["find source -name BUILD.bazel | xargs rm"], |
| 71 | + patch_cmds_win = ["Get-ChildItem -Path source -File -Include BUILD.bazel -Recurse | Remove-Item"], |
| 72 | + remote = "https://chromium.googlesource.com/chromium/deps/icu.git", |
| 73 | +) |
| 74 | + |
| 75 | +archive_override( |
| 76 | + module_name = "perfetto", |
| 77 | + patches = ["//:patches/perfetto/MODULE.bazel.patch"], |
| 78 | + integrity = "sha256-T5F4h9xXdYfTGMa+AXmewHIkS1cgxu5ierfyJMOwqJA=", |
| 79 | + strip_prefix = "perfetto-51.2", |
| 80 | + url = "https://github.com/google/perfetto/archive/refs/tags/v51.2.tar.gz", |
| 81 | +) |
| 82 | + |
| 83 | +# For use with perfetto, see https://github.com/google/perfetto/blob/main/bazel/standalone/README.md |
| 84 | +local_path_override( |
| 85 | + module_name = "perfetto_cfg", |
| 86 | + path = "build/perfetto", |
| 87 | +) |
0 commit comments