Building with sccache(-dist)

This documentation applies to the WPE and GTK ports. From the sccache homepage:

Sccache is a ccache-like tool. It is used as a compiler wrapper and avoids compilation when possible, storing a cache in a remote storage using the Amazon Simple Cloud Storage Service (S3) API, the Google Cloud Storage (GCS) API, or Redis. It works as a client-server. The client spawns a server if one is not running already, and sends the wrapped command line as a request to the server, which then does the work and returns stdout/stderr for the job. The client-server model allows the server to be more efficient in its handling of the remote storage.

Sccache can also be used with local storage instead of remote.

Using the Flatpak SDK

First, generate a sccache config file. You will need an authentication token, specific to the scheduler you plan to use. By default the Igalia scheduler is used, unless you provide an override using the command-line: -s

$ Tools/Scripts/webkit-flatpak -r -t <token>
$ cat WebKitBuild/UserFlatpak/sccache.toml
scheduler_url = ""
compiler_executable = "/usr/bin/c++"
archive_compiler_executable = "/usr/bin/g++"
type = "path_override"
archive = "/home/phil/WebKit/WebKitBuild/Toolchains/webkit-sdk-gcc-df05b4231b1586d4bc07430d8353065c.tar.gz"

compiler_executable = "/usr/bin/clang++"
archive_compiler_executable = "/usr/bin/clang++"
type = "path_override"
archive = "/home/phil/WebKit/WebKitBuild/Toolchains/webkit-sdk-clang-1898673fc91e702aa44006e0195695a3.tar.gz"

token = "s3cr3t-tok3n"
type = "token"

Then build WebKit. By default the generated config file will be used, unless you explicitly set the SCCACHE_CONFIG env var to an existing path.

$ Tools/Scripts/build-webkit --gtk 

If you have access to a Redis instance, you can tell sccache to use it:

$ export SCCACHE_REDIS="redis://pass@host:port/dbpath"

Using JHBuild

You need to make sure you have a valid sccache config file and that sccache is installed on your build machine. Then use the same env vars as in the Flatpak SDK setup documented above.

Last modified 8 weeks ago Last modified on May 22, 2020 3:14:48 AM