Skip to content

Commit

Permalink
Merge branch 'main' into swiftlang#65-support-armv7
Browse files Browse the repository at this point in the history
  • Loading branch information
MaxDesiatov authored Jan 28, 2025
2 parents 35cd42c + b72dcca commit 417609a
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ swift run swift-sdk-generator make-linux-sdk --with-docker --linux-distribution-
You can also specify the base container image by name:

```
swift run swift-sdk-generator make-linux-sdk --with-docker --from-container-image swift:5.9-jammy
swift run swift-sdk-generator make-linux-sdk --from-container-image swift:5.9-jammy
```

```
Expand Down
2 changes: 1 addition & 1 deletion Sources/GeneratorCLI/GeneratorCLI.swift
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ extension GeneratorCLI {
but requires exactly the same version of the swift.org toolchain to be installed for it to work.
"""
)
var hostToolchain: Bool = true
var hostToolchain: Bool = false

@Option(
help: """
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ extension SwiftSDKGenerator {
baseDockerImage: String,
sdkDirPath: FilePath
) async throws {
logGenerationStep("Launching a Docker container to copy Swift SDK for the target triple from it...")
logGenerationStep("Launching a container to extract the Swift SDK for the target triple...")
try await withDockerContainer(fromImage: baseDockerImage) { containerID in
try await inTemporaryDirectory { generator, _ in
let sdkUsrPath = sdkDirPath.appending("usr")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public actor SwiftSDKGenerator {
}

private let fileManager = FileManager.default
private static let dockerCommand = "docker"
private static let dockerCommand = ProcessInfo.processInfo.environment["SWIFT_SDK_GENERATOR_CONTAINER_RUNTIME"] ?? "docker"

public static func getCurrentTriple(isVerbose: Bool) throws -> Triple {
let current = UnixName.current!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public struct LinuxRecipe: SwiftSDKRecipe {
if let targetSwiftPackagePath {
targetSwiftSource = .localPackage(FilePath(targetSwiftPackagePath))
} else {
if withDocker {
if withDocker || fromContainerImage != nil {
let imageName = fromContainerImage ?? versionsConfiguration.swiftBaseDockerImage
targetSwiftSource = .docker(baseSwiftDockerImage: imageName)
} else {
Expand Down
3 changes: 2 additions & 1 deletion Tests/SwiftSDKGeneratorTests/EndToEndTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ final class RepeatedBuildTests: XCTestCase {

// Test that an existing SDK can be rebuilt without cleaning up.
// Test with no arguments by default:
var possibleArguments = [""]
var possibleArguments = ["--host-toolchain"]
do {
try await Shell.run("docker ps")
possibleArguments.append("--with-docker --linux-distribution-name rhel --linux-distribution-version ubi9")
Expand Down Expand Up @@ -176,6 +176,7 @@ struct SDKConfiguration {
var sdkGeneratorArguments: String {
return [
"--sdk-name \(bundleName)",
"--host-toolchain",
withDocker ? "--with-docker" : nil,
"--swift-version \(swiftVersion)-RELEASE",
testLinuxSwiftSDKs ? "--host \(hostArch!)-unknown-linux-gnu" : nil,
Expand Down

0 comments on commit 417609a

Please sign in to comment.