Skip to content

Instantly share code, notes, and snippets.

@corysimmons
Last active March 3, 2020 12:09
Show Gist options
  • Save corysimmons/4dac7d55e58c7558854d98a76d065bfc to your computer and use it in GitHub Desktop.
Save corysimmons/4dac7d55e58c7558854d98a76d065bfc to your computer and use it in GitHub Desktop.
Instructions for how to build Headless Chromium on Mac.

Doesn't work yet.

Build

  • brew install ninja
  • mkdir -p ~/chromium
  • cd ~/chromium
  • git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
  • export $PATH=$PWD/depot_tools:$PATH (shell specific)
  • fetch --no-history chromium --nosvn=True
  • cd src
  • mkdir -p out/release
  • echo 'import("//build/args/headless.gn")' > out/release/args.gn
  • echo 'is_debug = false' >> out/release/args.gn
  • gn gen out/release
  • ninja -C out/release headless
  • ln -s ~/chromium/out/release/headless /usr/local/bin/headless-chromium

Usage

  • headless-chromium ...
@JoeChapman
Copy link

Presumably it is because there is a bug in the tip-of-tree commit?

@qingdujun
Copy link

qingdujun@MacBook-Pro src % gn gen out/Release
ERROR at //third_party/fontconfig/fontconfig.gni:7:1: Assertion failed.
assert(is_linux)
^-----
See //third_party/fontconfig/BUILD.gn:6:1: whence it was imported.
import("//third_party/fontconfig/fontconfig.gni")
^-----------------------------------------------
See //headless/BUILD.gn:200:7: which caused the file to be included.
      "//third_party/fontconfig",
      ^-------------------------
qingdujun@MacBook-Pro src %

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment