sccache/Cargo.toml

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

[package]
edition = "2021"
name = "sccache"
2023-10-17 11:51:52 +03:00
rust-version = "1.67.1"
2023-11-27 12:15:33 +03:00
version = "0.7.4"
2017-05-25 19:46:37 +03:00
categories = ["command-line-utilities", "development-tools::build-utils"]
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 various cloud storage."
2017-05-25 19:46:37 +03:00
keywords = ["ccache"]
license = "Apache-2.0"
readme = "README.md"
repository = "https://github.com/mozilla/sccache/"
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"]
2023-01-15 20:18:20 +03:00
[profile.release]
codegen-units = 1
lto = true
strip = true
[dependencies]
anyhow = { version = "1.0", features = ["backtrace"] }
ar = "0.9"
async-trait = "0.1"
base64 = "0.21"
2018-08-30 23:08:17 +03:00
bincode = "1"
blake3 = "1"
byteorder = "1.5"
bytes = "1"
chrono = "0.4"
clap = { version = "4.1.11", features = ["derive", "env", "wrap_help"] }
directories = "5.0.1"
encoding = "0.2"
env_logger = "0.10"
2018-08-28 14:56:27 +03:00
filetime = "0.2"
flate2 = { version = "1.0", optional = true, default-features = false, features = [
"rust_backend",
] }
fs-err = "2.9"
futures = "0.3"
gzp = { version = "0.11.3", default-features = false, features = [
"deflate_rust",
] }
http = "0.2"
hyper = { version = "0.14.27", optional = true, features = ["server"] }
is-terminal = "0.4.7"
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"
jwt = { package = "jsonwebtoken", version = "8", optional = true }
2023-11-04 23:22:14 +03:00
libc = "0.2.149"
linked-hash-map = "0.5"
log = "0.4"
memchr = "2"
num_cpus = "1.16"
2020-12-10 02:03:49 +03:00
number_prefix = "0.4"
once_cell = "1.18"
opendal = { version = "0.43.0", optional = true }
openssl = { version = "0.10.55", optional = true }
rand = "0.8.4"
regex = "1.8.4"
reqsign = { version = "0.14.1", optional = true }
reqwest = { version = "0.11", features = [
"json",
"blocking",
"stream",
"rustls-tls",
"trust-dns",
], optional = true }
retry = "2"
semver = "1.0"
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
sha2 = { version = "0.10.6", optional = true }
strip-ansi-escapes = "0.1"
2022-11-27 05:41:29 +03:00
tar = "0.4.36"
2018-08-28 15:20:49 +03:00
tempfile = "3"
# trust-dns-resolver must be kept in sync with the version reqwest uses
mime = "0.3"
tokio = { version = "1", features = [
"rt-multi-thread",
"io-util",
"time",
"net",
"process",
"macros",
] }
tokio-serde = "0.8"
tokio-util = { version = "0.7", features = ["codec", "io"] }
toml = "0.8"
tower = "0.4"
trust-dns-resolver = { version = "0.22.0", features = [
"dnssec-ring",
"dns-over-rustls",
"dns-over-https-rustls",
], optional = true }
2020-12-10 01:19:22 +03:00
url = { version = "2", optional = true }
uuid = { version = "1.3", features = ["v4"] }
walkdir = "2"
# by default which pulls in an outdated failure version
which = { version = "4", default-features = false }
zip = { version = "0.6", default-features = false }
zstd = "0.13"
# dist-server only
memmap2 = "0.9.0"
nix = { version = "0.26.4", optional = true }
object = "0.30"
rouille = { version = "3.6", optional = true, default-features = false, features = [
"ssl",
] }
syslog = { version = "6", optional = true }
version-compare = { version = "0.1.1", optional = true }
[dev-dependencies]
assert_cmd = "2.0.12"
cc = "1.0"
chrono = "0.4.26"
filetime = "0.2"
2021-01-08 10:28:43 +03:00
itertools = "0.10"
predicates = "=3.0.3"
serial_test = "2.0"
temp-env = "0.3.4"
test-case = "3.3.1"
thirtyfour_sync = "0.27"
2016-10-26 23:22:52 +03:00
[target.'cfg(unix)'.dependencies]
daemonize = "0.5"
2016-10-26 23:22:52 +03:00
[target.'cfg(not(target_os = "freebsd"))'.dependencies.libmount]
optional = true
version = "0.1.10"
2019-06-21 20:44:38 +03:00
[target.'cfg(windows)'.dependencies.winapi]
features = ["fileapi", "handleapi", "stringapiset", "winnls"]
version = "0.3"
2019-06-21 20:44:38 +03:00
[features]
2023-11-07 13:58:41 +03:00
all = [
"dist-client",
"redis",
"s3",
"memcached",
"gcs",
"azure",
"gha",
"webdav",
]
azure = ["opendal", "reqsign"]
default = ["all"]
gcs = ["opendal", "reqsign", "url", "reqwest/blocking", "trust-dns-resolver"]
gha = ["opendal"]
memcached = ["opendal/services-memcached"]
native-zlib = []
redis = ["url", "opendal/services-redis"]
s3 = ["opendal", "reqsign"]
webdav = ["opendal"]
# Enable features that will build a vendored version of openssl and
# statically linked with it, instead of linking against the system-wide openssl
# dynamically or statically.
2023-09-25 10:53:23 +03:00
vendored-openssl = ["openssl?/vendored", "opendal?/native-tls-vendored"]
# Enable features that require unstable features of Nightly Rust.
unstable = []
# Enables distributed support in the sccache client
2023-11-07 13:58:41 +03:00
dist-client = [
"flate2",
"hyper",
"reqwest",
"url",
"sha2",
"trust-dns-resolver",
]
2018-08-04 16:36:35 +03:00
# Enables the sccache-dist binary
2023-11-07 13:58:41 +03:00
dist-server = [
"jwt",
"flate2",
"libmount",
"nix",
"openssl",
"reqwest",
"rouille",
"syslog",
"trust-dns-resolver",
"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"]