mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[ModuleInterface] Create module cache path if we install a forwarding module
If we are installing a forwarding module to something in the prebuilt cache, make sure to create the module cache directory if it doesn't exist. rdar://52964217
This commit is contained in:
@@ -504,7 +504,7 @@ public:
|
||||
// Note that we don't assume cachePath is the same as the Clang
|
||||
// module cache path at this point.
|
||||
if (!moduleCachePath.empty())
|
||||
(void)llvm::sys::fs::create_directory(moduleCachePath);
|
||||
(void)llvm::sys::fs::create_directories(moduleCachePath);
|
||||
|
||||
configureSubInvocationInputsAndOutputs(OutPath);
|
||||
|
||||
@@ -1267,6 +1267,10 @@ class ParseableInterfaceModuleLoaderImpl {
|
||||
depsAdjustedToMTime.push_back(adjustedDep);
|
||||
}
|
||||
|
||||
// Create the module cache if we haven't created it yet.
|
||||
StringRef parentDir = path::parent_path(outputPath);
|
||||
(void)llvm::sys::fs::create_directories(parentDir);
|
||||
|
||||
auto hadError = withOutputFile(diags, outputPath,
|
||||
[&](llvm::raw_pwrite_stream &out) {
|
||||
llvm::yaml::Output yamlWriter(out);
|
||||
|
||||
Reference in New Issue
Block a user