Skip to content

Conversation

xtremekforever
Copy link
Contributor

@xtremekforever xtremekforever commented Aug 15, 2025

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.

@euanh @MaxDesiatov

@MaxDesiatov
Copy link
Contributor

@swift-ci test

@xtremekforever
Copy link
Contributor Author

Hmm, maybe that task group is not going to work too well. I can revert that piece if it's going to be an issue with 5.9.

@MaxDesiatov
Copy link
Contributor

We're likely very close to dropping support for 5.9 at this point, 5.10 issues are more important to resolve.

@MaxDesiatov
Copy link
Contributor

@swift-ci test

@MaxDesiatov MaxDesiatov enabled auto-merge (squash) August 19, 2025 09:34
@MaxDesiatov
Copy link
Contributor

@swift-ci test macos

@MaxDesiatov MaxDesiatov merged commit 349caaf into swiftlang:main Aug 19, 2025
39 checks passed
@xtremekforever xtremekforever deleted the #197-missing-curl-dependency branch August 19, 2025 10:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants