From 57c8b72e0566b0214477fe153cea5092315a086c Mon Sep 17 00:00:00 2001 From: Rick Newton-Rogers Date: Wed, 28 Oct 2026 08:39:19 -0400 Subject: [PATCH 1/2] Enable the FreeBSD check by default FreeBSD was the one standard check that stayed opt-in after the others were enabled by default, though it is a check every swiftlang package is expected to pass. `enable_freebsd` defaults to true in `package_test.yml` and the generator, and a package opts out with `enable_freebsd: false`. It still runs only the `nightly-main` toolchain on FreeBSD 14. --- .github/workflows/package_test.yml | 4 ++-- .github/workflows/scripts/matrix/generate-matrix.swift | 2 +- .../Tests/MatrixGeneratorTests/CoreTests.swift | 6 +++--- .../Tests/MatrixGeneratorTests/EntryPointTests.swift | 1 + 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/.github/workflows/package_test.yml b/.github/workflows/package_test.yml index 1bde8535..7d6ef279 100644 --- a/.github/workflows/package_test.yml +++ b/.github/workflows/package_test.yml @@ -375,8 +375,8 @@ on: # ----- FreeBSD ----- enable_freebsd: type: boolean - description: "Boolean to enable FreeBSD testing." - default: false + description: "Run the tests on FreeBSD. Set false to skip it." + default: true freebsd_swift_versions: type: string description: "FreeBSD Swift version list (JSON array)." diff --git a/.github/workflows/scripts/matrix/generate-matrix.swift b/.github/workflows/scripts/matrix/generate-matrix.swift index 04268be4..d8b90ea8 100644 --- a/.github/workflows/scripts/matrix/generate-matrix.swift +++ b/.github/workflows/scripts/matrix/generate-matrix.swift @@ -38,7 +38,7 @@ struct Configuration { @Input("ENABLE_MACOS") var macOSEnabled = true @Input("ENABLE_MACOS_SWIFTLY") var swiftlyEnabled = true @Input("ENABLE_WINDOWS") var windowsEnabled = true - @Input("ENABLE_FREEBSD") var freeBSDEnabled = false + @Input("ENABLE_FREEBSD") var freeBSDEnabled = true @Input("ENABLE_ANDROID_EMULATOR_TESTS") var androidEmulatorEnabled = true @Input("ENABLE_CXX_INTEROP") var cxxInteropEnabled = true diff --git a/tests/MatrixGeneratorValidator/Tests/MatrixGeneratorTests/CoreTests.swift b/tests/MatrixGeneratorValidator/Tests/MatrixGeneratorTests/CoreTests.swift index 0879bc57..15ba6e23 100644 --- a/tests/MatrixGeneratorValidator/Tests/MatrixGeneratorTests/CoreTests.swift +++ b/tests/MatrixGeneratorValidator/Tests/MatrixGeneratorTests/CoreTests.swift @@ -39,10 +39,10 @@ struct PlatformSelectionTests { #expect(generated.exitCode == 0) } - @Test("Every platform but FreeBSD is on by default") - func everyPlatformButFreeBSDIsOnByDefault() throws { + @Test("Every platform is on by default") + func everyPlatformIsOnByDefault() throws { let generated = try Generator.run(includePlatformDefaults: true) - #expect(Set(generated.platforms) == ["Linux", "macOS", "Windows"]) + #expect(Set(generated.platforms) == ["FreeBSD", "Linux", "macOS", "Windows"]) } } diff --git a/tests/MatrixGeneratorValidator/Tests/MatrixGeneratorTests/EntryPointTests.swift b/tests/MatrixGeneratorValidator/Tests/MatrixGeneratorTests/EntryPointTests.swift index 89637e51..f01a61e7 100644 --- a/tests/MatrixGeneratorValidator/Tests/MatrixGeneratorTests/EntryPointTests.swift +++ b/tests/MatrixGeneratorValidator/Tests/MatrixGeneratorTests/EntryPointTests.swift @@ -62,6 +62,7 @@ struct EntryPointDefaultTests { "Cxx interop Swift current", "Cxx interop Swift nightly-release", "Cxx interop Swift nightly-main", + "FreeBSD nightly-main - 14.3 - x86_64", ] ), ( From fd2beaf4a5a6bc7bfd2b7dd9e7792f2c50816f02 Mon Sep 17 00:00:00 2001 From: Rick Newton-Rogers Date: Wed, 28 Oct 2026 09:14:03 -0400 Subject: [PATCH 2/2] Keep the self-tests' FreeBSD and package settings in step with the defaults FreeBSD is on by default now, so the first self-test call gained a FreeBSD job that ran `swift test` at the repository root, where there is no `Package.swift`, and the container and commands calls would have gained one they are not about. The first call enters `tests/TestPackage` for every platform with `package_path`, replacing the three setup commands that each reached it for one platform, so the FreeBSD VM enters it too, and the other two calls turn FreeBSD off. --- .github/workflows/pull_request.yml | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index dc8e1f96..e9dd6253 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -151,19 +151,14 @@ jobs: name: Unified package test uses: ./.github/workflows/package_test.yml with: + # Every platform enters the package below the repository root, the FreeBSD VM included. + package_path: tests/TestPackage linux_swift_versions: '["6.3", "nightly-main"]' - linux_setup_command: cd tests/TestPackage windows_swift_versions: '["6.3"]' - windows_setup_command: cd tests/TestPackage windows_command: Invoke-Program swift build - # The static SDK build and the Cxx interop check are on by default. + # FreeBSD, the static SDK build and the Cxx interop check are on by default. linux_static_sdk_versions: '["6.3"]' - # The SDK script builds in the working directory, so the setup command is - # the only way to reach a package below the repository root. - linux_static_sdk_setup_command: cd tests/TestPackage - # The Cxx interop check takes linux_setup_command as its setup command, so - # it enters tests/TestPackage too. - # The rest are off: this call is about Linux, Windows and the two checks above. + # The rest are off: this call is about Linux, Windows, FreeBSD and the checks above. enable_macos: false enable_macos_swiftly: false enable_wasm_sdk_build: false @@ -204,6 +199,7 @@ jobs: # A container runs its commands under cmd, where Invoke-Program does not exist. windows_command: swift build # Only the Linux and Windows container paths are under test here. + enable_freebsd: false enable_macos: false enable_macos_swiftly: false enable_linux_static_sdk_build: false @@ -220,6 +216,7 @@ jobs: # Named so this does not share a concurrency group with the other calls. name: unified-package-test-commands enable_windows: false + enable_freebsd: false enable_macos: false enable_macos_swiftly: false enable_linux_static_sdk_build: false