mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[CAS] swift dependency scanning using CAS for compiler caching (#66366)
Teach swift dependency scanner to use CAS to capture the full dependencies for a build and construct build commands with immutable inputs from CAS. This allows swift compilation caching using CAS.
This commit is contained in:
@@ -236,9 +236,6 @@ DependencyScanningTool::initCompilerInstanceForScan(
|
||||
auto Instance = std::make_unique<CompilerInstance>();
|
||||
Instance->addDiagnosticConsumer(&CDC);
|
||||
|
||||
// Wrap the filesystem with a caching `DependencyScanningWorkerFilesystem`
|
||||
ScanningService->overlaySharedFilesystemCacheForCompilation(*Instance);
|
||||
|
||||
// Basic error checking on the arguments
|
||||
if (CommandArgs.empty()) {
|
||||
Instance->getDiags().diagnose(SourceLoc(), diag::error_no_frontend_args);
|
||||
@@ -280,6 +277,10 @@ DependencyScanningTool::initCompilerInstanceForScan(
|
||||
if (Instance->setup(Invocation, InstanceSetupError)) {
|
||||
return std::make_error_code(std::errc::not_supported);
|
||||
}
|
||||
|
||||
// Setup the caching service after the instance finishes setup.
|
||||
ScanningService->setupCachingDependencyScanningService(*Instance);
|
||||
|
||||
(void)Instance->getMainModule();
|
||||
|
||||
return Instance;
|
||||
|
||||
Reference in New Issue
Block a user