0
0
Fork 0
mirror of https://github.com/denoland/rusty_v8.git synced 2024-12-12 02:27:50 -05:00

chore: update all v8 deps (#1554)

chore: track upstream buildtools
This commit is contained in:
snek 2024-08-07 12:17:50 +02:00 committed by GitHub
parent c6e5da196e
commit f4a706fc49
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
18 changed files with 123 additions and 31 deletions

1
.gitignore vendored
View file

@ -6,6 +6,7 @@
/.vscode/ /.vscode/
/.idea/ /.idea/
/target/ /target/
/.cipd/
third_party/android_ndk third_party/android_ndk
third_party/android_platform third_party/android_platform

11
.gitmodules vendored
View file

@ -18,7 +18,7 @@
url = https://chromium.googlesource.com/chromium/src/third_party/markupsafe.git url = https://chromium.googlesource.com/chromium/src/third_party/markupsafe.git
[submodule "buildtools"] [submodule "buildtools"]
path = buildtools path = buildtools
url = https://github.com/denoland/chromium_buildtools.git url = https://chromium.googlesource.com/chromium/src/buildtools.git
[submodule "third_party/zlib"] [submodule "third_party/zlib"]
path = third_party/zlib path = third_party/zlib
url = https://chromium.googlesource.com/chromium/src/third_party/zlib.git url = https://chromium.googlesource.com/chromium/src/third_party/zlib.git
@ -31,3 +31,12 @@
[submodule "third_party/fp16/src"] [submodule "third_party/fp16/src"]
path = third_party/fp16/src path = third_party/fp16/src
url = https://github.com/Maratyszcza/FP16.git url = https://github.com/Maratyszcza/FP16.git
[submodule "third_party/libc++/src"]
path = third_party/libc++/src
url = https://chromium.googlesource.com/external/github.com/llvm/llvm-project/libcxx.git
[submodule "third_party/libc++abi/src"]
path = third_party/libc++abi/src
url = https://chromium.googlesource.com/external/github.com/llvm/llvm-project/libcxxabi.git
[submodule "third_party/libunwind/src"]
path = third_party/libunwind/src
url = https://chromium.googlesource.com/external/github.com/llvm/llvm-project/libunwind.git

1
.gn
View file

@ -23,6 +23,7 @@ default_args = {
use_dummy_lastchange = true use_dummy_lastchange = true
use_sysroot = false use_sysroot = false
win_crt_flavor_agnostic = true win_crt_flavor_agnostic = true
simple_template_names = false
# Minimize size of debuginfo in distributed static library. # Minimize size of debuginfo in distributed static library.
line_tables_only = true line_tables_only = true

View file

@ -30,13 +30,13 @@ exclude = [
"build/fuchsia/", "build/fuchsia/",
"buildtools/checkdeps/", "buildtools/checkdeps/",
"buildtools/clang_format/", "buildtools/clang_format/",
"buildtools/third_party/libc++/trunk/benchmarks/", "third_party/libc++/src/benchmarks/",
"buildtools/third_party/libc++/trunk/docs/", "third_party/libc++/src/docs/",
"buildtools/third_party/libc++/trunk/lib/", "third_party/libc++/src/lib/",
"buildtools/third_party/libc++/trunk/test/", "third_party/libc++/src/test/",
"buildtools/third_party/libc++/trunk/utils/", "third_party/libc++/src/utils/",
"buildtools/third_party/libc++/trunk/www/", "third_party/libc++/src/www/",
"buildtools/third_party/libc++abi/trunk/test/", "third_party/libc++abi/src/test/",
"third_party/icu/android/", "third_party/icu/android/",
"third_party/icu/android_small/", "third_party/icu/android_small/",
"third_party/icu/cast/", "third_party/icu/cast/",
@ -52,6 +52,7 @@ exclude = [
"third_party/icu/source/io/", "third_party/icu/source/io/",
"third_party/icu/source/python/", "third_party/icu/source/python/",
"third_party/icu/source/samples/", "third_party/icu/source/samples/",
"third_party/icu/source/test/",
"third_party/icu/source/tools/", "third_party/icu/source/tools/",
"third_party/icu/tzres/", "third_party/icu/tzres/",
"third_party/abseil-cpp/*.def", "third_party/abseil-cpp/*.def",

View file

@ -7,9 +7,11 @@ RUN apt update && \
ENV TZ=Etc/UTC ENV TZ=Etc/UTC
COPY ./build/*.sh /chromium_build/ COPY ./build/*.sh /chromium_build/
COPY ./build/install-build-deps.py /chromium_build/
RUN \ RUN \
DEBIAN_FRONTEND=noninteractive \ DEBIAN_FRONTEND=noninteractive \
ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone \ echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections \
&& ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone \
&& apt-get update && apt-get install -y lsb-release sudo \ && apt-get update && apt-get install -y lsb-release sudo \
&& sed -i 's/snapcraft/snapcraftnoinstall/g' /chromium_build/install-build-deps.sh \ && sed -i 's/snapcraft/snapcraftnoinstall/g' /chromium_build/install-build-deps.sh \
&& /chromium_build/install-build-deps.sh --no-prompt --no-chromeos-fonts \ && /chromium_build/install-build-deps.sh --no-prompt --no-chromeos-fonts \

2
build

@ -1 +1 @@
Subproject commit 46bd0455280f874964b4ef5543bcce93e7a8656e Subproject commit 8cc2df0e909d0365e20cc0869e565149a723d2ca

View file

@ -15,7 +15,6 @@ use std::io::Seek;
use std::io::Write; use std::io::Write;
use std::path::Path; use std::path::Path;
use std::path::PathBuf; use std::path::PathBuf;
use std::process::exit;
use std::process::Command; use std::process::Command;
use std::process::Stdio; use std::process::Stdio;
use which::which; use which::which;
@ -171,15 +170,6 @@ fn build_binding() {
fn build_v8(is_asan: bool) { fn build_v8(is_asan: bool) {
env::set_var("DEPOT_TOOLS_WIN_TOOLCHAIN", "0"); env::set_var("DEPOT_TOOLS_WIN_TOOLCHAIN", "0");
// git submodule update --init --recursive
let libcxx_src = PathBuf::from("buildtools/third_party/libc++/trunk/src");
if !libcxx_src.is_dir() {
eprintln!(
"missing source code. Run 'git submodule update --init --recursive'"
);
exit(1);
}
if need_gn_ninja_download() { if need_gn_ninja_download() {
download_ninja_gn_binaries(); download_ninja_gn_binaries();
} }
@ -410,7 +400,9 @@ fn download_ninja_gn_binaries() {
assert!(gn.exists()); assert!(gn.exists());
assert!(ninja.exists()); assert!(ninja.exists());
env::set_var("GN", gn); env::set_var("GN", gn);
env::set_var("NINJA", ninja); if env::var("NINJA").is_err() {
env::set_var("NINJA", ninja);
}
} }
fn prebuilt_profile() -> &'static str { fn prebuilt_profile() -> &'static str {
@ -910,12 +902,14 @@ type NinjaEnv = Vec<(String, String)>;
fn ninja(gn_out_dir: &Path, maybe_env: Option<NinjaEnv>) -> Command { fn ninja(gn_out_dir: &Path, maybe_env: Option<NinjaEnv>) -> Command {
let cmd_string = env::var("NINJA").unwrap_or_else(|_| "ninja".to_owned()); let cmd_string = env::var("NINJA").unwrap_or_else(|_| "ninja".to_owned());
let mut cmd = Command::new(cmd_string); let mut cmd = Command::new(&cmd_string);
cmd.arg("-C"); cmd.arg("-C");
cmd.arg(gn_out_dir); cmd.arg(gn_out_dir);
if let Ok(jobs) = env::var("NUM_JOBS") { if !cmd_string.ends_with("autoninja") {
cmd.arg("-j"); if let Ok(jobs) = env::var("NUM_JOBS") {
cmd.arg(jobs); cmd.arg("-j");
cmd.arg(jobs);
}
} }
if let Some(env) = maybe_env { if let Some(env) = maybe_env {
for item in env { for item in env {

@ -1 +1 @@
Subproject commit 74f7ce8bdddf02420fcdb5a7e097aa019e3d09f2 Subproject commit 3ef44a2b92d5dd1faa5189a06f3a5febe6db2d58

@ -1 +1 @@
Subproject commit 583dc6d1b3a0dd44579718699e37cad2f0c41a26 Subproject commit 9d1552f25c3d9e9114b7d7aed55790570a99bc4d

@ -1 +1 @@
Subproject commit 581ac1c79dd9d9f6f4e8b2934e7a55c7becf0799 Subproject commit 0a92994d729ff76a58f692d3028ca1b64b145d91

2
third_party/jinja2 vendored

@ -1 +1 @@
Subproject commit 4633bf431193690c3491244f5a0acbe9ac776233 Subproject commit 2f6f2ff5e4c1d727377f5e1b9e1903d871f41e74

1
third_party/libc++/src vendored Submodule

@ -0,0 +1 @@
Subproject commit 6bb75caa139ee1e686d2205910454cf6ea212e58

1
third_party/libc++abi/src vendored Submodule

@ -0,0 +1 @@
Subproject commit a3c7d3e2f3e1e724b4651891b1a71257cbd88acc

1
third_party/libunwind/src vendored Submodule

@ -0,0 +1 @@
Subproject commit d09db732ff68f40fd3581306c650b17ea1955b4e

@ -1 +1 @@
Subproject commit 13f4e8c9e206567eeb13bf585406ddc574005748 Subproject commit 6638e9b0a79afc2ff7edd9e84b518fe7d5d5fea9

@ -1 +1 @@
Subproject commit 5016a8b16c6e3c34138e776dce423fec7b6cf610 Subproject commit 4dc76da47b1145e53e508a23c1bf2204cf5ee7ee

46
tools/setup_rbe.py Normal file
View file

@ -0,0 +1,46 @@
"""
This script sets up re_client sort of like https://chromium.googlesource.com/chromium/src/+/main/docs/linux/build_instructions.md#use-reclient
You will need to set these gn args:
```
use_remoteexec=true
reclient_cfg_dir="../../buildtools/reclient_cfgs/linux"
cc_wrapper=""
```
and set these env vars:
```
NINJA=autoninja
```
"""
Str = str
def Var(name):
if name == 'rbe_instance':
return 'projects/rbe-chromium-untrusted/instances/default_instance'
return vars[name]
with open('./v8/DEPS') as f:
exec(f.read())
import subprocess
import os
def run(name):
hook = next(h for h in hooks if h['name'] == name)
print(subprocess.run(hook['action']))
run('configure_reclient_cfgs')
run('configure_siso')
rbe_version = Var('reclient_version')
ensure_file = f'''
$ParanoidMode CheckPresence
@Subdir buildtools/reclient
infra/rbe/client/linux-amd64 {rbe_version}
'''
print(ensure_file)
with open("./cipd.ensure", "w") as f:
f.write(ensure_file)
print(subprocess.run(['cipd', 'ensure', '-root', '.', '-ensure-file', 'cipd.ensure']))
os.remove('./cipd.ensure')

35
tools/update_deps.py Normal file
View file

@ -0,0 +1,35 @@
Str = str
def Var(name):
return vars[name]
with open('./v8/DEPS') as f:
exec(f.read())
import subprocess
def process(name, dep):
if name == 'build':
# We have our own fork of this
return
url = dep if isinstance(dep, str) else dep['url']
rev = url.split('@')[1]
print(name, rev)
subprocess.run(['git', 'fetch', 'origin'], cwd=name)
subprocess.run(['git', 'checkout', rev], cwd=name)
failed = False
with open('.gitmodules') as f:
for line in f.readlines():
if line.startswith('['):
name = line.split(" ")[1][1:-3]
if name in deps:
try:
process(name, deps[name])
except:
failed = True
if failed:
import sys
sys.exit(1)