0

I am trying to run the unit tests for the V8 present in the AOSP's lollipop release: external/chromium_org/v8 by following the documentation from https://v8.dev/docs/build. But the build itself is constantly failing.

Steps followed:

  1. Export the depot_tools path
  2. gclient sync
  3. install dependencies using ./build/install-build-deps.sh (This script was not present by default in the source code, so had to copy manually from the higher version)
  4. gm x64.release

I have installed all the dependencies and followed all the steps from the documentation mentioned above but when I do:

gm x64.release

the build fails with the following output:

# echo > out/x64.release/args.gn << EOF
is_component_build = false
is_debug = false
target_cpu = "x64"
use_goma = false
v8_enable_backtrace = true
v8_enable_disassembler = true
v8_enable_object_print = true
v8_enable_verify_heap = true
EOF
# gn gen out/x64.release
ERROR at //build/config/BUILDCONFIG.gn:71:7: Undefined identifier
  if (os == "chromeos") {
      ^-

I have tried building the it with gn as well by following the manual workflow but I am ending up with the same errors. I also tried setting the os variable to linux in the gn args list but there as well I get the unknown identifier error.

I see that the v8 used in the AOSP project differs a lot in terms of files from the main source code with the same version. The helper script tools/dev/gm.py is also not present by default so I am using one from the higher version. It would be great if anyone could suggest if there's any different set of steps I should be following or any other resources I can refer to in order to build the V8 present in the AOSP project

Version: V8 3.29.88.17
OS: Ubuntu 18.04.5 LTS
Architecture: x86_64

1 Answers1

1

3.29 is seriously old; I'm not surprised that it won't build with current tools. Rule of thumb: when building old software, use the tools that were used to build it back then.

In the case at hand: try make x64.release.check -jN with N being the number of CPU cores you have.

I see that the v8 used in the AOSP project differs a lot in terms of files from the main source code with the same version.

The "lollipop-release" branch contains V8 3.27.34.15, whereas "lollipop-mr1-release" contains V8 3.29.88.17 which you quoted. Does that explain the differences?

jmrk
  • 34,271
  • 7
  • 59
  • 74
  • I tried ```make x64.release.check -j8``` which ends up with the following error – Saurabh Banore Feb 25 '21 at 00:40
  • ```PYTHONPATH="~/project/external/chromium_org/v8/tools/generate_shim_headers:~/project/external/chromium_org/v8/build::~/project/external/chromium_org/v8/build/gyp/pylib:" \ GYP_GENERATORS=make \ build/gyp/gyp --generator-output="out" build/all.gyp \ -Ibuild/standalone.gypi --depth=. \ -Dv8_target_arch=ia32 \ \ \ -S.ia32.release -Dv8_enable_backtrace=1 -Darm_fpu=default -Darm_float_abi=default /bin/sh: build/gyp/gyp: No such file or directory make: *** [out/Makefile.ia32.release] Error 127 ``` – Saurabh Banore Feb 25 '21 at 00:44
  • I checked the build folder and there's no gyp folder present as mentioned in the error.I tried checking out 3.29.88.18 of the https://github.com/v8/v8/, it also doesn't contain the build/gyp folder – Saurabh Banore Feb 25 '21 at 00:51
  • 1
    You have to install the dependencies (which you said you did -- I guess you meant other dependencies). See the `DEPS` file and/or the definition of the "dependencies" target in the `Makefile` for inspiration. Most/all of the repositories have moved in the years since, so you'll have to manually figure out where to get the sources, and check out the appropriate versions. – jmrk Feb 25 '21 at 11:23
  • Yes, I was able to get past that error by installing gyp on my ubuntu machine and then moving the binary to build/gyp. Later the build proceeded and failed due to some error which I was able to resolve by downgrading my gcc from 7 to 6. Now I am stuck with another error related to gtest ~/project/external/chromium_org/v8/out/x64.release/obj.target/gtest/testing/gtest/src/gtest-death-test.o: No such file or directory – Saurabh Banore Feb 25 '21 at 11:48
  • Here's the detailed error: ```make[1]: Entering directory '~/project/external/chromium_org/v8/out' AR(target) ~/project/external/chromium_org/v8/out/x64.release/obj.target/testing/libgtest.a ar: ~/project/external/chromium_org/v8/out/x64.release/obj.target/gtest/testing/gtest/src/gtest-death-test.o: No such file or directory testing/gtest.target.x64.release.mk:178: recipe for target '~/project/external/chromium_org/v8/out/x64.release/obj.target/testing/libgtest.a' failed``` I see that gtest and gmock are also listed in the DEPS file. Any idea how do I download them? – Saurabh Banore Feb 25 '21 at 12:33
  • Maybe github.com/google/googletest? Just use your favorite search engine. I don't know how to map the SVN revision numbers specified in DEPS to git commit hashes for the github repo; you'll have to figure that out. – jmrk Feb 25 '21 at 13:14