Repository navigation
Conversation
Co-authored-by: Fedor Sakharov <fedor.sakharov@gmail.com>
Fall back to the environment passed to NVCC when dry-run output omits PATH, while preserving explicit dry-run overrides. Return executable lookup errors instead of panicking when PATH is absent.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3009 +/- ##
==========================================
+ Coverage 79.99% 81.94% +1.95%
==========================================
Files 76 81 +5
Lines 47373 50243 +2870
==========================================
+ Hits 37894 41173 +3279
+ Misses 9479 9070 -409 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
🟡 Changes recommended
Blocking build/cache operations and unbounded upload buffering risk server stalls and memory exhaustion, while Accept negotiation and upload timing introduce compatibility and job-expiration regressions.
1 open issue
What changed in this PR
Migrates sccache’s distributed HTTP services from Rouille to Warp, continuing the cachepot port tracked in #1620 and superseding #2241.
Changes:
- Converts distributed handlers, authentication requests, and server startup to async execution.
- Adds HTTP regression tests and adapts distributed integration tests to Tokio.
- Also fixes NVCC executable lookup when dry-run output omits PATH, with regression tests.
| File | Description |
|---|---|
tests/harness/mod.rs |
Uses async server tasks, HTTP checks, and readiness polling. |
tests/dist.rs |
Converts distributed tests to async execution and serializes them. |
src/util.rs |
Replaces the blocking HTTP client helper with an async client. |
src/lib.rs |
Removes the Rouille macro import. |
src/dist/mod.rs |
Updates distributed traits and reader bounds for async handlers. |
src/dist/http.rs |
Implements Warp routes, async requests, and HTTP regression tests. |
src/dist/client_auth.rs |
Makes OAuth token exchange asynchronous. |
src/compiler/nvcc.rs |
Adds inherited PATH fallback and executable-lookup tests. |
src/bin/sccache-dist/token_check.rs |
Converts remote token checks to async and adds tests. |
src/bin/sccache-dist/main.rs |
Integrates Tokio runtimes and async distributed handlers. |
Cargo.toml |
Replaces Rouille with Warp and updates dependency features. |
Cargo.lock |
Records the updated dependency graph. |
Review effort: Balanced
Keep runtime and authentication initialization in the daemon, and report readiness or startup errors to the original process.
Move synchronous builds off Tokio workers with owned inputs, and gate imports and compiler fields by their features.
Keep runtime and authentication initialization in the daemon, and report readiness or startup errors to the original process.
There was a problem hiding this comment.
🟡 Changes recommended
Unbounded request buffering can exhaust server memory, synchronous cache work can starve Tokio workers, and request cancellation can skip job completion updates, leaving scheduler capacity occupied.
1 open issue
1 resolved since last review
Review effort: Balanced
Using `"static"` string content is causing CI to fail.
Use daemonix start and execute directly while preserving FD cleanup and crash setup in both foreground and daemon modes. Document the readiness handshake and cover foreground cleanup in isolated subprocess tests.
Acquire the toolchain-cache mutex and check membership on the blocking pool so unpacking cannot stall HTTP workers or heartbeats. Keep job-map updates async and test contended assignments for cached and missing toolchains on a current-thread runtime.
…ist-daemon-fd-fun # Conflicts: # src/bin/sccache-dist/main.rs
Keep startup failures, readiness, JWT authentication, descriptor cleanup, and detachment checks in one integration target. Exercise launcher loss during blocked JWKS retrieval and serialize descendant cleanup.
Reject malformed, truncated, oversized, and empty-error startup responses and incorrect readiness confirmations. Synchronize watchdog setup with blocking runtime work and bound child-process waits.
|
sorry but it needs to be rebased |
| syslog = { version = "7", optional = true } | ||
| thiserror = { version = "1.0.63", optional = true } | ||
| version-compare = { version = "0.1.1", optional = true } | ||
| warp = { version = "0.3.7", optional = true, features = ["tls"] } |
There was a problem hiding this comment.
why warp 0.3? it pulls hyper 0.14, http 0.2, rustls 0.22 and tokio-rustls 0.25 next to the hyper 1 stack we already have.
warp 0.4 is on hyper 1, could we use it?
| rcgen = { version = "0.14", optional = true } | ||
| rsa = { version = "0.9.2", optional = true } | ||
| syslog = { version = "7", optional = true } | ||
| thiserror = { version = "1.0.63", optional = true } |
There was a problem hiding this comment.
thiserror 2 is already in the tree, please use it instead of adding 1.0
| # dynamically or statically. | ||
| vendored-openssl = ["openssl?/vendored", "reqwest?/native-tls-vendored"] | ||
| # Dummy feature for backwards compatibility. | ||
| vendored-openssl = [] |
| .and_then(authorize) | ||
| .and(with_server_incoming_handler(handler)) | ||
| .and(with_requester(requester)) | ||
| .and(warp::body::bytes()) |
There was a problem hiding this comment.
warp::body::bytes() loads the whole toolchain into memory, while rouille streamed it into the reader.
Toolchains can be hundreds of MB, and there is no content_length_limit either. Could we stream the body instead?
|
|
||
| panic!("Rouille server terminated") | ||
| panic!("Warp server terminated") |
There was a problem hiding this comment.
could it return an error instead of panic? the signature is already Result
| { | ||
| // Taken from Cargo | ||
| let host = rustc_verbose_version | ||
| let _host = rustc_verbose_version |
There was a problem hiding this comment.
_host that is used afterwards is confusing.
Also, these cfg(dist-client) cleanups are unrelated to warp, please move them into a separate PR
|
@sylvestre I think you're review was a bit early, this is intentionally a draft because it depends on #2325 #3015 and #3057 and I didn't get around to do a full self review.
I remember agreeing that rebasing is a last resort, since gh can't handle the mapping of commits across rebases? I am happy to rebase once I did a self-review. I don't really have a strong preference. What I'd really like though, is to redirect your attention to the pre-requisites in #2325 #3015 and #3057 , to get them over the finish line. |


Replaces
rouillewithwarpas our primary request/response handler framework.Part of porting changes from cachepot #1620
The original PR is here paritytech/cachepot#131
Supersedes #2241 with all fixes included.
Initial porting was done by @Saruniks
Original work was done by @montekki