diff --git a/.gitignore b/.gitignore index 3eed1aa7..b2fadd5f 100644 --- a/.gitignore +++ b/.gitignore @@ -6,6 +6,7 @@ /.vscode/ /.idea/ /target/ +/.cipd/ third_party/android_ndk third_party/android_platform diff --git a/.gitmodules b/.gitmodules index b1ebebef..0eef6803 100644 --- a/.gitmodules +++ b/.gitmodules @@ -18,7 +18,7 @@ url = https://chromium.googlesource.com/chromium/src/third_party/markupsafe.git [submodule "buildtools"] path = buildtools - url = https://github.com/denoland/chromium_buildtools.git + url = https://chromium.googlesource.com/chromium/src/buildtools.git [submodule "third_party/zlib"] path = third_party/zlib url = https://chromium.googlesource.com/chromium/src/third_party/zlib.git @@ -31,3 +31,12 @@ [submodule "third_party/fp16/src"] path = third_party/fp16/src 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 diff --git a/.gn b/.gn index 648c4367..8f926496 100644 --- a/.gn +++ b/.gn @@ -23,6 +23,7 @@ default_args = { use_dummy_lastchange = true use_sysroot = false win_crt_flavor_agnostic = true + simple_template_names = false # Minimize size of debuginfo in distributed static library. line_tables_only = true diff --git a/Cargo.toml b/Cargo.toml index dd46d7b7..1644ea02 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -30,13 +30,13 @@ exclude = [ "build/fuchsia/", "buildtools/checkdeps/", "buildtools/clang_format/", - "buildtools/third_party/libc++/trunk/benchmarks/", - "buildtools/third_party/libc++/trunk/docs/", - "buildtools/third_party/libc++/trunk/lib/", - "buildtools/third_party/libc++/trunk/test/", - "buildtools/third_party/libc++/trunk/utils/", - "buildtools/third_party/libc++/trunk/www/", - "buildtools/third_party/libc++abi/trunk/test/", + "third_party/libc++/src/benchmarks/", + "third_party/libc++/src/docs/", + "third_party/libc++/src/lib/", + "third_party/libc++/src/test/", + "third_party/libc++/src/utils/", + "third_party/libc++/src/www/", + "third_party/libc++abi/src/test/", "third_party/icu/android/", "third_party/icu/android_small/", "third_party/icu/cast/", @@ -52,6 +52,7 @@ exclude = [ "third_party/icu/source/io/", "third_party/icu/source/python/", "third_party/icu/source/samples/", + "third_party/icu/source/test/", "third_party/icu/source/tools/", "third_party/icu/tzres/", "third_party/abseil-cpp/*.def", diff --git a/Dockerfile b/Dockerfile index 7f335af7..c37463ca 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,9 +7,11 @@ RUN apt update && \ ENV TZ=Etc/UTC COPY ./build/*.sh /chromium_build/ +COPY ./build/install-build-deps.py /chromium_build/ RUN \ 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 \ && sed -i 's/snapcraft/snapcraftnoinstall/g' /chromium_build/install-build-deps.sh \ && /chromium_build/install-build-deps.sh --no-prompt --no-chromeos-fonts \ diff --git a/build b/build index 46bd0455..8cc2df0e 160000 --- a/build +++ b/build @@ -1 +1 @@ -Subproject commit 46bd0455280f874964b4ef5543bcce93e7a8656e +Subproject commit 8cc2df0e909d0365e20cc0869e565149a723d2ca diff --git a/build.rs b/build.rs index 0738c25a..3b4459ff 100644 --- a/build.rs +++ b/build.rs @@ -15,7 +15,6 @@ use std::io::Seek; use std::io::Write; use std::path::Path; use std::path::PathBuf; -use std::process::exit; use std::process::Command; use std::process::Stdio; use which::which; @@ -171,15 +170,6 @@ fn build_binding() { fn build_v8(is_asan: bool) { 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() { download_ninja_gn_binaries(); } @@ -410,7 +400,9 @@ fn download_ninja_gn_binaries() { assert!(gn.exists()); assert!(ninja.exists()); 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 { @@ -910,12 +902,14 @@ type NinjaEnv = Vec<(String, String)>; fn ninja(gn_out_dir: &Path, maybe_env: Option) -> Command { 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(gn_out_dir); - if let Ok(jobs) = env::var("NUM_JOBS") { - cmd.arg("-j"); - cmd.arg(jobs); + if !cmd_string.ends_with("autoninja") { + if let Ok(jobs) = env::var("NUM_JOBS") { + cmd.arg("-j"); + cmd.arg(jobs); + } } if let Some(env) = maybe_env { for item in env { diff --git a/buildtools b/buildtools index 74f7ce8b..3ef44a2b 160000 --- a/buildtools +++ b/buildtools @@ -1 +1 @@ -Subproject commit 74f7ce8bdddf02420fcdb5a7e097aa019e3d09f2 +Subproject commit 3ef44a2b92d5dd1faa5189a06f3a5febe6db2d58 diff --git a/third_party/abseil-cpp b/third_party/abseil-cpp index 583dc6d1..9d1552f2 160000 --- a/third_party/abseil-cpp +++ b/third_party/abseil-cpp @@ -1 +1 @@ -Subproject commit 583dc6d1b3a0dd44579718699e37cad2f0c41a26 +Subproject commit 9d1552f25c3d9e9114b7d7aed55790570a99bc4d diff --git a/third_party/fp16/src b/third_party/fp16/src index 581ac1c7..0a92994d 160000 --- a/third_party/fp16/src +++ b/third_party/fp16/src @@ -1 +1 @@ -Subproject commit 581ac1c79dd9d9f6f4e8b2934e7a55c7becf0799 +Subproject commit 0a92994d729ff76a58f692d3028ca1b64b145d91 diff --git a/third_party/jinja2 b/third_party/jinja2 index 4633bf43..2f6f2ff5 160000 --- a/third_party/jinja2 +++ b/third_party/jinja2 @@ -1 +1 @@ -Subproject commit 4633bf431193690c3491244f5a0acbe9ac776233 +Subproject commit 2f6f2ff5e4c1d727377f5e1b9e1903d871f41e74 diff --git a/third_party/libc++/src b/third_party/libc++/src new file mode 160000 index 00000000..6bb75caa --- /dev/null +++ b/third_party/libc++/src @@ -0,0 +1 @@ +Subproject commit 6bb75caa139ee1e686d2205910454cf6ea212e58 diff --git a/third_party/libc++abi/src b/third_party/libc++abi/src new file mode 160000 index 00000000..a3c7d3e2 --- /dev/null +++ b/third_party/libc++abi/src @@ -0,0 +1 @@ +Subproject commit a3c7d3e2f3e1e724b4651891b1a71257cbd88acc diff --git a/third_party/libunwind/src b/third_party/libunwind/src new file mode 160000 index 00000000..d09db732 --- /dev/null +++ b/third_party/libunwind/src @@ -0,0 +1 @@ +Subproject commit d09db732ff68f40fd3581306c650b17ea1955b4e diff --git a/third_party/markupsafe b/third_party/markupsafe index 13f4e8c9..6638e9b0 160000 --- a/third_party/markupsafe +++ b/third_party/markupsafe @@ -1 +1 @@ -Subproject commit 13f4e8c9e206567eeb13bf585406ddc574005748 +Subproject commit 6638e9b0a79afc2ff7edd9e84b518fe7d5d5fea9 diff --git a/tools/clang b/tools/clang index 5016a8b1..4dc76da4 160000 --- a/tools/clang +++ b/tools/clang @@ -1 +1 @@ -Subproject commit 5016a8b16c6e3c34138e776dce423fec7b6cf610 +Subproject commit 4dc76da47b1145e53e508a23c1bf2204cf5ee7ee diff --git a/tools/setup_rbe.py b/tools/setup_rbe.py new file mode 100644 index 00000000..4edaf5e0 --- /dev/null +++ b/tools/setup_rbe.py @@ -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') diff --git a/tools/update_deps.py b/tools/update_deps.py new file mode 100644 index 00000000..d06adf16 --- /dev/null +++ b/tools/update_deps.py @@ -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) +