Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

support for gcc compiler options being a file via @file option #43

Closed
andreparodi opened this issue Dec 9, 2016 · 3 comments
Closed

Comments

@andreparodi
Copy link

andreparodi commented Dec 9, 2016

we are using a file to specify our compiler options to gcc via the @file option. I have tested a trivial compilation and as soon as I do this I see the stats counting this compile as Non-cacheable calls. I believe it's hitting the gcc.rs:109. What I find misleading the the comment in the previous line talking about using a response file.

any command line parameter starting with @ should be a file with the gcc options. Would be awesome to have support for that.

https://gcc.gnu.org/onlinedocs/gcc/Overall-Options.html#Overall-Options
@file
Read command-line options from file. The options read are inserted in place of the original @file option. If file does not exist, or cannot be read, then the option will be treated literally, and not removed.
Options in file are separated by whitespace. A whitespace character may be included in an option by surrounding the entire option in either single or double quotes. Any character (including a backslash) may be included by prefixing the character to be included with a backslash. The file may itself contain additional @file options; any such options will be processed recursively.

@andreparodi
Copy link
Author

will try to submit a patch but need to get through introduction to rust first.

@luser
Copy link
Contributor

luser commented Dec 12, 2016

@glandium and I chatted about this as we were reviewing the existing set of sccache issues. The right way to do this would be to replace the @file with its contents in the commandline for the purposes of generating the hash key, but keep it there for actually running the compiler.

@alexcrichton
Copy link
Contributor

Looks like an LLVM build runs into this on MinGW as well. The CMake build system there passes arguments that look like:

@CMakeFiles/LLVMOption.dir/includes_CXX.rsp

and that causes sccache to fail to cache most compiles.

(just another data point)

alexcrichton added a commit to alexcrichton/sccache that referenced this issue Jan 30, 2017
This commit adds support for the `@file` option that gcc/clang supports. This
option means that an `file` should be read and `@file` should be replaced with
all the options specified in `file`.

The online documentation indicates that gcc supports arguments with spaces
through quoting, but this seemed like it may be nontrivial to implement, so I
figured that for now those cases could continue to be un-cacheable.

Closes mozilla#43
@luser luser closed this as completed in #65 Jan 30, 2017
luser pushed a commit that referenced this issue Jan 30, 2017
This commit adds support for the `@file` option that gcc/clang supports. This
option means that an `file` should be read and `@file` should be replaced with
all the options specified in `file`.

The online documentation indicates that gcc supports arguments with spaces
through quoting, but this seemed like it may be nontrivial to implement, so I
figured that for now those cases could continue to be un-cacheable.

Closes #43
alexcrichton added a commit to alexcrichton/rust that referenced this issue Feb 27, 2017
Now that mozilla/sccache#43 is fixed the caching works for MinGW on Windows. We
still can't use it for MSVC just yet, but I'll try to revive that branch at some
point.
bors added a commit to rust-lang/rust that referenced this issue Feb 28, 2017
appveyor: Use sccache on pc-windows-gnu for caching

Now that mozilla/sccache#43 is fixed the caching works for MinGW on Windows. We
still can't use it for MSVC just yet, but I'll try to revive that branch at some
point.
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants