Skip to content

Commit e1f35f6

Browse files
author
David Ungar
authored
Merge pull request swiftlang#35189 from davidungar/xf
[Incremental, swift-driver] Supply ready-made .swiftdeps files so that an actual compilation isn't needed.
2 parents 698a0a3 + ff2e1af commit e1f35f6

File tree

4 files changed

+117
-10
lines changed

4 files changed

+117
-10
lines changed
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# Fine-grained v0
2+
---
3+
allNodes:
4+
- key:
5+
kind: sourceFileProvide
6+
aspect: interface
7+
context: ''
8+
name: './main.swiftdeps'
9+
fingerprint: d41d8cd98f00b204e9800998ecf8427e
10+
sequenceNumber: 0
11+
defsIDependUpon: [ ]
12+
isProvides: true
13+
- key:
14+
kind: sourceFileProvide
15+
aspect: implementation
16+
context: ''
17+
name: './main.swiftdeps'
18+
fingerprint: d41d8cd98f00b204e9800998ecf8427e
19+
sequenceNumber: 1
20+
defsIDependUpon: [ 2, 3 ]
21+
isProvides: true
22+
- key:
23+
kind: externalDepend
24+
aspect: interface
25+
context: ''
26+
name: '/Volumes/AS/s/dec/build/Ninja-DebugAssert/swift-macosx-x86_64/lib/swift/macosx/Swift.swiftmodule/x86_64-apple-macos.swiftmodule'
27+
sequenceNumber: 2
28+
defsIDependUpon: [ ]
29+
isProvides: false
30+
- key:
31+
kind: externalDepend
32+
aspect: interface
33+
context: ''
34+
name: '/Volumes/AS/s/dec/build/Ninja-DebugAssert/swift-macosx-x86_64/lib/swift/macosx/SwiftOnoneSupport.swiftmodule/x86_64-apple-macos.swiftmodule'
35+
sequenceNumber: 3
36+
defsIDependUpon: [ ]
37+
isProvides: false
38+
...
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# Fine-grained v0
2+
---
3+
allNodes:
4+
- key:
5+
kind: sourceFileProvide
6+
aspect: interface
7+
context: ''
8+
name: './other.swiftdeps'
9+
fingerprint: d41d8cd98f00b204e9800998ecf8427e
10+
sequenceNumber: 0
11+
defsIDependUpon: [ ]
12+
isProvides: true
13+
- key:
14+
kind: sourceFileProvide
15+
aspect: implementation
16+
context: ''
17+
name: './other.swiftdeps'
18+
fingerprint: d41d8cd98f00b204e9800998ecf8427e
19+
sequenceNumber: 1
20+
defsIDependUpon: [ 2, 3 ]
21+
isProvides: true
22+
- key:
23+
kind: externalDepend
24+
aspect: interface
25+
context: ''
26+
name: '/Volumes/AS/s/dec/build/Ninja-DebugAssert/swift-macosx-x86_64/lib/swift/macosx/Swift.swiftmodule/x86_64-apple-macos.swiftmodule'
27+
sequenceNumber: 2
28+
defsIDependUpon: [ ]
29+
isProvides: false
30+
- key:
31+
kind: externalDepend
32+
aspect: interface
33+
context: ''
34+
name: '/Volumes/AS/s/dec/build/Ninja-DebugAssert/swift-macosx-x86_64/lib/swift/macosx/SwiftOnoneSupport.swiftmodule/x86_64-apple-macos.swiftmodule'
35+
sequenceNumber: 3
36+
defsIDependUpon: [ ]
37+
isProvides: false
38+
...
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# Fine-grained v0
2+
---
3+
allNodes:
4+
- key:
5+
kind: sourceFileProvide
6+
aspect: interface
7+
context: ''
8+
name: './yet-another.swiftdeps'
9+
fingerprint: d41d8cd98f00b204e9800998ecf8427e
10+
sequenceNumber: 0
11+
defsIDependUpon: [ ]
12+
isProvides: true
13+
- key:
14+
kind: sourceFileProvide
15+
aspect: implementation
16+
context: ''
17+
name: './yet-another.swiftdeps'
18+
fingerprint: d41d8cd98f00b204e9800998ecf8427e
19+
sequenceNumber: 1
20+
defsIDependUpon: [ 2, 3 ]
21+
isProvides: true
22+
- key:
23+
kind: externalDepend
24+
aspect: interface
25+
context: ''
26+
name: '/Volumes/AS/s/dec/build/Ninja-DebugAssert/swift-macosx-x86_64/lib/swift/macosx/Swift.swiftmodule/x86_64-apple-macos.swiftmodule'
27+
sequenceNumber: 2
28+
defsIDependUpon: [ ]
29+
isProvides: false
30+
- key:
31+
kind: externalDepend
32+
aspect: interface
33+
context: ''
34+
name: '/Volumes/AS/s/dec/build/Ninja-DebugAssert/swift-macosx-x86_64/lib/swift/macosx/SwiftOnoneSupport.swiftmodule/x86_64-apple-macos.swiftmodule'
35+
sequenceNumber: 3
36+
defsIDependUpon: [ ]
37+
isProvides: false
38+
...

