Skip to content

Initial client-side implementation#2735

Open
glandium wants to merge 9 commits into
mozilla:mainfrom
glandium:client-side
Open

Initial client-side implementation#2735
glandium wants to merge 9 commits into
mozilla:mainfrom
glandium:client-side

Conversation

@glandium

Copy link
Copy Markdown
Collaborator

No description provided.

glandium added 4 commits June 12, 2026 12:45
No behavioral change yet — the flag is wired up in a later commit.
Nothing currently uses those methods on MultiLevelStorage, so this
doesn't cause practical problems, but this is going to change so they
need to be implemented.
Adds LruDiskCache::get_abs_path, a Storage::get_path default method
(returns Unsupported), and a DiskCache implementation that returns the
absolute path of a cached entry so callers can open it directly without
reading the bytes into memory first.
@glandium glandium requested a review from sylvestre June 12, 2026 04:03
@codecov-commenter

codecov-commenter commented Jun 12, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 39.02439% with 400 lines in your changes missing coverage. Please review.
✅ Project coverage is 74.19%. Comparing base (b799af2) to head (166f8f4).

Files with missing lines Patch % Lines
src/server.rs 0.75% 132 Missing ⚠️
src/cache/ipc_storage.rs 0.00% 123 Missing ⚠️
src/commands.rs 50.90% 81 Missing ⚠️
src/cache/multilevel.rs 36.66% 19 Missing ⚠️
src/cache/disk.rs 0.00% 17 Missing ⚠️
src/cache/multilevel_test.rs 86.40% 17 Missing ⚠️
src/lru_disk_cache/mod.rs 0.00% 5 Missing ⚠️
src/cache/cache.rs 0.00% 3 Missing ⚠️
src/config.rs 96.22% 2 Missing ⚠️
tests/oauth.rs 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2735      +/-   ##
==========================================
- Coverage   74.63%   74.19%   -0.45%     
==========================================
  Files          70       71       +1     
  Lines       39898    40491     +593     
==========================================
+ Hits        29778    30041     +263     
- Misses      10120    10450     +330     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Adds six Request/Response pairs for upcoming client-side storage
operations.
IpcStorage wraps a ServerConnection and implements the Storage trait by
forwarding get/put to the daemon via StorageGetRaw/StoragePutRaw RPCs.
get_raw/put_raw are the primary wire operations; get/put are layered on
top (parse CacheRead from bytes / serialise CacheWrite to bytes).

Preprocessor cache methods forward via the existing
StorageGetPreprocessorEntry / StoragePutPreprocessorEntry RPCs.  Sync
accessors (location, basedirs, …) return values cached at handshake
time so they never block.
Comment thread src/commands.rs Outdated
@ahartmetz

Copy link
Copy Markdown
Collaborator

I have a feature wish while you're at it: It would be cool to auto-retry failed remote builds locally and have always-on stderr output and maybe statistics for it so that one can possibly investigate and fix the problem.

Sometimes a file that a remote build requires isn't captured due to a missing sccache feature.

Sometimes a builder is in a borked state for whatever reason. I've observed some intermittent problem with extracting(?) the compiler archive on builders and unfortunately I haven't managed to properly diagnose and fix it. Even if that was fixed, distributed anything can fail for lots of reasons up to and including flaky hardware - I've seen that happen several times when I worked in an office with an Icecream cluster made of the local PCs.

The ideal fixes for these two+ kinds of failures are quite different, but retrying locally is a nice catch-all workaround to keep the builds succeeding and minimize wasted developer time.

@glandium

Copy link
Copy Markdown
Collaborator Author

I have a feature wish while you're at it: It would be cool to auto-retry failed remote builds locally and have always-on stderr output and maybe statistics for it so that one can possibly investigate and fix the problem.

Sometimes a file that a remote build requires isn't captured due to a missing sccache feature.

Sometimes a builder is in a borked state for whatever reason. I've observed some intermittent problem with extracting(?) the compiler archive on builders and unfortunately I haven't managed to properly diagnose and fix it. Even if that was fixed, distributed anything can fail for lots of reasons up to and including flaky hardware - I've seen that happen several times when I worked in an office with an Icecream cluster made of the local PCs.

The ideal fixes for these two+ kinds of failures are quite different, but retrying locally is a nice catch-all workaround to keep the builds succeeding and minimize wasted developer time.

This is unrelated to what this PR does. You may want to file an issue with steps to reproduce.

@ahartmetz

ahartmetz commented Jun 19, 2026

Copy link
Copy Markdown
Collaborator

This is unrelated to what this PR does. You may want to file an issue with steps to reproduce.

The first and last paragraph are somewhat closely related, the middle two are just motivation and the usefulness is by no means limited to these. Only if distributed sccache was absolutely perfect including with future compiler changes would the feature be not useful. I don't have steps to reproduce the specific bug from the third paragraph or I'd probably have fixed it myself.

I'm also considering implementing local retry myself - it's similar enough to 1ffa8d5 which also works by essentially re-invoking the build with different arguments. In that case, it would be nice of you to keep that possible extension in mind to avoid accidental difficulties for it.

@sylvestre

sylvestre commented Jun 19, 2026

Copy link
Copy Markdown
Collaborator

@ahartmetz please open an issue (or prepare a PR) to make sure it isn't forgotten
this PR is already big enough

@ahartmetz

Copy link
Copy Markdown
Collaborator

@ahartmetz please open an issue (or prepare a PR) to make sure it isn't forgotten this PR is already big enough

#2745

@glandium

Copy link
Copy Markdown
Collaborator Author

The first and last paragraph are somewhat closely related

This change doesn't impact distributed compilation.

@ahartmetz

Copy link
Copy Markdown
Collaborator

The first and last paragraph are somewhat closely related

This change doesn't impact distributed compilation.

No, but it could. That's why I called it a wish.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants