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
319
319
320
320
if allow_ccache
321
321
write (io, """
322
+ # Override `\$ {CCACHE}` setting from the outside.
323
+ CCACHE=""
322
324
if [[ \$ {USE_CCACHE} == "true" ]]; then
323
325
CCACHE="ccache"
324
326
fi
325
327
""" )
326
328
end
329
+ # Don't evaluate `${CCACHE}` at all if not allowed in the first place.
327
330
write (io, """
328
- vrun \$ {CCACHE} $(prog) "\$ {PRE_FLAGS[@]}" "\$ {ARGS[@]}" "\$ {POST_FLAGS[@]}"
331
+ vrun $(allow_ccache ? " \$ {CCACHE} " : " " ) $(prog) "\$ {PRE_FLAGS[@]}" "\$ {ARGS[@]}" "\$ {POST_FLAGS[@]}"
329
332
""" )
330
333
end
331
334
Original file line number Diff line number Diff line change 177
177
"""
178
178
test_script = """
179
179
set -e
180
+ # Make sure setting `CCACHE` doesn't affect the compiler wrappers.
181
+ export CCACHE=pwned
182
+ export USE_CCACHE=false
180
183
echo '$(test_c) ' > test.c
181
184
echo '$(main_c) ' > main.c
182
185
# Build object file
222
225
set -e
223
226
echo '$(test_cpp) ' > test.cpp
224
227
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
225
231
# Build object file
226
232
$(compiler) $(needfpic) -Werror -std=c++11 -c test.cpp -o test.o
227
233
# Link shared library
You can’t perform that action at this time.
0 commit comments