xmake-io/xmake

Support local and remote build cache

waruqi opened this issue · 0 comments

Is your feature request related to a problem? Please describe.

Local cache

It will be enabled by default.

see #2361

disable cache

$ xmake f --ccache=n
$ xmake

Remote cache

Add configuration

$ cat ~/.xmake/service/server.conf
{
    remote_cache = {
        listen = "0.0.0.0:9692",
        workdir = "/Users/ruki/.xmake/service/server/remote_cache"
    },
    tokens = {
        "caefa7cf0a036e2364fa349dc39b4127"
    }
}
$ cat ~/.xmake/service/client.conf
{
    remote_cache = {
        connect = "127.0.0.1:9692",
        token = "caefa7cf0a036e2364fa349dc39b4127"
    }
}

Start remote server

$ xmake service -vD
<remote_cache_server>: listening 0.0.0.0:9692 ..

Connect remote cache server

$ xmake service --connect --cache
<remote_cache_client>: connect 127.0.0.1:9692 ..
<remote_cache_client>: connected!

Build project with local/remote cache

$ xmake