sccache 0.15.0

Sccache is a ccache-like tool. It is used as a compiler wrapper and avoids compilation when possible. Sccache has the capability to utilize caching in remote storage environments, including various cloud storage options, or alternatively, in local storage.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
x-common-env: &common-env
  RUST_BACKTRACE: full
  RUSTC_WRAPPER: ${SCCACHE_PATH:-/sccache/target/debug/sccache}
  RUST_LOG: debug
  SCCACHE_PATH: ${SCCACHE_PATH:-/sccache/target/debug/sccache}
  LLVM_PROFILE_FILE: ${LLVM_PROFILE_FILE:-}

x-test-runner: &test-runner
  user: "${UID:-1000}:${GID:-1000}"
  volumes:
    - ../../:/sccache:ro
    - ../../target/integration-cargo-cache:/usr/local/cargo/registry:rw
    - ../../target/integration-coverage:/coverage:rw
  tmpfs:
    - /build:exec,uid=${UID:-1000},gid=${GID:-1000},mode=1777
  working_dir: /build
  environment:
    <<: *common-env

x-health-check: &healthcheck
  interval: 2s
  timeout: 3s
  retries: 10

services:
  redis:
    image: redis:7-alpine
    ports:
      - "6379:6379"
    healthcheck:
      <<: *healthcheck
      test: ["CMD", "redis-cli", "ping"]
    profiles:
      - test
      - redis

  memcached:
    image: memcached:latest
    ports:
      - "11211:11211"
    environment:
      MEMCACHED_MAX_ITEM_SIZE: 16777216
    healthcheck:
      <<: *healthcheck
      test: ["CMD", "timeout", "5", "bash", "-c", "cat < /dev/null > /dev/tcp/127.0.0.1/11211"]
    profiles:
      - test
      - memcached

  minio:
    image: minio/minio:latest
    ports:
      - "9000:9000"
      - "9001:9001"
    environment:
      MINIO_ROOT_USER: minioadmin
      MINIO_ROOT_PASSWORD: minioadmin
    command: server /data --console-address ":9001"
    healthcheck:
      <<: *healthcheck
      test: ["CMD", "curl", "-f", "http://localhost:9000/minio/health/live"]
    profiles:
      - test
      - s3

  minio-setup:
    image: minio/mc:latest
    depends_on:
      minio:
        condition: service_healthy
    entrypoint: >
      /bin/sh -c "
      mc alias set myminio http://minio:9000 minioadmin minioadmin;
      mc mb myminio/test || true;
      exit 0;
      "
    profiles:
      - test
      - s3

  azurite:
    image: mcr.microsoft.com/azure-storage/azurite:latest
    ports:
      - "10000:10000"
    command: azurite-blob --blobHost 0.0.0.0 --skipApiVersionCheck
    healthcheck:
      <<: *healthcheck
      test: ["CMD", "sh", "-c", "nc 127.0.0.1 10000 -z || exit 1"]
    profiles:
      - test
      - azblob

  azurite-setup:
    image: mcr.microsoft.com/azure-cli:latest
    depends_on:
      azurite:
        condition: service_healthy
    entrypoint: >
      /bin/sh -c "
      az storage container create --name test --connection-string 'DefaultEndpointsProtocol=http;AccountName=devstoreaccount1;AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;BlobEndpoint=http://azurite:10000/devstoreaccount1;';
      exit 0;
      "
    profiles:
      - test
      - azblob

  webdav:
    image: hacdias/webdav:latest
    ports:
      - "8080:8080"
    volumes:
      - webdav-data:/srv
      - ./webdav-config.yaml:/config.yaml:ro
    command: --config /config.yaml
    profiles:
      - test
      - webdav

  test-redis-deprecated:
    <<: *test-runner
    image: rust:latest
    entrypoint: /sccache/tests/integration/scripts/test-backend.sh
    depends_on:
      redis:
        condition: service_healthy
    environment:
      <<: *common-env
      SCCACHE_REDIS: redis://redis:6379
      TEST_NAME: redis-deprecated
      BACKEND_CHECK: redis
    profiles:
      - test
      - redis

  test-redis:
    <<: *test-runner
    image: rust:latest
    entrypoint: /sccache/tests/integration/scripts/test-backend.sh
    depends_on:
      redis:
        condition: service_healthy
    environment:
      <<: *common-env
      SCCACHE_REDIS_ENDPOINT: tcp://redis:6379
      TEST_NAME: redis
      BACKEND_CHECK: redis
    profiles:
      - test
      - redis

  test-memcached-deprecated:
    <<: *test-runner
    image: rust:latest
    entrypoint: /sccache/tests/integration/scripts/test-backend.sh
    depends_on:
      memcached:
        condition: service_healthy
    environment:
      <<: *common-env
      SCCACHE_MEMCACHED: tcp://memcached:11211
      TEST_NAME: memcached-deprecated
      BACKEND_CHECK: memcached
    profiles:
      - test
      - memcached

  test-memcached:
    <<: *test-runner
    image: rust:latest
    entrypoint: /sccache/tests/integration/scripts/test-backend.sh
    depends_on:
      memcached:
        condition: service_healthy
    environment:
      <<: *common-env
      SCCACHE_MEMCACHED_ENDPOINT: tcp://memcached:11211
      TEST_NAME: memcached
      BACKEND_CHECK: memcached
    profiles:
      - test
      - memcached

  test-s3:
    <<: *test-runner
    image: rust:latest
    entrypoint: /sccache/tests/integration/scripts/test-backend.sh
    depends_on:
      minio:
        condition: service_healthy
      minio-setup:
        condition: service_completed_successfully
    environment:
      <<: *common-env
      SCCACHE_BUCKET: test
      SCCACHE_ENDPOINT: http://minio:9000/
      SCCACHE_REGION: us-east-1
      AWS_ACCESS_KEY_ID: minioadmin
      AWS_SECRET_ACCESS_KEY: minioadmin
      AWS_EC2_METADATA_DISABLED: "true"
      TEST_NAME: s3
      BACKEND_CHECK: s3
    profiles:
      - test
      - s3

  test-azblob:
    <<: *test-runner
    image: rust:latest
    entrypoint: /sccache/tests/integration/scripts/test-backend.sh
    depends_on:
      azurite:
        condition: service_healthy
      azurite-setup:
        condition: service_completed_successfully
    environment:
      <<: *common-env
      SCCACHE_AZURE_BLOB_CONTAINER: test
      SCCACHE_AZURE_CONNECTION_STRING: "DefaultEndpointsProtocol=http;AccountName=devstoreaccount1;AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;BlobEndpoint=http://azurite:10000/devstoreaccount1;"
      TEST_NAME: azblob
      BACKEND_CHECK: azblob
    profiles:
      - test
      - azblob

  test-webdav:
    <<: *test-runner
    image: rust:latest
    entrypoint: /sccache/tests/integration/scripts/test-backend.sh
    depends_on:
      - webdav
    environment:
      <<: *common-env
      SCCACHE_WEBDAV_ENDPOINT: "http://webdav:8080"
      SCCACHE_WEBDAV_USERNAME: "bar"
      SCCACHE_WEBDAV_PASSWORD: "baz"
      TEST_NAME: webdav
      BACKEND_CHECK: webdav
    profiles:
      - test
      - webdav

  test-gcc:
    <<: *test-runner
    image: gcc:latest
    entrypoint: /sccache/tests/integration/scripts/test-gcc.sh
    environment:
      <<: *common-env
      SCCACHE_DIR: /tmp/sccache
    profiles:
      - test
      - gcc

  test-clang:
    <<: *test-runner
    image: silkeh/clang:21-trixie
    entrypoint: /sccache/tests/integration/scripts/test-clang.sh
    environment:
      <<: *common-env
      SCCACHE_DIR: /tmp/sccache
    profiles:
      - test
      - clang

  test-cmake:
    <<: *test-runner
    image: silkeh/clang:21-trixie
    entrypoint: /sccache/tests/integration/scripts/test-cmake.sh
    environment:
      <<: *common-env
      SCCACHE_DIR: /build/sccache
    profiles:
      - test
      - cmake

  test-cmake-modules:
    <<: *test-runner
    build:
      context: .
      dockerfile: cmake-modules.Dockerfile
    entrypoint: /sccache/tests/integration/scripts/test-cmake-modules.sh
    environment:
      <<: *common-env
      SCCACHE_DIR: /build/sccache
    profiles:
      - test
      - cmake-modules

  test-cmake-modules-v4:
    <<: *test-runner
    build:
      context: .
      dockerfile: cmake-modules-v4.Dockerfile
    entrypoint: /sccache/tests/integration/scripts/test-cmake-modules-v4.sh
    environment:
      <<: *common-env
      SCCACHE_DIR: /build/sccache
    profiles:
      - test
      - cmake-modules-v4

  test-autotools:
    <<: *test-runner
    image: gcc:latest
    entrypoint: /sccache/tests/integration/scripts/test-autotools.sh
    environment:
      <<: *common-env
      SCCACHE_DIR: /build/sccache
    profiles:
      - test
      - autotools

  test-coverage:
    <<: *test-runner
    image: rust:latest
    entrypoint: /sccache/tests/integration/scripts/test-coverage.sh
    environment:
      <<: *common-env
      SCCACHE_DIR: /build/sccache
    profiles:
      - test
      - coverage

  test-zstd:
    <<: *test-runner
    image: rust:latest
    entrypoint: /sccache/tests/integration/scripts/test-zstd.sh
    environment:
      <<: *common-env
      CARGO_INCREMENTAL: "0"
    profiles:
      - test
      - zstd

  test-basedirs:
    <<: *test-runner
    image: gcc:latest
    entrypoint: /sccache/tests/integration/scripts/test-basedirs.sh
    depends_on:
      redis:
        condition: service_healthy
      memcached:
        condition: service_healthy
      minio:
        condition: service_healthy
      minio-setup:
        condition: service_completed_successfully
      azurite:
        condition: service_healthy
      azurite-setup:
        condition: service_completed_successfully
      webdav:
        condition: service_started
    profiles:
      - test
      - basedirs

  test-multilevel:
    <<: *test-runner
    image: rust:latest
    entrypoint: /sccache/tests/integration/scripts/test-multilevel.sh
    depends_on:
      redis:
        condition: service_healthy
      memcached:
        condition: service_healthy
      minio:
        condition: service_healthy
      minio-setup:
        condition: service_completed_successfully
      azurite:
        condition: service_healthy
      azurite-setup:
        condition: service_completed_successfully
      webdav:
        condition: service_started
    profiles:
      - test
      - multilevel

  test-multilevel-chain:
    <<: *test-runner
    image: rust:latest
    entrypoint: /sccache/tests/integration/scripts/test-multilevel-chain.sh
    depends_on:
      redis:
        condition: service_healthy
      memcached:
        condition: service_healthy
      minio:
        condition: service_healthy
      minio-setup:
        condition: service_completed_successfully
    profiles:
      - test
      - multilevel-chain

volumes:
  cargo-cache:
  webdav-data:

networks:
  default:
    name: sccache-integration-tests