diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index e64138f27..64518abd4 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -29,9 +29,8 @@ jobs:
rustup component add clippy
rustup component add rustfmt
- # Travis doesn't enforce this yet.
- # - name: check formatting
- # run: cargo fmt -- --check
+ - name: check formatting
+ run: cargo fmt -- --check
- name: build and test
run: cargo test --locked --all-targets
diff --git a/.travis.yml b/.travis.yml
index b007d94e9..ce62e6f50 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -4,7 +4,10 @@ matrix:
include:
# OS compat
- os: linux
+ # As of this writing, stable Rust (1.44.0) and the OS X version on TravisCI
+ # do not work well together.
- os: osx
+ rust: 1.43.1
# rustc version compat
- rust: 1.41.1 # oldest supported version, keep in sync with README.md
@@ -29,6 +32,7 @@ matrix:
before_script:
- export EXTRA_FEATURES=
+ - if [[ "${TRAVIS_RUST_VERSION}" = "stable" ]]; then rustup component add rustfmt && cargo fmt -- --check; fi
- if [[ "${TRAVIS_RUST_VERSION}" = "nightly" ]]; then export EXTRA_FEATURES="$EXTRA_FEATURES unstable"; fi
- if [[ "${DIST_SCCACHE}" = "1" ]]; then export EXTRA_FEATURES="$EXTRA_FEATURES dist-client dist-server"; fi
diff --git a/Cargo.lock b/Cargo.lock
index 751848ce2..8a87db111 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -65,14 +65,15 @@ checksum = "eab1c04a571841102f5345a8fc0f6bb3d31c315dec879b5c6e42e40ce7ffa34e"
[[package]]
name = "assert_cmd"
-version = "0.9.1"
+version = "1.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c5b60c276f334145cf2cec09c5bb6f63523f078c0c850909f66bca8f933cf809"
+checksum = "c88b9ca26f9c16ec830350d309397e74ee9abdfd8eb1f71cb6ecc71a3fc818da"
dependencies = [
- "escargot",
+ "doc-comment",
"predicates",
"predicates-core",
"predicates-tree",
+ "wait-timeout",
]
[[package]]
@@ -549,6 +550,12 @@ dependencies = [
"winapi 0.3.8",
]
+[[package]]
+name = "doc-comment"
+version = "0.3.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "fea41bba32d969b513997752735605054bc0dfa92b4c56bf1189f2e174be7a10"
+
[[package]]
name = "dtoa"
version = "0.4.5"
@@ -601,16 +608,6 @@ dependencies = [
"version_check 0.9.1",
]
-[[package]]
-name = "escargot"
-version = "0.3.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "19db1f7e74438642a5018cdf263bb1325b2e792f02dd0a3ca6d6c0f0d7b1d5a5"
-dependencies = [
- "serde",
- "serde_json",
-]
-
[[package]]
name = "failure"
version = "0.1.7"
@@ -677,9 +674,9 @@ dependencies = [
[[package]]
name = "float-cmp"
-version = "0.4.0"
+version = "0.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "134a8fa843d80a51a5b77d36d42bc2def9edcb0262c914861d08129fd1926600"
+checksum = "da62c4f1b81918835a8c6a484a397775fff5953fe83529afd51b05f5c6a6617d"
dependencies = [
"num-traits 0.2.11",
]
@@ -733,6 +730,31 @@ version = "0.1.29"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1b980f2816d6ee8673b6517b52cb0e808a180efc92e5c19d02cdda79066703ef"
+[[package]]
+name = "futures"
+version = "0.3.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "5c329ae8753502fb44ae4fc2b622fa2a94652c41e795143765ba0927f92ab780"
+dependencies = [
+ "futures-channel",
+ "futures-core",
+ "futures-executor",
+ "futures-io",
+ "futures-sink",
+ "futures-task",
+ "futures-util",
+]
+
+[[package]]
+name = "futures-channel"
+version = "0.3.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f0c77d04ce8edd9cb903932b608268b3fffec4163dc053b3b402bf47eac1f1a8"
+dependencies = [
+ "futures-core",
+ "futures-sink",
+]
+
[[package]]
name = "futures-core"
version = "0.3.4"
@@ -745,10 +767,39 @@ version = "0.1.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ab90cde24b3319636588d0c35fe03b1333857621051837ed769faefb4c2162e4"
dependencies = [
- "futures",
+ "futures 0.1.29",
"num_cpus",
]
+[[package]]
+name = "futures-executor"
+version = "0.3.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f674f3e1bcb15b37284a90cedf55afdba482ab061c407a9c0ebbd0f3109741ba"
+dependencies = [
+ "futures-core",
+ "futures-task",
+ "futures-util",
+]
+
+[[package]]
+name = "futures-io"
+version = "0.3.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "a638959aa96152c7a4cddf50fcb1e3fede0583b27157c26e67d6f99904090dc6"
+
+[[package]]
+name = "futures-macro"
+version = "0.3.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "9a5081aa3de1f7542a794a397cde100ed903b0630152d0973479018fd85423a7"
+dependencies = [
+ "proc-macro-hack",
+ "proc-macro2",
+ "quote 1.0.3",
+ "syn 1.0.18",
+]
+
[[package]]
name = "futures-sink"
version = "0.3.4"
@@ -767,11 +818,17 @@ version = "0.3.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "22766cf25d64306bedf0384da004d05c9974ab104fcc4528f1236181c18004c5"
dependencies = [
- "futures",
+ "futures 0.1.29",
+ "futures-channel",
"futures-core",
+ "futures-io",
+ "futures-macro",
"futures-sink",
"futures-task",
+ "memchr 2.3.3",
"pin-utils",
+ "proc-macro-hack",
+ "proc-macro-nested",
"slab",
]
@@ -813,7 +870,7 @@ dependencies = [
"byteorder",
"bytes 0.4.12",
"fnv",
- "futures",
+ "futures 0.1.29",
"http",
"indexmap",
"log 0.4.8",
@@ -859,7 +916,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6741c859c1b2463a423a1dbce98d418e6c3c3fc720fb0d45528657320920292d"
dependencies = [
"bytes 0.4.12",
- "futures",
+ "futures 0.1.29",
"http",
"tokio-buf",
]
@@ -886,7 +943,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9dbe6ed1438e1f8ad955a4701e9a944938e9519f6888d12d8558b645e247d5f6"
dependencies = [
"bytes 0.4.12",
- "futures",
+ "futures 0.1.29",
"futures-cpupool",
"h2",
"http",
@@ -916,7 +973,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3a800d6aa50af4b5850b2b0f659625ce9504df908e9733b635720483be26174f"
dependencies = [
"bytes 0.4.12",
- "futures",
+ "futures 0.1.29",
"hyper",
"native-tls",
"tokio-io",
@@ -1303,16 +1360,6 @@ dependencies = [
"winapi 0.3.8",
]
-[[package]]
-name = "msdos_time"
-version = "0.1.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "aad9dfe950c057b1bfe9c1f2aa51583a8468ef2a5baba2ebbe06d775efeb7729"
-dependencies = [
- "time",
- "winapi 0.3.8",
-]
-
[[package]]
name = "multipart"
version = "0.13.6"
@@ -1387,9 +1434,9 @@ dependencies = [
[[package]]
name = "normalize-line-endings"
-version = "0.2.2"
+version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2e0a1a39eab95caf4f5556da9289b9e68f0aafac901b2ce80daaf020d3b733a8"
+checksum = "61807f77802ff30975e01f4f071c8ba10c022052f98b3294119f3e615d13e5be"
[[package]]
name = "num-integer"
@@ -1586,9 +1633,9 @@ checksum = "74490b50b9fbe561ac330df47c08f3f33073d2d00c150f719147d7c54522fa1b"
[[package]]
name = "predicates"
-version = "0.9.1"
+version = "1.0.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f31e7977fc111984fdac76b6ae3a4cb598008fc6fd02dfdca189bf180bd7be20"
+checksum = "347a1b6f0b21e636bc9872fb60b83b8e185f6f5516298b8238699f7f9a531030"
dependencies = [
"difference",
"float-cmp",
@@ -1599,20 +1646,32 @@ dependencies = [
[[package]]
name = "predicates-core"
-version = "0.9.0"
+version = "1.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "85f80bc390d1c02a4cdaa63f27f05c3c426679eb65433d8dd65d392147e4e5c5"
+checksum = "06075c3a3e92559ff8929e7a280684489ea27fe44805174c3ebd9328dcb37178"
[[package]]
name = "predicates-tree"
-version = "0.9.0"
+version = "1.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2e86df9b81bdcb0a5141aca9d2b9c5e0c558ef6626d3ae2c12912f5c9df740bd"
+checksum = "8e63c4859013b38a76eca2414c64911fba30def9e3202ac461a2d22831220124"
dependencies = [
"predicates-core",
"treeline",
]
+[[package]]
+name = "proc-macro-hack"
+version = "0.5.15"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "0d659fe7c6d27f25e9d80a1a094c223f5246f6a6596453e09d7229bf42750b63"
+
+[[package]]
+name = "proc-macro-nested"
+version = "0.1.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "8e946095f9d3ed29ec38de908c22f95d9ac008e424c7bcae54c75a79c527c694"
+
[[package]]
name = "proc-macro2"
version = "1.0.10"
@@ -1865,7 +1924,7 @@ checksum = "f0c747d743d48233f9bc3ed3fb00cb84c1d98d8c7f54ed2d4cca9adf461a7ef3"
dependencies = [
"bytes 0.4.12",
"combine",
- "futures",
+ "futures 0.1.29",
"sha1",
"tokio-codec",
"tokio-executor",
@@ -1930,7 +1989,7 @@ dependencies = [
"cookie_store",
"encoding_rs",
"flate2",
- "futures",
+ "futures 0.1.29",
"http",
"hyper",
"hyper-tls",
@@ -2074,10 +2133,10 @@ dependencies = [
"directories",
"env_logger",
"error-chain 0.12.2",
- "escargot",
"filetime 0.2.9",
"flate2",
- "futures",
+ "futures 0.1.29",
+ "futures 0.3.4",
"futures-cpupool",
"hmac",
"http",
@@ -2542,7 +2601,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5a09c0b5bb588872ab2f09afa13ee6e9dac11e10a0ec9e8e3ba39a5a5d530af6"
dependencies = [
"bytes 0.4.12",
- "futures",
+ "futures 0.1.29",
"mio",
"num_cpus",
"tokio-codec",
@@ -2583,7 +2642,7 @@ checksum = "8fb220f46c53859a4b7ec083e41dec9778ff0b1851c0942b211edb89e0ccdc46"
dependencies = [
"bytes 0.4.12",
"either",
- "futures",
+ "futures 0.1.29",
]
[[package]]
@@ -2593,7 +2652,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "25b2998660ba0e70d18684de5d06b70b70a3a747469af9dea7618cc59e75976b"
dependencies = [
"bytes 0.4.12",
- "futures",
+ "futures 0.1.29",
"tokio-io",
]
@@ -2603,7 +2662,7 @@ version = "0.1.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "107b625135aa7b9297dd2d99ccd6ca6ab124a5d1230778e159b9095adca4c722"
dependencies = [
- "futures",
+ "futures 0.1.29",
"futures-core",
"futures-util",
"pin-project-lite",
@@ -2620,7 +2679,7 @@ version = "0.1.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b1de0e32a83f131e002238d7ccde18211c0a5397f60cbfffcb112868c2e0e20e"
dependencies = [
- "futures",
+ "futures 0.1.29",
"tokio-executor",
]
@@ -2631,7 +2690,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fb2d1b8f4548dbf5e1f7818512e9c406860678f29c300cdf0ebac72d1a3a1671"
dependencies = [
"crossbeam-utils 0.7.2",
- "futures",
+ "futures 0.1.29",
]
[[package]]
@@ -2640,7 +2699,7 @@ version = "0.1.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "297a1206e0ca6302a0eed35b700d292b275256f596e2f3fea7729d5e629b6ff4"
dependencies = [
- "futures",
+ "futures 0.1.29",
"tokio-io",
"tokio-threadpool",
]
@@ -2652,7 +2711,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "57fc868aae093479e3131e3d165c93b1c7474109d13c90ec0dda2a1bbfff0674"
dependencies = [
"bytes 0.4.12",
- "futures",
+ "futures 0.1.29",
"log 0.4.8",
]
@@ -2663,7 +2722,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9d282d483052288b2308ba5ee795f5673b159c9bdf63c385a05609da782a5eae"
dependencies = [
"bytes 0.4.12",
- "futures",
+ "futures 0.1.29",
"mio",
"mio-named-pipes",
"tokio 0.1.22",
@@ -2676,7 +2735,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "382d90f43fa31caebe5d3bc6cfd854963394fff3b8cb59d5146607aaae7e7e43"
dependencies = [
"crossbeam-queue 0.1.2",
- "futures",
+ "futures 0.1.29",
"lazy_static",
"libc",
"log 0.4.8",
@@ -2695,7 +2754,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "09bc590ec4ba8ba87652da2068d150dcada2cfa2e07faae270a5e0409aa51351"
dependencies = [
"crossbeam-utils 0.7.2",
- "futures",
+ "futures 0.1.29",
"lazy_static",
"log 0.4.8",
"mio",
@@ -2714,7 +2773,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "894168193c4f80862a2244ff953b69145a9961a9efba39500e0970b083d0649c"
dependencies = [
"bytes 0.4.12",
- "futures",
+ "futures 0.1.29",
]
[[package]]
@@ -2726,7 +2785,7 @@ dependencies = [
"bincode 0.8.0",
"bytes 0.4.12",
"derive-error",
- "futures",
+ "futures 0.1.29",
"serde",
"tokio-serde",
]
@@ -2737,7 +2796,7 @@ version = "0.2.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d0c34c6e548f101053321cba3da7cbb87a610b85555884c41b07da2eb91aff12"
dependencies = [
- "futures",
+ "futures 0.1.29",
"libc",
"mio",
"mio-uds",
@@ -2755,7 +2814,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "edfe50152bc8164fcc456dab7891fa9bf8beaf01c5ee7e1dd43a397c3cf87dee"
dependencies = [
"fnv",
- "futures",
+ "futures 0.1.29",
]
[[package]]
@@ -2765,7 +2824,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "98df18ed66e3b72e742f185882a9e201892407957e45fbff8da17ae7a7c51f72"
dependencies = [
"bytes 0.4.12",
- "futures",
+ "futures 0.1.29",
"iovec",
"mio",
"tokio-io",
@@ -2781,7 +2840,7 @@ dependencies = [
"crossbeam-deque",
"crossbeam-queue 0.2.1",
"crossbeam-utils 0.7.2",
- "futures",
+ "futures 0.1.29",
"lazy_static",
"log 0.4.8",
"num_cpus",
@@ -2796,7 +2855,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "93044f2d313c95ff1cb7809ce9a7a05735b012288a888b62d4434fd58c94f296"
dependencies = [
"crossbeam-utils 0.7.2",
- "futures",
+ "futures 0.1.29",
"slab",
"tokio-executor",
]
@@ -2808,7 +2867,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e2a0b10e610b39c38b031a2fcab08e4b82f16ece36504988dcbd81dbba650d82"
dependencies = [
"bytes 0.4.12",
- "futures",
+ "futures 0.1.29",
"log 0.4.8",
"mio",
"tokio-codec",
@@ -2823,7 +2882,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5076db410d6fdc6523df7595447629099a1fdc47b3d9f896220780fa48faf798"
dependencies = [
"bytes 0.4.12",
- "futures",
+ "futures 0.1.29",
"iovec",
"libc",
"log 0.4.8",
@@ -2849,7 +2908,7 @@ version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "dc72f33b6a72c75c9df0037afce313018bae845f0ec7fdb9201b8768427a917f"
dependencies = [
- "futures",
+ "futures 0.1.29",
"tower-buffer",
"tower-discover",
"tower-layer",
@@ -2867,7 +2926,7 @@ version = "0.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3c7b83e1ccf5b23dd109dd6ae2c07b8e2beec7a51a21f29da2dba576317370e0"
dependencies = [
- "futures",
+ "futures 0.1.29",
"tokio-executor",
"tokio-sync",
"tower-layer",
@@ -2881,7 +2940,7 @@ version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "73a7632286f78164d65d18fd0e570307acde9362489aa5c8c53e6315cc2bde47"
dependencies = [
- "futures",
+ "futures 0.1.29",
"tower-service",
]
@@ -2891,7 +2950,7 @@ version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0ddf07e10c07dcc8f41da6de036dc66def1a85b70eb8a385159e3908bb258328"
dependencies = [
- "futures",
+ "futures 0.1.29",
"tower-service",
]
@@ -2901,7 +2960,7 @@ version = "0.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7b2807e2531b621e23e18693d49d0663bc617240ac0da8ed9b0c64cacd5c67fb"
dependencies = [
- "futures",
+ "futures 0.1.29",
"tokio-sync",
"tokio-timer",
"tower-layer",
@@ -2915,7 +2974,7 @@ version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "04fbaf5bfb63d84204db87b9b2aeec61549613f2bbb8706dcc36f5f3ea8cd769"
dependencies = [
- "futures",
+ "futures 0.1.29",
"tower-layer",
"tower-service",
]
@@ -2926,7 +2985,7 @@ version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "09e80588125061f276ed2a7b0939988b411e570a2dbb2965b1382ef4f71036f7"
dependencies = [
- "futures",
+ "futures 0.1.29",
"tokio-timer",
"tower-layer",
"tower-service",
@@ -2938,7 +2997,7 @@ version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2cc0c98637d23732f8de6dfd16494c9f1559c3b9e20b4a46462c8f9b9e827bfa"
dependencies = [
- "futures",
+ "futures 0.1.29",
]
[[package]]
@@ -2947,7 +3006,7 @@ version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5c06bbc2fbd056f810940a8c6f0cc194557d36da3c22999a755a7a6612447da9"
dependencies = [
- "futures",
+ "futures 0.1.29",
"tokio-timer",
"tower-layer",
"tower-service",
@@ -2959,7 +3018,7 @@ version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4792342fac093db5d2558655055a89a04ca909663467a4310c7739d9f8b64698"
dependencies = [
- "futures",
+ "futures 0.1.29",
"tokio-io",
"tower-layer",
"tower-service",
@@ -3193,6 +3252,15 @@ dependencies = [
"utf8parse",
]
+[[package]]
+name = "wait-timeout"
+version = "0.2.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "9f200f5b12eb75f8c1ed65abd4b2db8a6e1b138a20de009dacee265a2498f3f6"
+dependencies = [
+ "libc",
+]
+
[[package]]
name = "walkdir"
version = "1.0.7"
@@ -3210,7 +3278,7 @@ version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b6395efa4784b027708f7451087e647ec73cc74f5d9bc2e418404248d679a230"
dependencies = [
- "futures",
+ "futures 0.1.29",
"log 0.4.8",
"try-lock",
]
@@ -3303,12 +3371,11 @@ dependencies = [
[[package]]
name = "zip"
-version = "0.4.2"
+version = "0.5.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "36b9e08fb518a65cf7e08a1e482573eb87a2f4f8c6619316612a3c1f162fe822"
+checksum = "6df134e83b8f0f8153a094c7b0fd79dfebe437f1d76e7715afa18ed95ebe2fd7"
dependencies = [
+ "crc32fast",
"flate2",
- "msdos_time",
"podio",
- "time",
]
diff --git a/Cargo.toml b/Cargo.toml
index 0af730eaa..e2f595838 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -38,6 +38,7 @@ error-chain = { version = "0.12.1", default-features = false }
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"] }
futures-cpupool = "0.1"
hmac = { version = "0.7", optional = true }
http = "0.1"
@@ -84,7 +85,7 @@ uuid = { version = "0.7", features = ["v4"] }
walkdir = "1.0.7"
# by default which pulls in an outdated failure version
which = { version = "3", default-features = false }
-zip = { version = "0.4", default-features = false, features = ["deflate"] }
+zip = { version = "0.5", default-features = false, features = ["deflate"] }
# dist-server only
crossbeam-utils = { version = "0.5", optional = true }
@@ -101,12 +102,11 @@ quote = "1.0.2"
tiny_http = { git = "https://github.com/tiny-http/tiny-http.git", rev = "619680de" }
[dev-dependencies]
-assert_cmd = "0.9"
+assert_cmd = "1"
cc = "1.0"
chrono = "0.4"
-escargot = "0.3"
itertools = "0.7"
-predicates = "0.9.0"
+predicates = "1"
# Waiting for #15 to make it into a release
selenium-rs = { git = "https://github.com/saresend/selenium-rs.git", rev = "0314a2420da78cce7454a980d862995750771722" }
diff --git a/README.md b/README.md
index b23edf635..c5538771d 100644
--- a/README.md
+++ b/README.md
@@ -57,22 +57,20 @@ sccache
sccache - Shared Compilation Cache
==================================
-Sccache is a [ccache](https://ccache.dev/)-like tool. It is used as a compiler wrapper and avoids compilation when possible, storing a cache in a remote storage using the Amazon Simple Cloud Storage Service (S3) API, the Google Cloud Storage (GCS) API, or Redis.
+sccache is a [ccache](https://ccache.dev/)-like compiler caching tool. It is used as a compiler wrapper and avoids compilation when possible, storing cached results either on [local disk](#local) or in one of [several cloud storage backends](#storage-options).
-Sccache now includes [experimental Rust support](docs/Rust.md).
+sccache includes support for caching the compilation of C/C++ code, [Rust](docs/Rust.md), as well as NVIDIA's CUDA using [nvcc](https://docs.nvidia.com/cuda/cuda-compiler-driver-nvcc/index.html).
-It works as a client-server. The client spawns a server if one is not running already, and sends the wrapped command line as a request to the server, which then does the work and returns stdout/stderr for the job. The client-server model allows the server to be more efficient in its handling of the remote storage.
-
-Sccache can also be used with local storage instead of remote.
+sccache also provides [icecream](https://github.com/icecc/icecream)-style distributed compilation (automatic packaging of local toolchains) for all supported compilers (including Rust). The distributed compilation system includes several security features that icecream lacks such as authentication, transport layer encryption, and sandboxed compiler execution on build servers. See [the distributed quickstart](docs/DistributedQuickstart.md) guide for more information.
---
Table of Contents (ToC)
======================
+* [Installation](#installation)
* [Build Requirements](#build-requirements)
* [Build](#build)
-* [Installation](#installation)
* [Usage](#usage)
* [Storage Options](#storage-options)
* [Local](#local)
@@ -87,20 +85,93 @@ Table of Contents (ToC)
---
+## Installation
+
+There are prebuilt x86-64 binaries available for Windows, Linux (a portable binary compiled against musl), and macOS [on the releases page](https://github.com/mozilla/sccache/releases/latest). Several package managers also include sccache packages, you can install the latest release from source using cargo, or build directly from a source checkout.
+
+### macOS
+
+On macOS sccache can be installed via [Homebrew](https://brew.sh/):
+
+```bash
+brew install sccache
+```
+
+### Windows
+
+On Windows, sccache can be installed via [scoop](https://scoop.sh/):
+
+```
+scoop install sccache
+```
+
+### Via cargo
+
+If you have a Rust toolchain installed you can install sccache using cargo. **Note that this will compile sccache from source which is fairly resource-intensive. For CI purposes you should use prebuilt binary packages.**
+
+
+```bash
+cargo install sccache
+```
+
+---
+
+Usage
+-----
+
+Running sccache is like running ccache: prefix your compilation commands with it, like so:
+
+```bash
+sccache gcc -o foo.o -c foo.c
+```
+
+If you want to use sccache for caching Rust builds you can define `build.rustc-wrapper` in the
+[cargo configuration file](https://doc.rust-lang.org/cargo/reference/config.html). For example, you can set it globally
+in `$HOME/.cargo/config` by adding:
+
+```toml
+[build]
+rustc-wrapper = "/path/to/sccache"
+```
+
+Note that you need to use cargo 1.40 or newer for this to work.
+
+Alternatively you can use the environment variable `RUSTC_WRAPPER`:
+
+```bash
+RUSTC_WRAPPER=/path/to/sccache cargo build
+```
+
+sccache supports gcc, clang, MSVC, rustc, NVCC, and [Wind River's diab compiler](https://www.windriver.com/products/development-tools/#diab_compiler).
+
+If you don't [specify otherwise](#storage-options), sccache will use a local disk cache.
+
+sccache works using a client-server model, where the server runs locally on the same machine as the client. The client-server model allows the server to be more efficient by keeping some state in memory. The sccache command will spawn a server process if one is not already running, or you can run `sccache --start-server` to start the background server process without performing any compilation.
+
+You can run `sccache --stop-server` to terminate the server. It will also terminate after (by default) 10 minutes of inactivity.
+
+Running `sccache --show-stats` will print a summary of cache statistics.
+
+Some notes about using `sccache` with [Jenkins](https://jenkins.io) are [here](docs/Jenkins.md).
+
+---
+
Build Requirements
------------------
-Sccache is a [Rust](https://www.rust-lang.org/) program. Building it requires `cargo` (and thus `rustc`). sccache currently requires **Rust 1.41.1**.
-
-We recommend you install Rust via [Rustup](https://rustup.rs/). The generated binaries can be built so that they are very [portable](#building-portable-binaries). By default `sccache` supports a local disk cache. To build `sccache` with support for `S3` and/or `Redis` cache backends, add `--features=all` or select a specific feature by passing `s3`, `gcs`, and/or `redis`. Refer the [Cargo Documentation](http://doc.crates.io/manifest.html#the-features-section) for details.
+sccache is a [Rust](https://www.rust-lang.org/) program. Building it requires `cargo` (and thus `rustc`). sccache currently requires **Rust 1.41.1**. We recommend you install Rust via [Rustup](https://rustup.rs/).
Build
-----
+If you are building sccache for non-development purposes make sure you use `cargo build --release` to get optimized binaries:
+
```bash
-cargo build [--features=all|redis|s3|gcs] [--release]
+cargo build --release [--features=all|s3|redis|gcs|memcached|azure]
```
+By default, `sccache` supports a local disk cache and S3. Use the `--features` flag to build `sccache` with support for other storage options. Refer the [Cargo Documentation](http://doc.crates.io/manifest.html#the-features-section) for details on how to select features with Cargo.
+
### Building portable binaries
When building with the `gcs` feature, `sccache` will depend on OpenSSL, which can be an annoyance if you want to distribute portable binaries. It is possible to statically link against OpenSSL using the steps below before building with `cargo`.
@@ -132,7 +203,7 @@ Build with `cargo` and use `otool -L` to check that the resulting binary does no
#### Windows
-On Windows it is fairly straight forward to just ship the required `libcrypto` and `libssl` DLLs with `sccache.exe`, but the binary might also depend on a few MSVC CRT DLLs that are not available on older Windows versions.
+On Windows it is fairly straightforward to just ship the required `libcrypto` and `libssl` DLLs with `sccache.exe`, but the binary might also depend on a few MSVC CRT DLLs that are not available on older Windows versions.
It is possible to statically link against the CRT using a `.cargo/config` file with the following contents.
@@ -157,75 +228,13 @@ set OPENSSL_LIBS=libcrypto64MT:libssl64MT
---
-## Installation
-
-### With Rust
-
-```bash
-cargo install sccache
-```
-
-### macOS
-
-sccache can also be installed via [Homebrew](https://brew.sh/)
-
-```
-brew install sccache
-```
-
-### Windows
-
-sccache can also be installed via [scoop](https://scoop.sh/)
-
-```
-scoop install sccache
-```
-
----
-
-Usage
------
-
-Running sccache is like running ccache: wrap your compilation commands with it, like so:
-
-```bash
-sccache gcc -o foo.o -c foo.c
-```
-
-If you want to use sccache for your rust builds you can define `build.rustc-wrapper` in the
-[cargo configuration file](https://doc.rust-lang.org/cargo/reference/config.html). For example, you can set it globally
-in `$HOME/.cargo/config` by adding:
-
-```toml
-[build]
-rustc-wrapper = "/path/to/sccache"
-```
-
-Note that you need to use cargo 1.40 or newer for this to work.
-
-Alternatively you can use the environment variable `RUSTC_WRAPPER`:
-
-```bash
-RUSTC_WRAPPER=/path/to/sccache cargo build
-```
-
-Sccache (tries to) support gcc, clang, [diab](https://www.windriver.com/products/development-tools/#diab_compiler) and MSVC. If you don't [specify otherwise](#storage-options), sccache will use a local disk cache.
-
-You can run `sccache --start-server` to start the background server process without performing any compilation.
-
-You can run `sccache --stop-server` to terminate the server. It will terminate after 10 minutes of inactivity.
-
-Running `sccache --show-stats` will print a summary of cache statistics.
-
-Some notes about using `sccache` with [Jenkins](https://jenkins.io) are [here](docs/Jenkins.md).
-
----
-
Storage Options
---------------
### Local
-Sccache defaults to using local disk storage. You can set the `SCCACHE_DIR` environment variable to change the disk cache location. By default it will use a sensible location for the current platform: `~/.cache/sccache` on Linux, `%LOCALAPPDATA%\Mozilla\sccache` on Windows, and `~/Library/Caches/Mozilla.sccache` on MacOS. To limit the cache size set `SCCACHE_CACHE_SIZE`, for example `SCCACHE_CACHE_SIZE="1G"`. The default value is 10 Gigabytes.
+sccache defaults to using local disk storage. You can set the `SCCACHE_DIR` environment variable to change the disk cache location. By default it will use a sensible location for the current platform: `~/.cache/sccache` on Linux, `%LOCALAPPDATA%\Mozilla\sccache` on Windows, and `~/Library/Caches/Mozilla.sccache` on MacOS.
+
+The default cache size is 10 gigabytes. To change this, set `SCCACHE_CACHE_SIZE`, for example `SCCACHE_CACHE_SIZE="1G"`.
### S3
If you want to use S3 storage for the sccache cache, you need to set the `SCCACHE_BUCKET` environment variable to the name of the S3 bucket to use.
@@ -252,7 +261,7 @@ To use Azure Blob Storage, you'll need your Azure connection string and an _exis
environment variable to your connection string, and `SCCACHE_AZURE_BLOB_CONTAINER` to the name of the container to use. Note that sccache will not create
the container for you - you'll need to do that yourself.
-**Important:** The environment variables are only taken into account when the server starts, so only on the first run.
+**Important:** The environment variables are only taken into account when the server starts, i.e. only on the first run.
---
@@ -268,18 +277,6 @@ Alternately, you can set the `SCCACHE_ERROR_LOG` environment variable to a path
Interaction with GNU `make` jobserver
-------------------------------------
-Sccache provides support for a [GNU make jobserver](https://www.gnu.org/software/make/manual/html_node/Job-Slots.html). When the server is started from a process that provides a jobserver, sccache will use that jobserver and provide it to any processes it spawns. (If you are running sccache from a GNU make recipe, you will need to prefix the command with `+` to get this behavior.) If the sccache server is started without a jobserver present it will create its own with the number of slots equal to the number of available CPU cores.
+sccache provides support for a [GNU make jobserver](https://www.gnu.org/software/make/manual/html_node/Job-Slots.html). When the server is started from a process that provides a jobserver, sccache will use that jobserver and provide it to any processes it spawns. (If you are running sccache from a GNU make recipe, you will need to prefix the command with `+` to get this behavior.) If the sccache server is started without a jobserver present it will create its own with the number of slots equal to the number of available CPU cores.
This is most useful when using sccache for Rust compilation, as rustc supports using a jobserver for parallel codegen, so this ensures that rustc will not overwhelm the system with codegen tasks. Cargo implements its own jobserver ([see the information on `NUM_JOBS` in the cargo documentation](https://doc.rust-lang.org/stable/cargo/reference/environment-variables.html#environment-variables-cargo-sets-for-build-scripts)) for rustc to use, so using sccache for Rust compilation in cargo via `RUSTC_WRAPPER` should do the right thing automatically.
-
----
-
-Known caveats
--------------
-
-(and possible future improvements)
-
-* Sccache doesn't try to be smart about the command line arguments it uses when computing a key for a given compilation result (like skipping preprocessor-specific arguments)
-* It doesn't support all kinds of compiler flags, and is certainly broken with a few of them. Really only the flags used during Firefox builds have been tested.
-* It doesn't support ccache's direct mode.
-* [It doesn't support an option like `CCACHE_BASEDIR`](https://github.com/mozilla/sccache/issues/35).
diff --git a/docs/Rust.md b/docs/Rust.md
index 996e61cfb..1dd649f5f 100644
--- a/docs/Rust.md
+++ b/docs/Rust.md
@@ -1,4 +1,4 @@
-sccache now includes experimental support for caching Rust compilation. This includes many caveats, and is primarily focused on caching rustc invocations as produced by cargo. A (possibly-incomplete) list follows:
+sccache includes support for caching Rust compilation. This includes many caveats, and is primarily focused on caching rustc invocations as produced by cargo. A (possibly-incomplete) list follows:
* `--emit` is required.
* `--crate-name` is required.
* Only `link` and `dep-info` are supported as `--emit` values, and `link` must be present.
@@ -9,4 +9,4 @@ sccache now includes experimental support for caching Rust compilation. This inc
* Procedural macros that read files from the filesystem may not be cached properly
* Target specs aren't hashed (e.g. custom target specs)
-If you are using Rust 1.18 or later, you can ask cargo to wrap all compilation with sccache by setting `RUSTC_WRAPPER=sccache` in your build environment.
\ No newline at end of file
+If you are using Rust 1.18 or later, you can ask cargo to wrap all compilation with sccache by setting `RUSTC_WRAPPER=sccache` in your build environment.
diff --git a/src/bin/sccache-dist/main.rs b/src/bin/sccache-dist/main.rs
index a3d392881..4196a300e 100644
--- a/src/bin/sccache-dist/main.rs
+++ b/src/bin/sccache-dist/main.rs
@@ -101,18 +101,18 @@ fn main() {
Ok(s) => s,
Err(e) => {
let stderr = &mut std::io::stderr();
- writeln!(stderr, "error: {}", e).unwrap();
+ writeln!(stderr, "sccache-dist: error: {}", e).unwrap();
for e in e.iter().skip(1) {
- writeln!(stderr, "caused by: {}", e).unwrap();
+ writeln!(stderr, "sccache-dist: caused by: {}", e).unwrap();
}
2
}
},
Err(e) => {
- println!("sccache: {}", e);
+ println!("sccache-dist: {}", e);
for e in e.iter().skip(1) {
- println!("caused by: {}", e);
+ println!("sccache-dist: caused by: {}", e);
}
get_app().print_help().unwrap();
println!("");
@@ -812,8 +812,7 @@ impl SchedulerIncoming for Scheduler {
let mut servers = self.servers.lock().unwrap();
if let btree_map::Entry::Occupied(mut entry) = jobs.entry(job_id) {
- // TODO: nll should mean not needing to copy this out
- let job_detail = *entry.get();
+ let job_detail = entry.get();
if job_detail.server_id != server_id {
bail!(
"Job id {} is not registed on server {:?}",
diff --git a/src/cache/cache.rs b/src/cache/cache.rs
index 431440314..6c906e977 100644
--- a/src/cache/cache.rs
+++ b/src/cache/cache.rs
@@ -26,16 +26,44 @@ use crate::cache::s3::S3Cache;
use crate::config::{self, CacheType, Config};
use futures_cpupool::CpuPool;
use std::fmt;
+use std::fs;
#[cfg(feature = "gcs")]
use std::fs::File;
-use std::io::{self, Read, Seek, Write};
+use std::io::{self, Cursor, Read, Seek, Write};
+use std::path::{Path, PathBuf};
use std::sync::Arc;
use std::time::Duration;
+use tempfile::NamedTempFile;
use zip::write::FileOptions;
use zip::{CompressionMethod, ZipArchive, ZipWriter};
use crate::errors::*;
+#[cfg(unix)]
+fn get_file_mode(file: &fs::File) -> Result