File tree Expand file tree Collapse file tree 3 files changed +38
-10
lines changed
Expand file tree Collapse file tree 3 files changed +38
-10
lines changed Original file line number Diff line number Diff line change 1- export RUSTC_WRAPPER=${RUSTC_WRAPPER:-/ usr/ bin/ sccache} ;
2- export CMAKE_C_COMPILER_LAUNCHER=${CMAKE_C_COMPILER_LAUNCHER:-/ usr/ bin/ sccache} ;
3- export CMAKE_CXX_COMPILER_LAUNCHER=${CMAKE_CXX_COMPILER_LAUNCHER:-/ usr/ bin/ sccache} ;
4- export CMAKE_CUDA_COMPILER_LAUNCHER=${CMAKE_CUDA_COMPILER_LAUNCHER:-/ usr/ bin/ sccache} ;
1+ if test -z " ${DISABLE_SCCACHE+x} " ; then
2+ # Log sccache server messages
3+ export SCCACHE_ERROR_LOG=" ${SCCACHE_ERROR_LOG:-/ var/ log/ devcontainer-utils/ sccache.log} " ;
4+ export SCCACHE_SERVER_LOG=" ${SCCACHE_SERVER_LOG:- sccache=info} " ;
5+
6+ # Use sccache for Rust, C, C++, and CUDA compilations
7+ if ! test -v RUSTC_WRAPPER; then
8+ export RUSTC_WRAPPER=" ${RUSTC_WRAPPER:-/ usr/ bin/ sccache} " ;
9+ fi
10+ if ! test -v CMAKE_C_COMPILER_LAUNCHER; then
11+ export CMAKE_C_COMPILER_LAUNCHER=" ${CMAKE_C_COMPILER_LAUNCHER:-/ usr/ bin/ sccache} " ;
12+ fi
13+ if ! test -v CMAKE_CXX_COMPILER_LAUNCHER; then
14+ export CMAKE_CXX_COMPILER_LAUNCHER=" ${CMAKE_CXX_COMPILER_LAUNCHER:-/ usr/ bin/ sccache} " ;
15+ fi
16+ if ! test -v CMAKE_CUDA_COMPILER_LAUNCHER; then
17+ export CMAKE_CUDA_COMPILER_LAUNCHER=" ${CMAKE_CUDA_COMPILER_LAUNCHER:-/ usr/ bin/ sccache} " ;
18+ fi
19+ fi
Original file line number Diff line number Diff line change 11{
22 "name" : " sccache" ,
33 "id" : " sccache" ,
4- "version" : " 25.4.0 " ,
4+ "version" : " 25.4.1 " ,
55 "description" : " A feature to install sccache" ,
66 "options" : {
7+ "repository" : {
8+ "type" : " string" ,
9+ "proposals" : [
10+ " mozilla/sccache"
11+ ],
12+ "default" : " mozilla/sccache" ,
13+ "description" : " The GitHub repository from which to install the sccache binary."
14+ },
715 "version" : {
816 "type" : " string" ,
917 "proposals" : [
Original file line number Diff line number Diff line change 22set -e
33
44SCCACHE_VERSION=" ${VERSION:- latest} " ;
5+ SCCACHE_REPOSITORY=" ${REPOSITORY:- " mozilla/sccache" } " ;
56
67# Ensure we're in this feature's directory during build
78cd " $( cd " $( dirname " ${BASH_SOURCE[0]} " ) " && pwd ) " ;
@@ -13,14 +14,18 @@ check_packages jq wget ca-certificates bash-completion;
1314
1415echo " Installing sccache..." ;
1516
16- if [ $SCCACHE_VERSION == latest ] ; then
17- find_version_from_git_tags SCCACHE_VERSION https://github.com/mozilla/sccache ;
17+ if test " $SCCACHE_VERSION " = latest; then
18+ find_version_from_git_tags SCCACHE_VERSION " https://github.com/$SCCACHE_REPOSITORY " ;
1819fi
1920
2021# Install sccache
21- wget --no-hsts -q -O- " https://github.com/mozilla/sccache/releases/download/v$SCCACHE_VERSION /sccache-v$SCCACHE_VERSION -$( uname -p) -unknown-linux-musl.tar.gz" \
22- | tar -C /usr/bin -zf - --wildcards --strip-components=1 -x * /sccache \
23- && chmod +x /usr/bin/sccache;
22+ wget --no-hsts -q -O- \
23+ " https://github.com/$SCCACHE_REPOSITORY /releases/download/v$SCCACHE_VERSION /sccache-v$SCCACHE_VERSION -$( uname -m) -unknown-linux-musl.tar.gz" \
24+ | tar -C /usr/bin -zf - --wildcards --strip-components=1 -x ' */sccache' ;
25+
26+ mkdir -m 0777 -p /var/log/devcontainer-utils;
27+ touch /var/log/devcontainer-utils/sccache.log;
28+ chmod 0777 /var/log/devcontainer-utils/sccache.log;
2429
2530# export envvars in /etc/bash.bashrc
2631append_to_etc_bashrc " $( cat .bashrc) " ;
You can’t perform that action at this time.
0 commit comments