-
Notifications
You must be signed in to change notification settings - Fork 350
[CASFS] Fix FileWithFixedStatus after CASFS refactoring #11235
#11629
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
@swift-ci please test llvm |
|
I think this should also fix It returns Maybe the function should just return |
I think that is a good idea. I am generally confident that it is an error in configuration/bug in code if we ask for ObjectRef but underlying file system is not configured correctly. |
|
Yikes, there is a layering violation when building dynamic. Support->CAS->Support. Let me think about to fix that. |
…1235 Add CASFileWithFixedStatus to keep CAS references when fetching VFS overlayed file from CASBackedFileSystem. Fixes: swiftlang#11616
Update the API to return error when the CASBackedFileSystem is not correctly configured instead of return `std::nullopt`. There isn't any error handling can be done when getting `nullopt` in all usecases and it is nicer to surface the error directly.
1243386 to
e512412
Compare
|
@swift-ci please test llvm |
1 similar comment
|
@swift-ci please test llvm |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
But I wonder how robust the dyn_cast<llvm::cas::CASBackedFile> in FileManager really is. What if the RedirectingFileSystem gets refactored and starts wrapping the underlying file in its own custom type? I don't have a good suggestion how to improve this, so let's not block the fix on that.
We need to make sure the configuration of file system when using CAS based compilation is configured correctly regardless. I will think if we have ways to make this better when we decide to upstream. My concern is mostly the current dependency that CAS -> Support so VFS can't have CAS in base implementation. If you think the reverse problem we kind of wrapped all File under a CASBackedFile to make it have ObjectRef, we just don't want to wrap it multiple times because an intermediate layer lost the reference so we wasted time to insert into CAS again. |
Add CASFileWithFixedStatus to keep CAS references when fetching VFS overlayed file from CASBackedFileSystem.
Fixes: #11616