Cannot build V8 with gclient/gn

138 views
Skip to first unread message

Ethin Probst

unread,
Nov 26, 2018, 6:19:04 PM11/26/18
to v8-users
I followed the steps on building V8 at https://v8.dev/docs/build and https://v8.dev/docs/source-code, but I'm using FreeBSD and so CIPD isn't supported on FreeBSD. That's a huge problem because i prevents me from building V8 at all. Not to mention it limits me to Python 2.7 when I want to use Python 3.7 for the build process. Ah well.
Anyway, I run:
git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
Cloning into 'depot_tools'...
remote: Sending approximately 22.24 MiB ...
remote: Total 29246 (delta 20781), reused 29246 (delta 20781)
Receiving objects: 100% (29246/29246), 22.18 MiB | 13.86 MiB/s, done.
Resolving deltas: 100% (20781/20781), done.
I then create a v8 path, set pyenv to use python 2.7.15, link v8 into my path, and run gclient and fetch:
$ gclient
CIPD not supported on freebsd
WARNING: Your metrics.cfg file was invalid or nonexistent. A new one will be created.
Usage: gclient.py <command> [options]

Meta checkout dependency manager for Git.

Commands are:
  config   creates a .gclient file in the current directory
  diff     displays local diff for every dependencies
  fetch    fetches upstream commits for all modules
  flatten  flattens the solutions into a single DEPS file
  getdep   gets revision information and variable values from a DEPS file
  grep     greps through git repos managed by gclient
  help     prints list of commands or help for a specific command
  metrics  reports, and optionally modifies, the status of metric collection
  pack     generates a patch which can be applied at the root of the tree
  recurse  operates [command args ...] on all the dependencies
  revert   reverts all modifications in every dependencies
  revinfo  outputs revision info mapping for the client and its dependencies
  root     outputs the solution root (or current dir if there isn't one)
  runhooks runs hooks for files that have been modified in the local working copy
  setdep   modifies dependency revisions and variable values in a DEPS file
  status   shows modification status for every dependencies
  sync     checkout/update all modules
  validate validates the .gclient and DEPS syntax
  verify   verifies the DEPS file deps are only from allowed_hosts

Options:
  --version             show program's version number and exit
  -h, --help            show this help message and exit
  -j JOBS, --jobs=JOBS  Specify how many SCM commands can run in parallel;
                        defaults to 8 on this machine
  -v, --verbose         Produces additional output for diagnostics. Can be
                        used up to three times for more logging info.
  --gclientfile=CONFIG_FILENAME
                        Specify an alternate .gclient file
  --spec=SPEC           create a gclient file containing the provided string.
                        Due to Cygwin/Python brokenness, it can't contain any
                        newlines.
  --no-nag-max          Ignored for backwards compatibility.
$ ../depot_tools/fetch v8
Running: gclient root
CIPD not supported on freebsd
Running: gclient config --spec 'solutions = [
  {
    "url": "https://chromium.googlesource.com/v8/v8.git",
    "managed": False,
    "name": "v8",
    "deps_file": "DEPS",
    "custom_deps": {},
  },
]
'
CIPD not supported on freebsd
Running: gclient sync --with_branch_heads
CIPD not supported on freebsd

________ running 'git -c core.deltaBaseCacheLimit=2g clone --no-checkout --progress https://chromium.googlesource.com/v8/v8.git /usr/home/ethin/v8/_gclient_v8_chIH7X' in '/usr/home/ethin/v8'
Cloning into '/usr/home/ethin/v8/_gclient_v8_chIH7X'...
remote: Sending approximately 430.94 MiB ...
remote: Counting objects: 7660, done

[0:01:00] Still working on:
[0:01:00]   v8
remote: Total 618180 (delta 518023), reused 618180 (delta 518023)
Receiving objects: 100% (618180/618180), 430.12 MiB | 8.00 MiB/s, done.

[0:01:10] Still working on:
[0:01:10]   v8

[0:01:20] Still working on:
[0:01:20]   v8

[0:01:30] Still working on:
[0:01:30]   v8

[0:01:40] Still working on:
[0:01:40]   v8

[0:01:50] Still working on:
[0:01:50]   v8

[0:02:00] Still working on:
[0:02:00]   v8

[0:02:10] Still working on:
[0:02:10]   v8

[0:02:20] Still working on:
[0:02:20]   v8

[0:02:30] Still working on:
[0:02:30]   v8

[0:02:40] Still working on:
[0:02:40]   v8

[0:02:50] Still working on:
[0:02:50]   v8

