Changes between Initial Version and Version 1 of Sccache


Ignore:
Timestamp:
May 22, 2020 3:14:48 AM (4 years ago)
Author:
Philippe Normand
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Sccache

    v1 v1  
     1[[PageOutline]]
     2
     3= Building with sccache(-dist) =
     4
     5This documentation applies to the WPE and GTK ports. From the [https://github.com/mozilla/sccache sccache] homepage:
     6
     7Sccache 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.
     8
     9Sccache can also be used with local storage instead of remote.
     10
     11== Using the Flatpak SDK ==
     12
     13First, 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 sccache.example.com`
     14
     15{{{
     16#!sh
     17$ Tools/Scripts/webkit-flatpak -r -t <token>
     18$ cat WebKitBuild/UserFlatpak/sccache.toml
     19[dist]
     20scheduler_url = "https://sccache.igalia.com"
     21[[dist.toolchains]]
     22compiler_executable = "/usr/bin/c++"
     23archive_compiler_executable = "/usr/bin/g++"
     24type = "path_override"
     25archive = "/home/phil/WebKit/WebKitBuild/Toolchains/webkit-sdk-gcc-df05b4231b1586d4bc07430d8353065c.tar.gz"
     26
     27[[dist.toolchains]]
     28compiler_executable = "/usr/bin/clang++"
     29archive_compiler_executable = "/usr/bin/clang++"
     30type = "path_override"
     31archive = "/home/phil/WebKit/WebKitBuild/Toolchains/webkit-sdk-clang-1898673fc91e702aa44006e0195695a3.tar.gz"
     32
     33[dist.auth]
     34token = "s3cr3t-tok3n"
     35type = "token"
     36}}}
     37
     38Then build WebKit. By default the generated config file will be used, unless you explicitly set the `SCCACHE_CONFIG` env var to an existing path.
     39
     40{{{
     41#!sh
     42$ export WEBKIT_USE_SCCACHE=1
     43$ export NUMBER_OF_PROCESSORS=40
     44$ Tools/Scripts/build-webkit --gtk
     45}}}
     46
     47If you have access to a Redis instance, you can tell sccache to use it:
     48
     49{{{
     50#!sh
     51$ export SCCACHE_REDIS="redis://pass@host:port/dbpath"
     52}}}
     53
     54== Using JHBuild ==
     55
     56You 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.