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 7 commits intomozilla:mainfrom
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2369 +/- ##
==========================================
+ Coverage 73.37% 73.42% +0.05%
==========================================
Files 68 68
Lines 37337 37432 +95
==========================================
+ Hits 27395 27486 +91
- Misses 9942 9946 +4 ☔ 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 |
|
Hi @myzhang1029 , I face with that error Do you have some plans to actualize the PR? |
|
Hello @AJIOB Is my understanding correct that this patch would fix that error you mentioned? Lots has happened in the repo and let me work on this today! |
|
I hope it helps. In the trace mode I have: |
|
P.S. Just an easy-to-reproduce test on the latest sccache 0.14.0: |
|
Hi @myzhang1029 , Do you have any updates? |
|
Sorry for the delay as my area was hit by some severe weather. This time is largely just rebasing the code and resolving conflicts, but this version should already fix the |
|
Hi @sylvestre, Is this PR OK to you? |
eac34f9 to
1116960
Compare
|
Moved the unit tests to Edit: The integration tests have been merged back. |
8b45456 to
6f0442c
Compare
|
@AJIOB I believe everything that has been discussed so far is addressed now. Please kindly review! |
|
CC @sylvestre , Can we merge it, please? |
Signed-off-by: Zhang Maiyun <me@maiyun.me>
Fixes mozilla#2288 The new logic tries to write to a temp file and atomically move it as before, but if a temp file cannot be created, it falls back to writing directly to the final location. In the latter case, we also ignore errors from `set_file_mode`. Signed-off-by: Zhang Maiyun <me@maiyun.me>
In addition, when `/dev/fd/{fd}` doesn't actually exist (e.g. FreeBSD
without `fdescfs`), skip the test to extract to `/dev/fd/{fd}`.
Signed-off-by: Zhang Maiyun <me@maiyun.me>
|
Just gonna rebase onto |
Please see #2288 for the discussion.