V8 build fails on //third_party/zlib dependency

44 views
Skip to first unread message

Dirk Becker

unread,
May 21, 2020, 12:12:39 PM5/21/20
to v8-users
Hi,

my OSX build of V8 failed with an error
ERROR at //BUILD.gn:3584:5: Unable to load "/Volumes/Disk2/v8/third_party/zlib/BUILD.gn".
correctly so, as there is no zlib in v8/third_party .

I commented out the matching dependency lines, introduced in https://chromium.googlesource.com/v8/v8.git/+/858e3c7ef7bc80ea1767737853971e4e6a4633af
Along the suggestion there, I also added v8_disable_snapshot_compression = true to my args.gn

After the warning
> Did you mean "v8_enable_snapshot_compression"?
I then used an v8_enable_snapshot_compression = false


Next is a compile error:

[939/1601] CXX obj/v8_base_without_compiler/snapshot-compression.o
FAILED: obj/v8_base_without_compiler/snapshot-compression.o 
../../src/snapshot/snapshot-compression.cc:10:10: fatal error: 'third_party/zlib/google/compression_utils_portable.h' file not found



v8_enable_snapshot_compression takes me to a define V8_SNAPSHOT_COMPRESSION

Next attempt: add several #ifdef V8_SNAPSHOT_COMPRESSION in snapshot-compression.cc, snapshot-utils.cc and so forth.
A dead end, more and more dependencies - snapshot compression is to stay, IMO that argument / option is toast.



Therefor maybe it is easier to add "third_party/zlib" .
Next problem though: Considering that reference to … "google/compression_utils_portable.h" this is likely to be a special build.


As I am pretty new to V8, how should I continue?

Thanks,
Dirk

Ben Noordhuis

unread,
May 23, 2020, 9:24:42 AM5/23/20
to v8-users
It sounds like you did a regular `git clone`? See the instruction at
[0], you need to use the fetch command from depot_tools. That will
also check out dependencies, among other things.

I maintain a fork[1] of V8 that uses cmake as the build tool. It lets
you use the regular cmake workflow but it doesn't support every option
that GN supports (yet - pull requests welcome.)

[0] https://v8.dev/docs/source-code
[1] https://github.com/bnoordhuis/v8-cmake

Dirk Becker

unread,
May 25, 2020, 11:20:01 AM5/25/20
to v8-users
Back in early 2019 I had used fetch for the initial checkout, later on succeeded once with git pull origin / gclient sync as suggested by https://chromium.googlesource.com/v8/v8.git .
Apparently since then I have broken something so past week's turn the same steps failed.

Now, with a fresh VM v8/third_party looks better, it has far more entries than https://chromium.googlesource.com/v8/v8.git/+/refs/heads/master/third_party/ that I took as the full thing.

Also thanks for suggesting your cmake based fork, but I'll stay with the ninjas for now.

Reply all
Reply to author
Forward
0 new messages