2016-04-26 23:43:03 +03:00
[ package ]
name = "sccache"
2022-10-16 22:45:55 +03:00
version = "0.3.1"
2017-05-25 19:46:37 +03:00
authors = [ "Ted Mielczarek <ted@mielczarek.org>" , "Alex Crichton <alex@alexcrichton.com>" ]
2016-12-16 03:55:19 +03:00
license = "Apache-2.0"
description = "Sccache is a ccache-like tool. It is used as a compiler wrapper and avoids compilation when possible, storing a cache in a remote storage using the S3 API."
repository = "https://github.com/mozilla/sccache/"
2017-05-25 19:46:37 +03:00
readme = "README.md"
categories = [ "command-line-utilities" , "development-tools::build-utils" ]
keywords = [ "ccache" ]
2019-06-02 08:15:00 +03:00
edition = "2018"
2022-05-05 17:47:19 +03:00
rust-version = "1.58"
2016-12-16 03:55:19 +03:00
2018-08-04 16:36:35 +03:00
[ [ bin ] ]
name = "sccache"
[ [ bin ] ]
name = "sccache-dist"
required-features = [ "dist-server" ]
2016-04-26 23:43:03 +03:00
[ dependencies ]
Change error handling from `error-chain` to `anyhow`.
Because `anyhow` is what seems to be the most common error library for
applications these days.
- The global `Result` type is now `anyhow::Result`.
- In errors.rs, there's no need for any boilerplate to wrap all the foreign
errors seen: `hyper::Error`, `io:Error`, etc.
- The internal errors that we care about are now separate types, rather
than within an enum, because that works better when we need to check for them
by downcasting an `anyhow::Error`. And it's nice to write
`Err(ProcessError(output))` rather than
`Err(ErrorKind::ProcessError(output))`.
- The `Which` error was unused and is removed.
- The most common change is that `.chain_err()` is changed to
`.context`/`.with_context()`.
- `anyhow!` is used where necessary, mostly to promote a string to an
`anyhow::Error`.
- Errors within futures: `FutureChainErr`/`.chain_err()` is changed to
`FutureContext`/`fcontext`/`fwith_context`. The `f` prefix is because I found
it helpful to distinguish these cases from the simple error cases.
- `BuilderIncoming`, `SchedulerIncoming`, `ServerIncoming` no longer have an
`Error` associated type, we just use `anyhow::Error` uniformly.
- `e.display_chain()` changes to `format!("{:?}")`, because they both print the
full cause chain, and the backtrace (if present).
- A few places where the old code was doing something weird or more
complicated than seemed necessary, I generally tried to replace it with
something simpler and more typical. Two places used `with_boxed_chain()`,
which doesn't have an equivalent in `anyhow`, so I did my best to do
something reasonable.
- In `src/server.rs` we now import `std::task::Context` as `TaskContext` to
avoid overshadowing the `anyhow::Context` trait :(
2020-06-02 10:22:31 +03:00
anyhow = "1.0"
2022-03-03 18:06:37 +03:00
ar = "0.9"
2021-04-08 21:30:17 +03:00
async-trait = "0.1"
2018-09-04 22:36:28 +03:00
atty = "0.2.6"
2020-12-10 02:00:26 +03:00
base64 = "0.13"
2018-08-30 23:08:17 +03:00
bincode = "1"
2022-05-05 17:47:19 +03:00
blake3 = "1"
2017-03-22 20:21:52 +03:00
byteorder = "1.0"
2021-11-12 15:28:26 +03:00
bytes = "1"
2022-08-15 20:45:25 +03:00
chrono = { version = "0.4.22" , optional = true }
2022-04-01 06:38:11 +03:00
clap = { version = "3.2.22" , features = [ "derive" , "env" , "wrap_help" ] }
2022-02-12 18:09:32 +03:00
directories = "4.0.1"
2022-02-12 18:02:37 +03:00
env_logger = "0.9"
2018-08-28 14:56:27 +03:00
filetime = "0.2"
2018-09-04 22:36:28 +03:00
flate2 = { version = "1.0" , optional = true , default-features = false , features = [ "rust_backend" ] }
2021-04-08 21:30:17 +03:00
futures = "0.3"
2022-02-16 08:40:31 +03:00
futures-locks = "0.7"
2022-06-22 10:22:38 +03:00
gzp = { version = "0.10" , default-features = false , features = [ "deflate_rust" ] }
2022-02-14 22:44:46 +03:00
hmac = { version = "0.12.0" , optional = true }
2021-04-08 21:30:17 +03:00
http = "0.2"
2021-11-12 15:28:26 +03:00
hyper = { version = "0.14" , optional = true , features = [ "server" ] }
2022-02-12 20:46:53 +03:00
hyperx = { version = "1.0" , optional = true }
Add jobserver support to sccache
This commit alters the main sccache server to operate and orchestrate its own
GNU make style jobserver. This is primarily intended for interoperation with
rustc itself.
The Rust compiler currently has a multithreaded mode where it will execute code
generation and optimization on the LLVM side of things in parallel. This
parallelism, however, can overload a machine quickly if not properly accounted
for (e.g. if 10 rustcs all spawn 10 threads...). The usage of a GNU make style
jobserver is intended to arbitrate and rate limit all these rustc instances to
ensure that one build's maximal parallelism never exceeds a particular amount.
Currently for Rust Cargo is the primary driver for setting up a jobserver. Cargo
will create this and manage this per compilation, ensuring that any one `cargo
build` invocation never exceeds a maximal parallelism. When sccache enters the
picture, however, the story gets slightly more odd.
The jobserver implementation on Unix relies on inheritance of file descriptors
in spawned processes. With sccache, however, there's no inheritance as the
actual rustc invocation is spawned by the server, not the client. In this case
the env vars used to configure the jobsever are usually incorrect.
To handle this problem this commit bakes a jobserver directly into sccache
itself. The jobserver then overrides whatever jobserver the client has
configured in its own env vars to ensure correct operation. The settings of each
jobserver may be misconfigured (there's no way to configure sccache's jobserver
right now), but hopefully that's not too much of a problem for the forseeable
future.
The implementation here was to provide a thin wrapper around the `jobserver`
crate with a futures-based interface. This interface was then hooked into the
mock command infrastructure to automatically acquire a jobserver token when
spawning a process and automatically drop the token when the process exits.
Additionally, all spawned processes will now automatically receive a configured
jobserver.
cc rust-lang/rust#42867, the original motivation for this commit
2017-09-27 19:14:51 +03:00
jobserver = "0.1"
2022-05-05 17:47:19 +03:00
jsonwebtoken = { version = "8" , optional = true }
2018-09-04 22:36:28 +03:00
lazy_static = "1.0.0"
2022-10-11 20:45:55 +03:00
libc = "0.2.135"
2021-01-07 08:08:48 +03:00
linked-hash-map = "0.5"
2018-08-28 14:41:11 +03:00
log = "0.4"
2022-09-23 23:39:24 +03:00
md-5 = { version = "0.10.5" , optional = true }
2020-06-11 06:10:33 +03:00
memcached-rs = { version = "0.4" , optional = true }
Add jobserver support to sccache
This commit alters the main sccache server to operate and orchestrate its own
GNU make style jobserver. This is primarily intended for interoperation with
rustc itself.
The Rust compiler currently has a multithreaded mode where it will execute code
generation and optimization on the LLVM side of things in parallel. This
parallelism, however, can overload a machine quickly if not properly accounted
for (e.g. if 10 rustcs all spawn 10 threads...). The usage of a GNU make style
jobserver is intended to arbitrate and rate limit all these rustc instances to
ensure that one build's maximal parallelism never exceeds a particular amount.
Currently for Rust Cargo is the primary driver for setting up a jobserver. Cargo
will create this and manage this per compilation, ensuring that any one `cargo
build` invocation never exceeds a maximal parallelism. When sccache enters the
picture, however, the story gets slightly more odd.
The jobserver implementation on Unix relies on inheritance of file descriptors
in spawned processes. With sccache, however, there's no inheritance as the
actual rustc invocation is spawned by the server, not the client. In this case
the env vars used to configure the jobsever are usually incorrect.
To handle this problem this commit bakes a jobserver directly into sccache
itself. The jobserver then overrides whatever jobserver the client has
configured in its own env vars to ensure correct operation. The settings of each
jobserver may be misconfigured (there's no way to configure sccache's jobserver
right now), but hopefully that's not too much of a problem for the forseeable
future.
The implementation here was to provide a thin wrapper around the `jobserver`
crate with a futures-based interface. This interface was then hooked into the
mock command infrastructure to automatically acquire a jobserver token when
spawning a process and automatically drop the token when the process exits.
Additionally, all spawned processes will now automatically receive a configured
jobserver.
cc rust-lang/rust#42867, the original motivation for this commit
2017-09-27 19:14:51 +03:00
num_cpus = "1.0"
2020-12-10 02:03:49 +03:00
number_prefix = "0.4"
2018-08-28 15:25:42 +03:00
openssl = { version = "0.10" , optional = true }
2020-12-10 01:19:22 +03:00
percent-encoding = { version = "2" , optional = true }
2022-02-12 18:20:14 +03:00
rand = "0.8.4"
2022-11-08 20:06:46 +03:00
regex = "1.7.0"
2022-04-26 18:14:57 +03:00
reqwest = { version = "0.11" , features = [ "json" , "blocking" , "stream" ] , optional = true }
2022-09-19 20:44:22 +03:00
retry = "2"
2020-12-09 10:46:21 +03:00
ring = { version = "0.16" , optional = true , features = [ "std" ] }
2022-07-16 11:20:36 +03:00
rredis = { package = "redis" , version = "0.21" , optional = true , default-features = false , features = [ "aio" , "tokio-comp" , "tokio-native-tls-comp" ] }
2022-08-04 12:13:04 +03:00
semver = "1.0"
2022-02-14 22:44:46 +03:00
sha-1 = { version = "0.10.0" , optional = true }
2022-09-16 22:39:02 +03:00
sha2 = { version = "0.10.6" , optional = true }
2017-05-18 23:53:00 +03:00
serde = "1.0"
serde_derive = "1.0"
2017-06-14 12:43:05 +03:00
serde_json = "1.0"
2018-02-02 15:11:11 +03:00
strip-ansi-escapes = "0.1"
2018-04-12 04:25:15 +03:00
tar = "0.4"
2018-08-28 15:20:49 +03:00
tempfile = "3"
2021-11-12 15:28:26 +03:00
tokio = { version = "1" , features = [ "rt-multi-thread" , "io-util" , "time" , "net" , "process" , "macros" ] }
tokio-serde = "0.8"
2022-06-23 22:07:33 +03:00
tokio-util = { version = "0.7" , features = [ "codec" , "io" ] }
2021-11-12 15:28:26 +03:00
tower = "0.4"
2020-06-11 06:10:33 +03:00
toml = "0.5"
2020-12-10 01:19:22 +03:00
url = { version = "2" , optional = true }
2022-10-11 20:45:49 +03:00
uuid = { version = "1.2" , features = [ "v4" ] }
2020-06-11 06:10:33 +03:00
walkdir = "2"
2020-03-20 22:13:32 +03:00
# by default which pulls in an outdated failure version
2020-06-11 06:10:33 +03:00
which = { version = "4" , default-features = false }
2022-06-23 09:57:54 +03:00
zip = { version = "0.6" , default-features = false }
2022-06-23 10:23:17 +03:00
zstd = "0.11"
2016-05-12 21:47:46 +03:00
2018-09-04 22:36:28 +03:00
# dist-server only
2020-10-07 05:42:26 +03:00
crossbeam-utils = { version = "0.8" , optional = true }
2018-08-04 16:36:35 +03:00
libmount = { version = "0.1.10" , optional = true }
2022-08-15 20:45:30 +03:00
nix = { version = "0.25.0" , optional = true }
2022-05-05 17:47:19 +03:00
rouille = { version = "3.5" , optional = true , default-features = false , features = [ "ssl" ] }
syslog = { version = "6" , optional = true }
2018-10-26 22:34:03 +03:00
void = { version = "1" , optional = true }
2022-02-12 20:07:09 +03:00
version-compare = { version = "0.1.0" , optional = true }
2018-10-26 22:34:03 +03:00
2017-04-03 17:21:13 +03:00
[ dev-dependencies ]
2022-10-20 20:41:51 +03:00
assert_cmd = "=2.0.5"
2018-02-01 18:35:56 +03:00
cc = "1.0"
2018-08-28 14:37:42 +03:00
chrono = "0.4"
2021-01-08 10:28:43 +03:00
itertools = "0.10"
2022-02-12 20:01:30 +03:00
predicates = "=2.1.1"
2021-12-06 19:22:21 +03:00
thirtyfour_sync = "0.27"
2022-10-31 21:20:19 +03:00
once_cell = "1.16"
2022-08-11 11:13:27 +03:00
serial_test = "0.9"
2022-10-11 20:46:03 +03:00
wiremock = "0.5.15"
2017-04-03 17:21:13 +03:00
2016-10-26 23:22:52 +03:00
[ target . 'cfg(unix)' . dependencies ]
2020-06-11 06:10:33 +03:00
daemonize = "0.4"
2016-10-26 23:22:52 +03:00
2017-01-27 22:39:47 +03:00
[ target . 'cfg(windows)' . dependencies ]
2021-11-12 15:28:26 +03:00
parity-tokio-ipc = "0.9"
2017-01-27 22:39:47 +03:00
2019-06-21 20:44:38 +03:00
[ target . 'cfg(windows)' . dependencies . winapi ]
version = "0.3"
features = [
"fileapi" ,
"handleapi" ,
2022-10-28 10:44:05 +03:00
"stringapiset" ,
2019-06-21 20:44:38 +03:00
"winnls" ,
]
2016-12-13 17:44:20 +03:00
[ features ]
2020-12-10 04:17:57 +03:00
default = [ "all" ]
2019-04-03 18:06:48 +03:00
all = [ "dist-client" , "redis" , "s3" , "memcached" , "gcs" , "azure" ]
2021-03-02 14:43:29 +03:00
azure = [ "chrono" , "hyper" , "hyperx" , "reqwest" , "url" , "hmac" , "md-5" , "sha2" ]
2019-10-25 02:43:35 +03:00
s3 = [ "chrono" , "hyper" , "hyperx" , "reqwest" , "simple-s3" , "hmac" , "sha-1" ]
2017-02-16 23:17:24 +03:00
simple-s3 = [ ]
2022-02-12 19:06:53 +03:00
gcs = [ "chrono" , "hyper" , "hyperx" , "percent-encoding" , "reqwest" , "ring" , "url" ]
2017-08-10 17:50:33 +03:00
memcached = [ "memcached-rs" ]
2020-12-11 03:54:09 +03:00
native-zlib = [ ]
2022-07-16 11:20:36 +03:00
redis = [ "url" , "rredis" ]
2016-12-13 17:44:20 +03:00
# Enable features that require unstable features of Nightly Rust.
unstable = [ ]
2018-07-31 01:06:14 +03:00
# Enables distributed support in the sccache client
2022-03-03 18:06:37 +03:00
dist-client = [ "flate2" , "hyper" , "hyperx" , "reqwest" , "url" , "sha2" ]
2018-08-04 16:36:35 +03:00
# Enables the sccache-dist binary
2020-08-17 23:16:37 +03:00
dist-server = [ "crossbeam-utils" , "jsonwebtoken" , "flate2" , "hyperx" , "libmount" , "nix" , "openssl" , "reqwest" , "rouille" , "syslog" , "void" , "version-compare" ]
2018-10-23 10:33:42 +03:00
# Enables dist tests with external requirements
2019-11-11 16:02:58 +03:00
dist-tests = [ "dist-client" , "dist-server" ]
2016-12-13 17:44:20 +03:00
2016-11-29 03:59:42 +03:00
[ workspace ]
2017-10-25 21:09:27 +03:00
exclude = [ "tests/test-crate" ]