Commit 349caaf
authored
Add missing libcurl4-openssl-dev dependency in Ubuntu/Debian packages, add more EndToEnd testcases (#236)
As outlined in #197, the generator was not downloading the needed `libcurl4-openssl-dev` dependency that is required to statically link `FoundationNetworking` with `--static-swift-stdlib`.
This PR adds the needed dependency for all supported Ubuntu and Debian versions with a little bit of refactoring in `LinuxDistribution.swift` to reduce duplication of common dependencies across versions.
I also added an additional testcase in the `EndToEndTests` to verify this curl dependency is available and works. With this change is some improvements to the logging of the EndToEndTests, so we end up with the following output:
```
2025-08-15T13:42:09+0000 info EndToEndTests: temporaryDirectory=/tmp/6E93604C-CC84-4E25-A67E-F947CE19D282 [SwiftSDKGeneratorTests] Created temporary directory
2025-08-15T13:42:09+0000 info EndToEndTests: scratchPath=/tmp/6E93604C-CC84-4E25-A67E-F947CE19D282 [SwiftSDKGeneratorTests] Building SDK generator
2025-08-15T13:44:22+0000 info EndToEndTests: runArguments=--sdk-name ubuntu_24.04_x86_64_6.1-RELEASE --host-toolchain --swift-version 6.1-RELEASE --target x86_64-unknown-linux-gnu --distribution-name ubuntu --distribution-version 24.04 scratchPath=/tmp/6E93604C-CC84-4E25-A67E-F947CE19D282 [SwiftSDKGeneratorTests] Building Swift SDK
2025-08-15T13:45:35+0000 info EndToEndTests: bundleName=ubuntu_24.04_x86_64_6.1-RELEASE scratchPath=/tmp/6E93604C-CC84-4E25-A67E-F947CE19D282 [SwiftSDKGeneratorTests] Installing new Swift SDK
2025-08-15T13:45:50+0000 info EndToEndTests: temporaryDirectory=/tmp/6E93604C-CC84-4E25-A67E-F947CE19D282 [SwiftSDKGeneratorTests] Removed temporary directory
2025-08-15T13:45:50+0000 info EndToEndTests: bundleName=ubuntu_24.04_x86_64_6.1-RELEASE [SwiftSDKGeneratorTests] Running test cases...
2025-08-15T13:45:50+0000 info EndToEndTests: bundleName=ubuntu_24.04_x86_64_6.1-RELEASE temporaryDirectory=/tmp/8688FF7E-C08E-4ED6-A218-304D4AB9D88E testcase=helloWorld [SwiftSDKGeneratorTests] Created temporary directory
2025-08-15T13:45:50+0000 info EndToEndTests: bundleName=ubuntu_24.04_x86_64_6.1-RELEASE testcase=helloWorld [SwiftSDKGeneratorTests] Creating test project /tmp/8688FF7E-C08E-4ED6-A218-304D4AB9D88E/swift-sdk-generator-test
2025-08-15T13:45:50+0000 info EndToEndTests: bundleName=ubuntu_24.04_x86_64_6.1-RELEASE testcase=helloWorld [SwiftSDKGeneratorTests] Building test project
2025-08-15T13:46:08+0000 info EndToEndTests: bundleName=ubuntu_24.04_x86_64_6.1-RELEASE testcase=helloWorld [SwiftSDKGeneratorTests] Test project built successfully
2025-08-15T13:46:08+0000 info EndToEndTests: bundleName=ubuntu_24.04_x86_64_6.1-RELEASE testcase=helloWorld [SwiftSDKGeneratorTests] Building test project with static-swift-stdlib
2025-08-15T13:46:11+0000 info EndToEndTests: bundleName=ubuntu_24.04_x86_64_6.1-RELEASE testcase=helloWorld [SwiftSDKGeneratorTests] Test project built successfully
2025-08-15T13:46:11+0000 info EndToEndTests: bundleName=ubuntu_24.04_x86_64_6.1-RELEASE temporaryDirectory=/tmp/8688FF7E-C08E-4ED6-A218-304D4AB9D88E testcase=helloWorld [SwiftSDKGeneratorTests] Removed temporary directory
2025-08-15T13:46:11+0000 info EndToEndTests: bundleName=ubuntu_24.04_x86_64_6.1-RELEASE temporaryDirectory=/tmp/312A6E7E-95DF-4BCE-8D18-9E7EF1D163F6 testcase=curlDependency [SwiftSDKGeneratorTests] Created temporary directory
2025-08-15T13:46:11+0000 info EndToEndTests: bundleName=ubuntu_24.04_x86_64_6.1-RELEASE testcase=curlDependency [SwiftSDKGeneratorTests] Creating test project /tmp/312A6E7E-95DF-4BCE-8D18-9E7EF1D163F6/swift-sdk-generator-test
2025-08-15T13:46:11+0000 info EndToEndTests: bundleName=ubuntu_24.04_x86_64_6.1-RELEASE testcase=curlDependency [SwiftSDKGeneratorTests] Building test project
2025-08-15T13:46:19+0000 info EndToEndTests: bundleName=ubuntu_24.04_x86_64_6.1-RELEASE testcase=curlDependency [SwiftSDKGeneratorTests] Test project built successfully
2025-08-15T13:46:19+0000 info EndToEndTests: bundleName=ubuntu_24.04_x86_64_6.1-RELEASE testcase=curlDependency [SwiftSDKGeneratorTests] Building test project with static-swift-stdlib
2025-08-15T13:46:24+0000 info EndToEndTests: bundleName=ubuntu_24.04_x86_64_6.1-RELEASE testcase=curlDependency [SwiftSDKGeneratorTests] Test project built successfully
2025-08-15T13:46:24+0000 info EndToEndTests: bundleName=ubuntu_24.04_x86_64_6.1-RELEASE temporaryDirectory=/tmp/312A6E7E-95DF-4BCE-8D18-9E7EF1D163F6 testcase=curlDependency [SwiftSDKGeneratorTests] Removed temporary directory
2025-08-15T13:46:24+0000 info EndToEndTests: bundleName=ubuntu_24.04_x86_64_6.1-RELEASE temporaryDirectory=/tmp/4B1AB5C9-3C87-4258-8BA0-97B305B59970 testcase=libcNonshared [SwiftSDKGeneratorTests] Created temporary directory
2025-08-15T13:46:24+0000 info EndToEndTests: bundleName=ubuntu_24.04_x86_64_6.1-RELEASE testcase=libcNonshared [SwiftSDKGeneratorTests] Creating test project /tmp/4B1AB5C9-3C87-4258-8BA0-97B305B59970/swift-sdk-generator-test
2025-08-15T13:46:24+0000 info EndToEndTests: bundleName=ubuntu_24.04_x86_64_6.1-RELEASE testcase=libcNonshared [SwiftSDKGeneratorTests] Building test project
2025-08-15T13:46:30+0000 info EndToEndTests: bundleName=ubuntu_24.04_x86_64_6.1-RELEASE testcase=libcNonshared [SwiftSDKGeneratorTests] Test project built successfully
2025-08-15T13:46:30+0000 info EndToEndTests: bundleName=ubuntu_24.04_x86_64_6.1-RELEASE testcase=libcNonshared [SwiftSDKGeneratorTests] Building test project with static-swift-stdlib
2025-08-15T13:46:36+0000 info EndToEndTests: bundleName=ubuntu_24.04_x86_64_6.1-RELEASE testcase=libcNonshared [SwiftSDKGeneratorTests] Test project built successfully
2025-08-15T13:46:36+0000 info EndToEndTests: bundleName=ubuntu_24.04_x86_64_6.1-RELEASE temporaryDirectory=/tmp/4B1AB5C9-3C87-4258-8BA0-97B305B59970 testcase=libcNonshared [SwiftSDKGeneratorTests] Removed temporary directory
2025-08-15T13:46:36+0000 info EndToEndTests: bundleName=ubuntu_24.04_x86_64_6.1-RELEASE [SwiftSDKGeneratorTests] Removing Swift SDK to clean up...
warning: `swift experimental-sdk` command is deprecated and will be removed in a future version of SwiftPM. Use `swift sdk` instead.
```
If you notice in the above, we now have:
- Separate logging of building the SDK generator and actually building the Swift SDK.
- Cleaner logging of removing and installing Swift SDKs.
- Each testcase now has a key that gives the name of the testcase, that is logged in the "testcase" metadata key to identify which may work or fail.
- Testcases are run concurrently with a throwing task group. As we add more testcases in the future this helps to reduce the time it takes to run each case.1 parent 77b1dd9 commit 349caaf
File tree
2 files changed
+77
-70
lines changed- Sources/SwiftSDKGenerator/PlatformModels
- Tests/SwiftSDKGeneratorTests
2 files changed
+77
-70
lines changedLines changed: 31 additions & 40 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
53 | 66 | | |
54 | 67 | | |
55 | 68 | | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
| 69 | + | |
60 | 70 | | |
61 | 71 | | |
62 | 72 | | |
63 | 73 | | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | 74 | | |
69 | 75 | | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
| 76 | + | |
74 | 77 | | |
75 | 78 | | |
76 | 79 | | |
77 | 80 | | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | | - | |
82 | 81 | | |
83 | 82 | | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | | - | |
| 83 | + | |
88 | 84 | | |
89 | 85 | | |
90 | 86 | | |
91 | 87 | | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | 88 | | |
97 | 89 | | |
98 | 90 | | |
| |||
121 | 113 | | |
122 | 114 | | |
123 | 115 | | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
124 | 129 | | |
125 | 130 | | |
126 | 131 | | |
127 | | - | |
128 | | - | |
129 | | - | |
130 | | - | |
| 132 | + | |
131 | 133 | | |
132 | 134 | | |
133 | 135 | | |
134 | 136 | | |
135 | | - | |
136 | | - | |
137 | | - | |
138 | | - | |
139 | 137 | | |
140 | 138 | | |
141 | | - | |
142 | | - | |
143 | | - | |
144 | | - | |
| 139 | + | |
145 | 140 | | |
146 | 141 | | |
147 | 142 | | |
148 | 143 | | |
149 | | - | |
150 | | - | |
151 | | - | |
152 | | - | |
153 | 144 | | |
154 | 145 | | |
155 | 146 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
62 | | - | |
63 | | - | |
| 62 | + | |
64 | 63 | | |
65 | | - | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
66 | 67 | | |
67 | | - | |
68 | | - | |
69 | | - | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
70 | 72 | | |
| 73 | + | |
71 | 74 | | |
72 | 75 | | |
73 | 76 | | |
74 | | - | |
75 | 77 | | |
76 | 78 | | |
77 | 79 | | |
| |||
84 | 86 | | |
85 | 87 | | |
86 | 88 | | |
87 | | - | |
| 89 | + | |
88 | 90 | | |
89 | 91 | | |
90 | 92 | | |
91 | | - | |
92 | | - | |
93 | 93 | | |
94 | | - | |
| 94 | + | |
95 | 95 | | |
96 | 96 | | |
97 | 97 | | |
98 | | - | |
| 98 | + | |
99 | 99 | | |
100 | 100 | | |
101 | 101 | | |
102 | 102 | | |
103 | 103 | | |
104 | 104 | | |
105 | 105 | | |
106 | | - | |
| 106 | + | |
107 | 107 | | |
108 | 108 | | |
109 | 109 | | |
110 | | - | |
| 110 | + | |
111 | 111 | | |
112 | 112 | | |
113 | 113 | | |
| |||
117 | 117 | | |
118 | 118 | | |
119 | 119 | | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
120 | 124 | | |
121 | 125 | | |
122 | 126 | | |
| |||
258 | 262 | | |
259 | 263 | | |
260 | 264 | | |
261 | | - | |
262 | 265 | | |
263 | 266 | | |
264 | 267 | | |
| |||
325 | 328 | | |
326 | 329 | | |
327 | 330 | | |
328 | | - | |
329 | 331 | | |
330 | 332 | | |
331 | 333 | | |
| |||
350 | 352 | | |
351 | 353 | | |
352 | 354 | | |
353 | | - | |
354 | | - | |
| 355 | + | |
355 | 356 | | |
356 | 357 | | |
357 | 358 | | |
358 | 359 | | |
359 | 360 | | |
360 | 361 | | |
361 | 362 | | |
362 | | - | |
363 | | - | |
364 | | - | |
365 | | - | |
366 | | - | |
367 | | - | |
368 | | - | |
369 | | - | |
370 | | - | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
371 | 390 | | |
372 | | - | |
373 | | - | |
374 | | - | |
375 | 391 | | |
376 | 392 | | |
377 | 393 | | |
| |||
0 commit comments