mozilla / sccache

Sccache is a ccache-like tool. It is used as a compiler wrapper and avoids compilation when possible. Sccache has the capability to utilize caching in remote storage environments, including various cloud storage options, or alternatively, in local storage.
Apache License 2.0
5.85k stars 552 forks source link

failed to execute compile #2204

Open jaynnn opened 5 months ago

jaynnn commented 5 months ago

step:

sccache: caused by: Compiler not supported: "error: unexpected argument \'-E\' found\n\nUsage: cargo [+toolchain] [OPTIONS] [COMMAND]\n       cargo [+toolchain] [OPTIONS] -Zscript <MANIFEST_RS> [ARGS]...\n\nFor more information, try \'--help\'.\n"

extra:

$ sccache --version
sccache 0.8.1

$ sccache -s
Compile requests                      1
Compile requests executed             0
Cache hits                            0
Cache misses                          0
Cache timeouts                        0
Cache read errors                     0
Forced recaches                       0
Cache write errors                    0
Compilation failures                  0
Cache errors                          0
Non-cacheable compilations            0
Non-cacheable calls                   0
Non-compilation calls                 0
Unsupported compiler calls            1
Average cache write               0.000 s
Average compiler                  0.000 s
Average cache read hit            0.000 s
Failed distributed compilations       0
Cache location                  Local disk: "D:\\tools\\sccache\\cache"
Use direct/preprocessor mode?   yes
Version (client)                0.8.1
Max cache size                       10 GiB

rustc --version
rustc 1.77.2 (25ef9e3d8 2024-04-09)

platform: windows 11

commands i've execute cargo install sccache --locked setx RUSTC_WRAPPER "MYPATH\sccache.exe"

AJIOB commented 5 months ago

Hi @jaynnn,

You shouldn't call the sccache cargo build, just use the cargo build instead, if you configure a caching correctly (via config file or environment).

cargo itself is not a compiler. The sccache wants a compiler as an argument, rustc is a compiler.

AJIOB commented 4 months ago

Hi @jaynnn,

Is it your problem fixed?

If yes, please, close the issue. If no, please, provide more details.