-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for generating Swift SDKs for Ubuntu 24.04 Noble (#188)
I was working on adding Debian 12 support for #116, but realized that adding Ubuntu Noble is "low-hanging fruit", since it's very straightforward. The default is still Ubuntu 22.04 Jammy, but this adds the option of generating the Swift SDK for 24.04 Noble now. ``` swift run swift-sdk-generator make-linux-sdk --linux-distribution-version 24.04 ``` I have also changed the packages download to get `Packages.xz` instead of `Packages.gz` since it is a smaller file download. I wonder if it is okay to use `xz` here since I noticed that the directories on the Debian mirrors only have `Packages.xz` files available, unlike the Ubuntu mirrors which all have `Packages.gz` AND `Packages.xz` files available.
- Loading branch information
1 parent
a9f8e2a
commit 0aa5486
Showing
7 changed files
with
101 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
brew 'xz' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
//===----------------------------------------------------------------------===// | ||
// | ||
// This source file is part of the Swift open source project | ||
// | ||
// Copyright (c) 2022-2025 Apple Inc. and the Swift project authors | ||
// Licensed under Apache License v2.0 with Runtime Library Exception | ||
// | ||
// See https://swift.org/LICENSE.txt for license information | ||
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors | ||
// | ||
//===----------------------------------------------------------------------===// | ||
|
||
import AsyncProcess | ||
import Foundation | ||
|
||
/// Look for an executable using the `which` utility. | ||
/// | ||
/// - Parameter executableName: The name of the executable to search for. | ||
/// - Throws: Any errors thrown by the ProcessExecutor. | ||
/// - Returns: The path to the executable if found, otherwise nil. | ||
func which(_ executableName: String) async throws -> String? { | ||
let result = try await ProcessExecutor.runCollectingOutput( | ||
executable: "/usr/bin/which", [executableName], collectStandardOutput: true, collectStandardError: false, | ||
environment: ProcessInfo.processInfo.environment | ||
) | ||
|
||
guard result.exitReason == .exit(0) else { | ||
return nil | ||
} | ||
|
||
if let output = result.standardOutput { | ||
let path = String(buffer: output).trimmingCharacters(in: .whitespacesAndNewlines) | ||
return path.isEmpty ? nil : path | ||
} | ||
|
||
return nil | ||
} |