test/Driver/Dependencies/bindings-build-record.swift

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
// XFAIL: *
2-
// REQUIRES: rdar72554270
3-
// REQUIRES: rdar72550007
41
// REQUIRES: shell
52
// RUN: %empty-directory(%t)
63
// RUN: cp -r %S/Inputs/bindings-build-record/* %t
4+
// RUN: %swift-dependency-tool --from-yaml --input-filename=%t/main.swiftdeps.yaml --output-filename=%t/main.swiftdeps
5+
// RUN: %swift-dependency-tool --from-yaml --input-filename=%t/other.swiftdeps.yaml --output-filename=%t/other.swiftdeps
6+
// RUN: %swift-dependency-tool --from-yaml --input-filename=%t/yet-another.swiftdeps.yaml --output-filename=%t/yet-another.swiftdeps
77
// RUN: %{python} %S/Inputs/touch.py 443865900 %t/*
88

99
// RUN: cd %t && %swiftc_driver -driver-print-bindings ./main.swift ./other.swift ./yet-another.swift -incremental -driver-show-incremental -output-file-map %t/output.json 2>&1 |%FileCheck %s -check-prefix=MUST-EXEC
@@ -15,13 +15,6 @@
1515
// MUST-EXEC-DAG: Disabling incremental build: could not read build record
1616

1717
// RUN: echo '{version: "'$(%swiftc_driver_plain -version | head -n1)'", inputs: {"./main.swift": [443865900, 0], "./other.swift": [443865900, 0], "./yet-another.swift": [443865900, 0]}, build_time: [443865901, 0]}' > %t/main~buildrecord.swiftdeps
18-
19-
// Run it once to produce swiftdeps files for the new driver to have
20-
// RUN: cd %t && %swiftc_driver ./main.swift ./other.swift ./yet-another.swift -incremental -output-file-map %t/output.json
21-
22-
// RUN: echo '{version: "'$(%swiftc_driver_plain -version | head -n1)'", inputs: {"./main.swift": [443865900, 0], "./other.swift": [443865900, 0], "./yet-another.swift": [443865900, 0]}, build_time: [443865901, 0]}' > %t/main~buildrecord.swiftdeps
23-
24-
2518
// RUN: cd %t && %swiftc_driver -driver-print-bindings ./main.swift ./other.swift ./yet-another.swift -incremental -output-file-map %t/output.json 2>&1 -driver-show-incremental -driver-show-job-lifecycle |tee /tmp/x| %FileCheck %s -check-prefix=NO-EXEC
2619

2720
// NO-EXEC: inputs: ["{{(\.\/)?}}main.swift"], output: {{[{].*[}]}}{{(, condition: check-dependencies)?}}

0 commit comments

Comments
 (0)