[0:03:00] Still working on:
[0:03:00]   v8
Resolving deltas: 100% (518023/518023), done.

[0:03:10] Still working on:
[0:03:10]   v8

[0:03:20] Still working on:
[0:03:20]   v8

[0:03:30] Still working on:
[0:03:30]   v8

[0:03:39] Still working on:
[0:03:39]   v8
Syncing projects: 100% ( 1/ 1) v8

v8 (ERROR)
----------------------------------------
[0:00:00] Started.
[0:00:00]

________ running 'git -c core.deltaBaseCacheLimit=2g clone --no-checkout --progress https://chromium.googlesource.com/v8/v8.git /usr/home/ethin/v8/_gclient_v8_chIH7X' in '/usr/home/ethin/v8'
Cloning into '/usr/home/ethin/v8/_gclient_v8_chIH7X'...
[0:00:00] Cloning into '/usr/home/ethin/v8/_gclient_v8_chIH7X'...
remote: Sending approximately 430.94 MiB ...
[0:00:04] remote: Sending approximately 430.94 MiB ...
[0:00:07] remote: Counting objects: 1
[0:00:08] remote: Counting objects: 1176
[0:00:09] remote: Counting objects: 4527
remote: Counting objects: 7660, done
[0:00:10] remote: Counting objects: 7660, done
remote: Total 618180 (delta 518023), reused 618180 (delta 518023)
[0:01:04] remote: Total 618180 (delta 518023), reused 618180 (delta 518023)
Receiving objects: 100% (618180/618180), 430.12 MiB | 8.00 MiB/s, done.
[0:01:04] Receiving objects: 100% (618180/618180), 430.12 MiB | 8.00 MiB/s, done.
Resolving deltas: 100% (518023/518023), done.
[0:03:08] Resolving deltas: 100% (518023/518023), done.
[0:03:34] From https://chromium.googlesource.com/v8/v8
[0:03:34]  * [new ref]               refs/branch-heads/0.1         -> branch-heads/0.1
[0:03:34]  * [new ref]               refs/branch-heads/0.3         -> branch-heads/0.3
[0:03:34]  * [new ref]               refs/branch-heads/1.1         -> branch-heads/1.1
[0:03:34]  * [new ref]               refs/branch-heads/1.2         -> branch-heads/1.2
[0:03:34]  * [new ref]               refs/branch-heads/1.3         -> branch-heads/1.3
[0:03:34]  * [new ref]               refs/branch-heads/2.0         -> branch-heads/2.0
[0:03:34]  * [new ref]               refs/branch-heads/2.1         -> branch-heads/2.1
[0:03:34]  * [new ref]               refs/branch-heads/2.2         -> branch-heads/2.2
[0:03:34]  * [new ref]               refs/branch-heads/2.3         -> branch-heads/2.3
[0:03:34]  * [new ref]               refs/branch-heads/2.4         -> branch-heads/2.4
[0:03:34]  * [new ref]               refs/branch-heads/2.5         -> branch-heads/2.5
[0:03:34]  * [new ref]               refs/branch-heads/3.0         -> branch-heads/3.0
[0:03:34]  * [new ref]               refs/branch-heads/3.1         -> branch-heads/3.1
[0:03:34]  * [new ref]               refs/branch-heads/3.10        -> branch-heads/3.10
[0:03:34]  * [new ref]               refs/branch-heads/3.11        -> branch-heads/3.11
[0:03:34]  * [new ref]               refs/branch-heads/3.12        -> branch-heads/3.12
[0:03:34]  * [new ref]               refs/branch-heads/3.13        -> branch-heads/3.13
[0:03:34]  * [new ref]               refs/branch-heads/3.14        -> branch-heads/3.14
[0:03:34]  * [new ref]               refs/branch-heads/3.15        -> branch-heads/3.15
[0:03:34]  * [new ref]               refs/branch-heads/3.16        -> branch-heads/3.16
[0:03:34]  * [new ref]               refs/branch-heads/3.17        -> branch-heads/3.17
[0:03:34]  * [new ref]               refs/branch-heads/3.18        -> branch-heads/3.18
[0:03:34]  * [new ref]               refs/branch-heads/3.19        -> branch-heads/3.19
[0:03:34]  * [new ref]               refs/branch-heads/3.2         -> branch-heads/3.2
[0:03:34]  * [new ref]               refs/branch-heads/3.20        -> branch-heads/3.20
[0:03:34]  * [new ref]               refs/branch-heads/3.20.15.5   -> branch-heads/3.20.15.5
[0:03:34]  * [new ref]               refs/branch-heads/3.21        -> branch-heads/3.21
[0:03:34]  * [new ref]               refs/branch-heads/3.22        -> branch-heads/3.22
[0:03:34]  * [new ref]               refs/branch-heads/3.23        -> branch-heads/3.23
[0:03:34]  * [new ref]               refs/branch-heads/3.24        -> branch-heads/3.24
[0:03:34]  * [new ref]               refs/branch-heads/3.25        -> branch-heads/3.25
[0:03:34]  * [new ref]               refs/branch-heads/3.26        -> branch-heads/3.26
[0:03:34]  * [new ref]               refs/branch-heads/3.27        -> branch-heads/3.27
[0:03:34]  * [new ref]               refs/branch-heads/3.28        -> branch-heads/3.28
[0:03:34]  * [new ref]               refs/branch-heads/3.29        -> branch-heads/3.29
[0:03:34]  * [new ref]               refs/branch-heads/3.3         -> branch-heads/3.3
[0:03:34]  * [new ref]               refs/branch-heads/3.30        -> branch-heads/3.30
[0:03:34]  * [new ref]               refs/branch-heads/3.31        -> branch-heads/3.31
[0:03:34]  * [new ref]               refs/branch-heads/3.4         -> branch-heads/3.4
[0:03:34]  * [new ref]               refs/branch-heads/3.5         -> branch-heads/3.5
[0:03:34]  * [new ref]               refs/branch-heads/3.6         -> branch-heads/3.6
[0:03:34]  * [new ref]               refs/branch-heads/3.7         -> branch-heads/3.7
[0:03:34]  * [new ref]               refs/branch-heads/3.8         -> branch-heads/3.8
[0:03:34]  * [new ref]               refs/branch-heads/3.9         -> branch-heads/3.9
[0:03:34]  * [new ref]               refs/branch-heads/4.1         -> branch-heads/4.1
[0:03:34]  * [new ref]               refs/branch-heads/4.2         -> branch-heads/4.2
[0:03:34]  * [new ref]               refs/branch-heads/4.2.39      -> branch-heads/4.2.39
[0:03:34]  * [new ref]               refs/branch-heads/4.3         -> branch-heads/4.3
[0:03:34]  * [new ref]               refs/branch-heads/4.4         -> branch-heads/4.4
[0:03:34]  * [new ref]               refs/branch-heads/4.5         -> branch-heads/4.5
[0:03:34]  * [new ref]               refs/branch-heads/4.6         -> branch-heads/4.6
[0:03:34]  * [new ref]               refs/branch-heads/4.7         -> branch-heads/4.7
[0:03:34]  * [new ref]               refs/branch-heads/4.8         -> branch-heads/4.8
[0:03:34]  * [new ref]               refs/branch-heads/4.9         -> branch-heads/4.9
[0:03:34]  * [new ref]               refs/branch-heads/5.0         -> branch-heads/5.0
[0:03:34]  * [new ref]               refs/branch-heads/5.1         -> branch-heads/5.1
[0:03:34]  * [new ref]               refs/branch-heads/5.2         -> branch-heads/5.2
[0:03:34]  * [new ref]               refs/branch-heads/5.3         -> branch-heads/5.3
[0:03:34]  * [new ref]               refs/branch-heads/5.4         -> branch-heads/5.4
[0:03:34]  * [new ref]               refs/branch-heads/5.5         -> branch-heads/5.5
[0:03:34]  * [new ref]               refs/branch-heads/5.6         -> branch-heads/5.6
[0:03:34]  * [new ref]               refs/branch-heads/5.7         -> branch-heads/5.7
[0:03:34]  * [new ref]               refs/branch-heads/5.8         -> branch-heads/5.8
[0:03:34]  * [new ref]               refs/branch-heads/5.9         -> branch-heads/5.9
[0:03:34]  * [new ref]               refs/branch-heads/6.0         -> branch-heads/6.0
[0:03:34]  * [new ref]               refs/branch-heads/6.1         -> branch-heads/6.1
[0:03:34]  * [new ref]               refs/branch-heads/6.2         -> branch-heads/6.2
[0:03:34]  * [new ref]               refs/branch-heads/6.3         -> branch-heads/6.3
[0:03:34]  * [new ref]               refs/branch-heads/6.4         -> branch-heads/6.4
[0:03:34]  * [new ref]               refs/branch-heads/6.5         -> branch-heads/6.5
[0:03:34]  * [new ref]               refs/branch-heads/6.6         -> branch-heads/6.6
[0:03:34]  * [new ref]               refs/branch-heads/6.7         -> branch-heads/6.7
[0:03:34]  * [new ref]               refs/branch-heads/6.8         -> branch-heads/6.8
[0:03:34]  * [new ref]               refs/branch-heads/6.9         -> branch-heads/6.9
[0:03:34]  * [new ref]               refs/branch-heads/7.0         -> branch-heads/7.0
[0:03:34]  * [new ref]               refs/branch-heads/7.1         -> branch-heads/7.1
[0:03:34]  * [new ref]               refs/branch-heads/experimental -> branch-heads/experimental
[0:03:34]  * [new ref]               refs/branch-heads/test-gnumbd -> branch-heads/test-gnumbd
[0:03:39] Checked out refs/remotes/origin/master to a detached HEAD. Before making any commits
in this repo, you should use 'git checkout <branch>' to switch to
an existing branch or use 'git checkout origin -b <branch>' to
create a new branch for your work.
[0:03:39]
----------------------------------------
Traceback (most recent call last):
  File "/usr/home/ethin/depot_tools/metrics.py", line 262, in print_notice_and_exit
    yield
  File "/home/ethin/depot_tools/gclient.py", line 3107, in <module>
    sys.exit(main(sys.argv[1:]))
  File "/home/ethin/depot_tools/gclient.py", line 3093, in main
    return dispatcher.execute(OptionParser(), argv)
  File "/usr/home/ethin/depot_tools/subcommand.py", line 252, in execute
    return command(parser, args[1:])
  File "/home/ethin/depot_tools/gclient.py", line 2672, in CMDsync
    ret = client.RunOnDeps('update', args)
  File "/home/ethin/depot_tools/gclient.py", line 1705, in RunOnDeps
    patch_refs=patch_refs, target_branches=target_branches)
  File "/usr/home/ethin/depot_tools/gclient_utils.py", line 1075, in run
    self.item.run(*self.args, **self.kwargs)
  File "/home/ethin/depot_tools/gclient.py", line 924, in run
    self.ParseDepsFile()
  File "/home/ethin/depot_tools/gclient.py", line 684, in ParseDepsFile
    filepath, self.get_vars(), self.get_builtin_vars())
  File "/home/ethin/depot_tools/gclient.py", line 1228, in get_vars
    parent_vars = self.parent.get_vars()
  File "/home/ethin/depot_tools/gclient.py", line 1231, in get_vars
    result.update(self.get_builtin_vars())
  File "/home/ethin/depot_tools/gclient.py", line 1204, in get_builtin_vars
    'host_os': _detect_host_os(),
  File "/home/ethin/depot_tools/gclient.py", line 1246, in _detect_host_os
    return _PLATFORM_MAPPING[sys.platform]
