File tree Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -319,13 +319,16 @@ function generate_compiler_wrappers!(platform::AbstractPlatform; bin_path::Abstr
319319
320320 if allow_ccache
321321 write (io, """
322+ # Override `${CCACHE}` setting from the outside.
323+ CCACHE=""
322324 if [[ \$ {USE_CCACHE} == "true" ]]; then
323325 CCACHE="ccache"
324326 fi
325327 """ )
326328 end
329+ # Don't evaluate `${CCACHE}` at all if not allowed in the first place.
327330 write (io, """
328- vrun \$ {CCACHE} $(prog) "\$ {PRE_FLAGS[@]}" "\$ {ARGS[@]}" "\$ {POST_FLAGS[@]}"
331+ vrun $(allow_ccache ? " \$ {CCACHE} " : " " ) $(prog) "\$ {PRE_FLAGS[@]}" "\$ {ARGS[@]}" "\$ {POST_FLAGS[@]}"
329332 """ )
330333 end
331334
Original file line number Diff line number Diff line change 177177 """
178178 test_script = """
179179 set -e
180+ # Make sure setting `CCACHE` doesn't affect the compiler wrappers.
181+ export CCACHE=pwned
182+ export USE_CCACHE=false
180183 echo '$(test_c) ' > test.c
181184 echo '$(main_c) ' > main.c
182185 # Build object file
222225 set -e
223226 echo '$(test_cpp) ' > test.cpp
224227 echo '$(main_cpp) ' > main.cpp
228+ # Make sure setting `CCACHE` doesn't affect the compiler wrappers.
229+ export CCACHE=pwned
230+ export USE_CCACHE=true
225231 # Build object file
226232 $(compiler) $(needfpic) -Werror -std=c++11 -c test.cpp -o test.o
227233 # Link shared library
You can’t perform that action at this time.
0 commit comments