Fall back to direct cache write if tempfile creation on the same fs fails#2369
Fall back to direct cache write if tempfile creation on the same fs fails#2369myzhang1029 wants to merge 13 commits intomozilla:mainfrom
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2369 +/- ##
===========================================
- Coverage 71.22% 27.84% -43.38%
===========================================
Files 64 54 -10
Lines 35214 33666 -1548
===========================================
- Hits 25080 9374 -15706
- Misses 10134 24292 +14158 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
would it be possible to add a test to make sure we don't regress in the future? |
|
@sylvestre |
|
Rebased on I am not entirely sure if the use of |
|
could you please add high level tests in https://github.com/mozilla/sccache/blob/main/tests/system.rs too ? thanks like Line 1825 in 7025295 |
|
@sylvestre Sorry for the delayed response. I am planning to test this by adding two functions that are similar to One of them should test
|
|
On a second thought, I have a question: I think I named the PR a bit too narrow. Maybe like
I was think of reframing the PR this way, because this way, we don't have to hardcode
|
|
@AJIOB I have pushed the change. Sorry for the delay. |
|
There is an issue with the tests: we use the same |
|
CI should work now. I have relaxed one more error handling: in the case that same-fs file creation fails, we also allow |
Signed-off-by: Zhang Maiyun <me@maiyun.me>
Fixes mozilla#2288 Signed-off-by: Zhang Maiyun <me@maiyun.me>
Both `test_basic_compile_into_dev_null` and `test_basic_compile_into_dev_stdout` always result in two hits and zero misses because the source file is the same as the one for the basic test.
In the error case, we likely have very little permission on the output directory/file (e.g. `/dev/stdout`), so just trying to write is our best bet.
Please see #2288 for the discussion.