KeyError: 'freebsd11'
Traceback (most recent call last):
  File "../depot_tools/fetch.py", line 306, in <module>
    sys.exit(main())
  File "../depot_tools/fetch.py", line 301, in main
    return run(options, spec, root)
  File "../depot_tools/fetch.py", line 295, in run
    return checkout.init()
  File "../depot_tools/fetch.py", line 137, in init
    self.run_gclient(*sync_cmd)
  File "../depot_tools/fetch.py", line 82, in run_gclient
    return self.run(cmd_prefix + cmd, **kwargs)
  File "../depot_tools/fetch.py", line 71, in run
    subprocess.check_call(cmd, **kwargs)
  File "/home/ethin/.pyenv/versions/2.7.15/lib/python2.7/subprocess.py", line 190, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '('gclient', 'sync', '--with_branch_heads')' returned non-zero exit status 1
So, not only is CIPD unavailable for FreeBSD (and I can't find the source code for it), but gclient apparently doesn't support my OS. And I have no idea if I can build V8 anyway, even if fetch v8 fails at this point. Oh, and I can't forget to mention that gn doesn't work, either. So is there any way around this? Because I wanted to embed V8 into my project, but this is really starting to disappoint me. I've heard great things about it, I've used it in Node.JS, and yet I can't build it to embed it because the build system is so convoluted. What happened to the old CMake/make combo that works so well? What happened to autoconf? Or any of the other good build systems that do work on pretty much all OSes? I don't mean to be overly rude but this is ridiculous.

Jakob Kummerow

unread,
Nov 26, 2018, 8:55:53 PM11/26/18
to v8-u...@googlegroups.com
Yes, the official V8 build instructions don't work on FreeBSD. That's because nobody cared enough to make it work. Do you?

You can look at whatever Node is doing to build V8 on FreeBSD -- I believe they have a solution. Feel free to submit a patch to the documentation (via GitHub PR to v8.dev) once you've figured it out.

As for CMake/autoconf/whatever: choosing build systems is harder than most people realize, and there are many constraints. For the time being, the best fit for V8's needs is GN.


--
--
v8-users mailing list
v8-u...@googlegroups.com
http://groups.google.com/group/v8-users
---
You received this message because you are subscribed to the Google Groups "v8-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to v8-users+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ethin Probst

unread,
Nov 26, 2018, 11:46:51 PM11/26/18
to v8-u...@googlegroups.com
I'm now curious why no one cared to do that? It just doesn't make sense.

On 11/26/18, Jakob Kummerow <jkum...@chromium.org> wrote:
> Yes, the official V8 build instructions don't work on FreeBSD. That's
> because nobody cared enough to make it work. Do you?
>
> You can look at whatever Node is doing to build V8 on FreeBSD -- I believe
> they have a solution. Feel free to submit a patch to the documentation (via
> GitHub PR to v8.dev <https://github.com/v8/v8.dev>) once you've figured it
> You received this message because you are subscribed to a topic in the
> Google Groups "v8-users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/v8-users/5H1kaLxMV04/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
--
Signed,
Ethin D. Probst

Ethin Probst

unread,
Nov 27, 2018, 12:02:14 AM11/27/18
to v8-u...@googlegroups.com
Also, apparently they patch it, they're using V 7.0.276.38. They also
use make-v8.sh on a build machine, I'm guessing, to build it.

Ben Noordhuis

unread,
Nov 28, 2018, 1:11:48 PM11/28/18
to v8-u...@googlegroups.com
On Tue, Nov 27, 2018 at 6:02 AM Ethin Probst <harlyd...@gmail.com> wrote:
> Also, apparently they patch it, they're using V 7.0.276.38. They also
> use make-v8.sh on a build machine, I'm guessing, to build it.

We (that is, Node.js) don't build V8 standalone on anything but Linux,
although we do build it for different archs (at least x86_64 and
s390x.)

The integrated V8 build uses GYP, which we maintain, and is known to
work on FreeBSD; we have amd64 fbsd10 and 11 machines in our CI
matrix.

The relevant code is in deps/v8 and tools/gyp. You're welcome to use
that as long as you understand and accept it comes with zero
guarantees. :-)

Ethin Probst

unread,
Nov 28, 2018, 2:06:15 PM11/28/18
to v8-u...@googlegroups.com
Would it be possible for me to generate a makefile on Linux, copy the
v8 directory over to the FreeBSD machine, and build it then? Or would
it complain?

Ben Noordhuis

unread,
Nov 28, 2018, 2:16:57 PM11/28/18
to v8-u...@googlegroups.com
On Wed, Nov 28, 2018 at 8:06 PM Ethin Probst <harlyd...@gmail.com> wrote:
> Would it be possible for me to generate a makefile on Linux, copy the
> v8 directory over to the FreeBSD machine, and build it then? Or would
> it complain?

Not without manual massaging. V8 has quite a bit of platform-specific
code. If you copy over the ninja.build file verbatim, it'll try to
build a linux binary, not a freebsd binary.

Ethin Probst

unread,
Nov 28, 2018, 3:53:22 PM11/28/18
to v8-u...@googlegroups.com
Damn. There's gotta be a way to integrate freebsd support. I still
can't rap my head around the fact that no one cared to make a FreeBSD
CIPD port, or no one cared enough to add it in.

On 11/28/18, Ben Noordhuis <in...@bnoordhuis.nl> wrote:

Ethin Probst

unread,
Nov 28, 2018, 3:55:23 PM11/28/18
to v8-u...@googlegroups.com
Also, I tried building your node version of V8
(https://github.com/nodejs/node-v8).. Didn't really work out very
well. What kind of massaging would I need to do to get it to cooperate
-- the gclient/gn build system that is?

Ben Noordhuis

unread,
Nov 29, 2018, 4:30:09 AM11/29/18
to v8-u...@googlegroups.com
On Wed, Nov 28, 2018 at 9:55 PM Ethin Probst <harlyd...@gmail.com> wrote:
> Also, I tried building your node version of V8
> (https://github.com/nodejs/node-v8).. Didn't really work out very
> well. What kind of massaging would I need to do to get it to cooperate
> -- the gclient/gn build system that is?

You probably want the main repo[0], node-v8 is unstable.

Apropos GN, we only use GYP. If you run configure in the top-level
directory, it writes out a config.gypi file and invokes tools/gyp to
create the Makefiles.

[0] https://github.com/nodejs/node
Reply all
Reply to author
Forward
0 new messages