Skip to content

Commit cbf2bfb

Browse files
[Caching] Fix a typo in legacy layout file name
Fix a typo in the name of legacy layout file name that causes the legacy layouts are not ingested into the CASFS for cached compilation. rdar://119622429
1 parent 443cac2 commit cbf2bfb

File tree

2 files changed

+33
-1
lines changed

2 files changed

+33
-1
lines changed

lib/AST/ModuleDependencies.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -459,7 +459,7 @@ void SwiftDependencyTracker::addCommonSearchPathDeps(
459459
std::error_code EC;
460460
for (auto &Arch : AllSupportedArches) {
461461
SmallString<256> LayoutFile(RuntimeLibPath);
462-
llvm::sys::path::append(LayoutFile, "layout-" + Arch + ".yaml");
462+
llvm::sys::path::append(LayoutFile, "layouts-" + Arch + ".yaml");
463463
FS->status(LayoutFile);
464464
}
465465
}

test/CAS/deps_cas_fs.swift

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
// REQUIRES: objc_interop, OS=macosx
2+
3+
// RUN: %empty-directory(%t)
4+
// RUN: mkdir -p %t/clang-module-cache
5+
// RUN: mkdir -p %t/cas
6+
7+
// RUN: mkdir -p %t/resource/macosx
8+
// RUN: cp %S/../IRGen/Inputs/legacy_type_info/a.yaml %t/resource/macosx/layouts-x86_64.yaml
9+
10+
// RUN: %target-swift-frontend -scan-dependencies -module-cache-path %t/clang-module-cache %s -o %t/deps.json -I %S/../ScanDependencies/Inputs/CHeaders -I %S/../ScanDependencies/Inputs/Swift -emit-dependencies -emit-dependencies-path %t/deps.d -import-objc-header %S/../ScanDependencies/Inputs/CHeaders/Bridging.h -swift-version 4 -cache-compile-job -cas-path %t/cas -module-name Test -resource-dir %t/resource
11+
// Check the contents of the JSON output
12+
// RUN: %validate-json %t/deps.json &>/dev/null
13+
14+
/// check cas-fs content
15+
// RUN: %S/Inputs/SwiftDepsExtractor.py %t/deps.json E casFSRootID > %t/E_fs.casid
16+
// RUN: llvm-cas --cas %t/cas --ls-tree-recursive @%t/E_fs.casid | %FileCheck %s -check-prefix FS_ROOT_E
17+
// RUN: %S/Inputs/SwiftDepsExtractor.py %t/deps.json F casFSRootID > %t/F_fs.casid
18+
// RUN: llvm-cas --cas %t/cas --ls-tree-recursive @%t/F_fs.casid | %FileCheck %s -check-prefix FS_ROOT_F
19+
// RUN: %S/Inputs/SwiftDepsExtractor.py %t/deps.json Test casFSRootID > %t/Test_fs.casid
20+
// RUN: llvm-cas --cas %t/cas --ls-tree-recursive @%t/Test_fs.casid | %FileCheck %s -check-prefix FS_ROOT_TEST
21+
22+
// FS_ROOT_E-DAG: layouts-x86_64.yaml
23+
// FS_ROOT_E-DAG: E.swiftinterface
24+
25+
// FS_ROOT_F-DAG: layouts-x86_64.yaml
26+
// FS_ROOT_F-DAG: F.swiftinterface
27+
28+
// FS_ROOT_TEST-DAG: layouts-x86_64.yaml
29+
// FS_ROOT_TEST-DAG: deps_cas_fs.swift
30+
31+
import E
32+
import SubE

0 commit comments

Comments
 (0)