Response files are a way for compilers to accept arguments that would otherwise overflow the character limit in the command line. On Windows in particular, the character limit per command is 8191 characters. These files can contain additional options that the compiler will read and process as if they were provided in the original command. Each compiler that supports response files has different formats/expectations and implementations. Support for response files are also re-implemented per compiler by sccache so it can cache compilations accurately. There is currently support for response files on the gcc and msvc implementations in sccache.
As defined by the gcc docs:
\\
, \?
, \@
, etc).Implementation details:
"
or '
), the @file arg is treated literally and not removed (and its content not processed).-include@foo
(see #150 for more on this).Per the MSVC docs:
\
) cannot be used to combine options across multiple lines./link
directive has special treatment:/link
option is provided prior to an @file
in the command line, the /link
directive does not affect any options within the @file
./link
directive provided in an @file
on one line does not affect the next line./link
directive on the final line of a response file does not affect options following the @file
option in the command line.@file
options, they are not recursive. (found in a separate doc)"
), which allows whitespace to be preserved within the optionThe msvc implementaion in sccache supports all of these except #4, because sccache doesn't accept the /link
directive.
Additionally, because msbuild
generates response files using an encoding other than utf-8
, all text files under the WHATWG encoding standard are supported. This includes both utf-8
and utf-16
.