Hi guys!
I'm trying to get action("generate_v8_context_snapshot") to work in my buildroot build.
I have configured the real target build to arm (32bits) but have pretty much let the chromium build system decide the rest of the variables, especially those for v8 context snapshotting.
The result is that chromium's build system properly (in my current understanding) chooses //build/toolchain/linux:clang_x86_v8_arm and expects the debian_sid_i386-sysroot to exist. I used build/linux/sysroot_scripts/install-sysroot.py --arch=i386 when I got the error about it missing.
$ cat build/libcef-jfd/out/Release/
args.gn (WITH COMMENTS ;)
clang_base_path = "/path/to/my/buildroot/BASE_DIR/host/usr"
clang_use_chrome_plugins = false
clang_version = "11.0.1"
custom_toolchain = "//build/toolchain/linux/unbundle:default"
target_cpu = "arm"
target_os = "linux"
target_sysroot = "/path/to/my/buildroot/BASE_DIR/host/arm-buildroot-linux-gnueabihf/sysroot"
# I can't use the buildroot pkg-config which are wrappers which add buildroot paths in personality variable.
# I had to change pkg_config.gni to make the v8 scope run not use the sysroot of the target (arm),
# but instead use the sysroot variable, which for the v8 scope, contains the path to debian_sid_i386-sysroot.
# I also had to modify pkg_config.gni to use the host_pkg_config and args instead of the real target
# pkg-config tool (more details below...)
host_pkg_config = "/usr/bin/pkg-config"
fatal_linker_warnings = false
enable_basic_print_dialog = false
disable_ftp_support = true
enable_linux_installer = false
enable_nacl = false
enable_remoting = false
enable_service_discovery = false
enable_vr = false
ozone_platform_wayland = false
rtc_use_pipewire = false
use_clang_coverage = false
use_gnome_keyring = false
use_gtk = false
ffmpeg_branding = "Chrome"
proprietary_codecs = true
arm_tune = "cortex-a9"
arm_float_abi = "hard"
arm_fpu = "vfpv3-d16"
arm_use_neon = false
is_debug = false
is_official_build = true
is_component_build = false
blink_symbol_level = 0
symbol_level = 0
cc_wrapper = "ccache"
use_cups = false
use_libpci = true
use_pulseaudio = false
use_v8_context_snapshot = true
enable_widevine = false
use_vaapi = false
So I don't understand how the v8 snapshot build can work for anyone since I had to to modify build/config/linux/pkg_config.gni to also actually specify the //build/linux/debian_sid_i386-sysroot when it invokes `pkgresult = exec_script(pkg_config_script, args, "value")` in the scope of the v8 toolchain build config. Otherwise the paths returned by pkg-config.py were very absolute paths appended to my buildroot made arm sysroot (or vice-versa, can't remember now). I can produce a patch here for the discussion if needed.
I have successfully built v8_context_snapshot_generator but it fails to run because tools/v8_context_snapshot/BUILD.gn:action("generate_v8_context_snapshot") doesn't do anything special to instruct the dynamic linker to use the files from //build/linux/debian_sid_i386-sysroot.
And even then, after manually invoking v8_context_snapshot_generator with a modified LD_LIBRARY_PATH to prioritize debian_sid_i386-sysroot, I get a failure because some libs in the sysroot rely on libdbus-1.so.0 which is nowhere to be found in that sysroot:
```
.../build/linux/debian_sid_i386-sysroot$ ~/find_libdbus_dependants.sh
./usr/lib/i386-linux-gnu/libavahi-client.so.3 depends on libdbus-1.so.3
./usr/lib/i386-linux-gnu/libpulse.so.0 depends on libdbus-1.so.0
./usr/lib/i386-linux-gnu/pulseaudio/
libpulsecommon-13.0.so depends on libdbus-1.so.3
./usr/lib/i386-linux-gnu/libdbus-glib-1.so.2.3.4 depends on libdbus-1.so.3
./usr/lib/i386-linux-gnu/libgnome-keyring.so.0 depends on libdbus-1.so.0
./usr/lib/i386-linux-gnu/libpulse.so.0.21.1 depends on libdbus-1.so.0
./usr/lib/i386-linux-gnu/libgnome-keyring.so depends on libdbus-1.so.0
./usr/lib/i386-linux-gnu/libavahi-client.so.3.2.9 depends on libdbus-1.so.3
./usr/lib/i386-linux-gnu/
libatk-bridge-2.0.so depends on libdbus-1.so.0
./usr/lib/i386-linux-gnu/libpulse.so depends on libdbus-1.so.0
./usr/lib/i386-linux-gnu/libatk-bridge-2.0.so.0.0.0 depends on libdbus-1.so.0
./usr/lib/i386-linux-gnu/libatspi.so depends on libdbus-1.so.0
./usr/lib/i386-linux-gnu/libatk-bridge-2.0.so.0 depends on libdbus-1.so.0
./usr/lib/i386-linux-gnu/libgnome-keyring.so.0.2.0 depends on libdbus-1.so.0
./usr/lib/i386-linux-gnu/libatspi.so.0.0.1 depends on libdbus-1.so.0
./usr/lib/i386-linux-gnu/libdbus-glib-1.so.2 depends on libdbus-1.so.3
./usr/lib/i386-linux-gnu/libatspi.so.0 depends on libdbus-1.so.0
.../build/linux/debian_sid_i386-sysroot$ find -name "libdbus-1.so.*"
./lib/i386-linux-gnu/libdbus-1.so.3.19.11
./lib/i386-linux-gnu/libdbus-1.so.3
```
So at this point, it is so hard and broken for me that I am starting to question my strategy entirely. Can you provide any help? Am I indeed using this as intended? Should I maybe just stick with my real arm sysroot and invoke v8_context_snapshot_generator from qemu?
Thanks for any help whatsoever!