sccache/Cargo.toml

146 строки
4.5 KiB
TOML
Исходник Обычный вид История

[package]
name = "sccache"
version = "0.2.14-alpha.0"
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"
2016-12-16 03:55:19 +03:00
2017-05-25 19:46:37 +03:00
[badges]
travis-ci = { repository = "mozilla/sccache" }
appveyor = { repository = "mozilla/sccache" }
2018-08-04 16:36:35 +03:00
[[bin]]
name = "sccache"
[[bin]]
name = "sccache-dist"
required-features = ["dist-server"]
[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"
ar = { version = "0.8", optional = true }
atty = "0.2.6"
base64 = "0.11.0"
2018-08-30 23:08:17 +03:00
bincode = "1"
blake3 = "0.3"
Move from protobuf to bincode for a wire format This commit migrates away from the `protobuf` crate to instead just working with bincode on the wire as a serialization format. This is done by leveraging a few different crates: * The `bincode` and `serde_derive` crates are used to define serialization for Rust structures as well as provide a bincode implementation. * The `tokio_io::codec::length_delimited` module implements framing via length prefixes to transform an asynchronous stream of bytes into a literal `Stream` of `BytesMut`. * The `tokio_serde_bincode` crate is then used to tie it all together, parsing these `BytesMut` as the request/response types of sccache. Most of the changes here are related to moving away from the protobuf API throughout the codebase (e.g. `has_foo` and `take_foo`) towards a more rustic-ish API that just uses enums/structs. Overall it felt quite natural (as one would expect) to just use the raw enum/struct values. This may not be quite as performant as before but that doesn't really apply to sccache's use case where perf is hugely dominated by actually compiling and hashing, so I'm not too too worried about that. My personal motivation for this is twofold: 1. Using `protobuf` was a little clunky throughout the codebase and definitely had some sharp edges that felt good to smooth out. 2. There's currently what I believe some mysterious segfault and/or stray write happening in sccache and I'm not sure where. The `protobuf` crate had a lot of `unsafe` code and in lieu of actually auditing it I figured it'd be good to kill two birds with one stone. I have no idea if this fixes my segfault problem (I never could reproduce it) but I figured it's worth a shot.
2017-03-22 20:21:52 +03:00
byteorder = "1.0"
2018-08-28 14:37:42 +03:00
chrono = { version = "0.4", optional = true }
clap = "2.23.0"
counted-array = "0.1"
directories = "3"
env_logger = "0.5"
2018-08-28 14:56:27 +03:00
filetime = "0.2"
flate2 = { version = "1.0", optional = true, default-features = false, features = ["rust_backend"] }
futures = "0.1.11"
futures_03 = { package = "futures", version = "0.3", features = ["compat", "thread-pool"] }
hmac = { version = "0.10", optional = true }
http = "0.1"
hyper = { version = "0.12", optional = true }
hyperx = { version = "0.12", 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"
jsonwebtoken = { version = "7", optional = true }
lazy_static = "1.0.0"
libc = "0.2.10"
local-encoding = "0.2.0"
log = "0.4"
2020-02-24 21:53:35 +03:00
lru-disk-cache = { path = "lru-disk-cache", version = "0.4.0" }
md-5 = { version = "0.9", optional = true }
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"
number_prefix = "0.2.5"
openssl = { version = "0.10", optional = true }
2020-12-10 01:19:22 +03:00
percent-encoding = { version = "2", optional = true }
2020-12-09 12:03:48 +03:00
rand = "0.7"
redis = { version = "0.17", optional = true }
2018-08-28 15:02:13 +03:00
regex = "1"
reqwest = { version = "0.9.11", optional = true }
retry = "0.4.0"
ring = { version = "0.16", optional = true, features = ["std"] }
sha-1 = { version = "0.9", optional = true }
sha2 = { version = "0.9", optional = true }
serde = "1.0"
serde_derive = "1.0"
serde_json = "1.0"
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"
2016-06-28 14:12:54 +03:00
time = "0.1.35"
tokio-compat = "0.1"
tokio-io = "0.1"
2018-08-28 15:37:11 +03:00
tokio-process = "0.2"
tokio-serde-bincode = "0.1"
tower = "0.1"
tokio-tcp = "0.1"
tokio-timer = "0.2"
toml = "0.5"
untrusted = { version = "0.7", optional = true }
2020-12-10 01:19:22 +03:00
url = { version = "2", optional = true }
uuid = { version = "0.8", features = ["v4"] }
walkdir = "2"
# by default which pulls in an outdated failure version
which = { version = "4", default-features = false }
zip = { version = "0.5", default-features = false }
zstd = { version = "0.5" }
# dist-server only
2018-08-28 14:55:46 +03:00
crossbeam-utils = { version = "0.5", optional = true }
2018-08-04 16:36:35 +03:00
libmount = { version = "0.1.10", optional = true }
nix = { version = "0.18", optional = true }
rouille = { version = "3", optional = true, default-features = false, features = ["ssl"] }
syslog = { version = "5", optional = true }
void = { version = "1", optional = true }
2020-12-08 10:56:42 +03:00
version-compare = { version = "0.0.11", optional = true }
[patch.crates-io]
# Waiting for #151 to make it into a release
tiny_http = { git = "https://github.com/tiny-http/tiny-http.git", rev = "619680de" }
[dev-dependencies]
assert_cmd = "1"
cc = "1.0"
2018-08-28 14:37:42 +03:00
chrono = "0.4"
itertools = "0.9"
predicates = "1"
selenium-rs = "0.1"
2016-10-26 23:22:52 +03:00
[target.'cfg(unix)'.dependencies]
daemonize = "0.4"
2018-08-28 15:22:37 +03:00
tokio-uds = "0.2"
2016-10-26 23:22:52 +03:00
[target.'cfg(windows)'.dependencies]
tokio-named-pipes = "0.1"
tokio-reactor = "0.1"
2019-06-21 20:44:38 +03:00
[target.'cfg(windows)'.dependencies.winapi]
version = "0.3"
features = [
"fileapi",
"handleapi",
"winnls",
]
[features]
default = ["dist-client", "s3"]
all = ["dist-client", "redis", "s3", "memcached", "gcs", "azure"]
azure = ["chrono", "hyper", "hyperx", "url", "hmac", "md-5", "sha2"]
s3 = ["chrono", "hyper", "hyperx", "reqwest", "simple-s3", "hmac", "sha-1"]
simple-s3 = []
2020-12-10 01:19:22 +03:00
gcs = ["chrono", "hyper", "hyperx", "percent-encoding", "reqwest", "ring", "untrusted", "url"]
memcached = ["memcached-rs"]
# Enable features that require unstable features of Nightly Rust.
unstable = []
# Enables distributed support in the sccache client
dist-client = ["ar", "flate2", "hyper", "hyperx", "reqwest", "url", "sha2"]
2018-08-04 16:36:35 +03:00
# Enables the sccache-dist binary
dist-server = ["crossbeam-utils", "jsonwebtoken", "flate2", "libmount", "nix", "openssl", "reqwest", "rouille", "syslog", "void", "version-compare"]
2018-10-23 10:33:42 +03:00
# Enables dist tests with external requirements
dist-tests = ["dist-client", "dist-server"]
[workspace]
exclude = ["tests/test-crate"]