From 9e0ac04d6fe9b8e2730bfce1a3ee57b39617d5de Mon Sep 17 00:00:00 2001 From: Honza Dvorsky Date: Mon, 13 Oct 2025 12:23:12 +0200 Subject: [PATCH 1/3] Add linkage test --- .github/workflows/main.yml | 27 +++++++++++++++++++++++++++ .github/workflows/pull_request.yml | 27 +++++++++++++++++++++++++++ 2 files changed, 54 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index a5fc1c2..149a117 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -54,3 +54,30 @@ jobs: windows_6_1_enabled: false windows_nightly_next_enabled: false windows_nightly_main_enabled: false + + construct-linkage-test-matrix: + name: Construct linkage matrix + runs-on: ubuntu-latest + outputs: + integration-test-matrix: '${{ steps.generate-matrix.outputs.integration-test-matrix }}' + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + persist-credentials: false + - id: generate-matrix + run: echo "integration-test-matrix=$(curl -s https://raw.githubusercontent.com/apple/swift-nio/main/scripts/generate_matrix.sh | bash)" >> "$GITHUB_OUTPUT" + env: + MATRIX_LINUX_SETUP_COMMAND: apt-get update -y && apt-get install -yq jq && git config --global --add safe.directory /swift-configuration/.git && git config --global --add safe.directory /configuration + MATRIX_LINUX_COMMAND: ./Scripts/run-linkage-test.sh + MATRIX_LINUX_5_10_ENABLED: false + MATRIX_LINUX_6_0_ENABLED: false + MATRIX_LINUX_NIGHTLY_MAIN_ENABLED: false + + linkage-test: + name: Linkage test + needs: construct-linkage-test-matrix + uses: apple/swift-nio/.github/workflows/swift_test_matrix.yml@main + with: + name: "Integration test" + matrix_string: '${{ needs.construct-linkage-test-matrix.outputs.integration-test-matrix }}' diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index c4f6971..a55854d 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -61,3 +61,30 @@ jobs: windows_6_1_enabled: false windows_nightly_next_enabled: false windows_nightly_main_enabled: false + + construct-linkage-test-matrix: + name: Construct linkage matrix + runs-on: ubuntu-latest + outputs: + integration-test-matrix: '${{ steps.generate-matrix.outputs.integration-test-matrix }}' + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + persist-credentials: false + - id: generate-matrix + run: echo "integration-test-matrix=$(curl -s https://raw.githubusercontent.com/apple/swift-nio/main/scripts/generate_matrix.sh | bash)" >> "$GITHUB_OUTPUT" + env: + MATRIX_LINUX_SETUP_COMMAND: apt-get update -y && apt-get install -yq jq && git config --global --add safe.directory /swift-configuration/.git && git config --global --add safe.directory /configuration + MATRIX_LINUX_COMMAND: ./Scripts/run-linkage-test.sh + MATRIX_LINUX_5_10_ENABLED: false + MATRIX_LINUX_6_0_ENABLED: false + MATRIX_LINUX_NIGHTLY_MAIN_ENABLED: false + + linkage-test: + name: Linkage test + needs: construct-linkage-test-matrix + uses: apple/swift-nio/.github/workflows/swift_test_matrix.yml@main + with: + name: "Integration test" + matrix_string: '${{ needs.construct-linkage-test-matrix.outputs.integration-test-matrix }}' From beaecc379527c54679b4c7367a59e1307abec6b2 Mon Sep 17 00:00:00 2001 From: Honza Dvorsky Date: Mon, 13 Oct 2025 12:27:10 +0200 Subject: [PATCH 2/3] [TO BE REVERTED] Try to break linkage test to see it fail --- Sources/Configuration/AccessReporter.swift | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Sources/Configuration/AccessReporter.swift b/Sources/Configuration/AccessReporter.swift index 2e8f52c..ae7dbfa 100644 --- a/Sources/Configuration/AccessReporter.swift +++ b/Sources/Configuration/AccessReporter.swift @@ -12,11 +12,11 @@ // //===----------------------------------------------------------------------===// -#if canImport(FoundationEssentials) -public import FoundationEssentials -#else +// #if canImport(FoundationEssentials) +// public import FoundationEssentials +// #else public import Foundation -#endif +// #endif import Synchronization /// A type that receives and processes configuration access events. From 4b0a9cdf4697c94da68cdfc7d5fd21ef09e19a11 Mon Sep 17 00:00:00 2001 From: Honza Dvorsky Date: Mon, 13 Oct 2025 12:28:43 +0200 Subject: [PATCH 3/3] Revert "[TO BE REVERTED] Try to break linkage test to see it fail" This reverts commit beaecc379527c54679b4c7367a59e1307abec6b2. --- Sources/Configuration/AccessReporter.swift | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Sources/Configuration/AccessReporter.swift b/Sources/Configuration/AccessReporter.swift index ae7dbfa..2e8f52c 100644 --- a/Sources/Configuration/AccessReporter.swift +++ b/Sources/Configuration/AccessReporter.swift @@ -12,11 +12,11 @@ // //===----------------------------------------------------------------------===// -// #if canImport(FoundationEssentials) -// public import FoundationEssentials -// #else +#if canImport(FoundationEssentials) +public import FoundationEssentials +#else public import Foundation -// #endif +#endif import Synchronization /// A type that receives and processes configuration access events.