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.74k stars 542 forks source link

`--show-stats` start the server on first use #1481

Open mwestphal opened 1 year ago

mwestphal commented 1 year ago

When running sccache --show-stats before running any other sccache command, a sccache server will be run.

Steps to reproduce:

sccache: Starting the server...
sccache: error: Server startup failed: Address in use

Discovered when using --show-stats to recover path to cache in CI.

Xuanwo commented 1 year ago

This behavior is by design now. --show-stats will send a call to the server and get stats from it.

Cc our maintainers @sylvestre @drahnr to make a decision.

mwestphal commented 1 year ago

from a user POV, having consistent behavior of starting/stopping server without needing to keep track of special cases would be good.

Either solution works for me, but second one is at least not breaking retro compat.

Xuanwo commented 1 year ago
  • Maybe it's better to print a warning message --start-server with existing server?

I prefer this variant. I will implement this if there are no objections.