From 40871b7eff3b4209d5df05ba70f74eee032642d1 Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 14 Jun 2026 12:22:56 -0600 Subject: [PATCH 1/4] Update: standardize GitHub Actions (path filters, concurrency, runners) Co-Authored-By: Claude Opus 4.8 (1M context) --- .github/workflows/Android.yml | 27 ++++++++++++++++++++++++--- .github/workflows/HTML5.yml | 31 ++++++++++++++++++++++++++----- .github/workflows/Linux.yml | 29 +++++++++++++++++++++++++---- .github/workflows/Windows.yml | 27 ++++++++++++++++++++++++--- .github/workflows/iOS-tvOS.yml | 17 +++++++++++++++-- .github/workflows/macOS.yml | 23 ++++++++++++++++++----- 6 files changed, 132 insertions(+), 22 deletions(-) diff --git a/.github/workflows/Android.yml b/.github/workflows/Android.yml index b8f5100a..08316eca 100644 --- a/.github/workflows/Android.yml +++ b/.github/workflows/Android.yml @@ -4,16 +4,37 @@ on: push: branches: - 'main' + paths: + - 'Sources/**' + - 'Tests/**' + - 'Macros/**' + - 'Dependencies/**' + - 'Package.swift' + - 'Package.resolved' + - '.github/workflows/Android.yml' pull_request: branches: - '**' + paths: + - 'Sources/**' + - 'Tests/**' + - 'Macros/**' + - 'Dependencies/**' + - 'Package.swift' + - 'Package.resolved' + - '.github/workflows/Android.yml' + +concurrency: + group: android-${{ github.ref }} + cancel-in-progress: true jobs: Build_Test-Linux-Android: runs-on: ubuntu-latest + timeout-minutes: 30 steps: - - uses: actions/checkout@v3 - + - uses: actions/checkout@v5 + - name: Install Android SDK run: | cd .. @@ -22,7 +43,7 @@ jobs: cd GateEngine - name: Swift Version run: swift --version - + - name: Build using Swift run: swift build --destination ../swift-5.8-android-24-sdk/usr/swiftpm-android-aarch64.json -Xlinker -rpath -Xlinker \$ORIGIN/lib/swift/android - name: Test using Swift diff --git a/.github/workflows/HTML5.yml b/.github/workflows/HTML5.yml index f8d88f1f..337b0b33 100644 --- a/.github/workflows/HTML5.yml +++ b/.github/workflows/HTML5.yml @@ -4,23 +4,44 @@ on: push: branches: - 'main' + paths: + - 'Sources/**' + - 'Tests/**' + - 'Macros/**' + - 'Dependencies/**' + - 'Package.swift' + - 'Package.resolved' + - '.github/workflows/HTML5.yml' pull_request: branches: - '**' + paths: + - 'Sources/**' + - 'Tests/**' + - 'Macros/**' + - 'Dependencies/**' + - 'Package.swift' + - 'Package.resolved' + - '.github/workflows/HTML5.yml' + +concurrency: + group: html5-${{ github.ref }} + cancel-in-progress: true jobs: Build_Test-macOS-WASI: runs-on: macos-latest + timeout-minutes: 30 steps: - - uses: actions/checkout@v3 - + - uses: actions/checkout@v5 + - name: Install Carton run: brew install swiftwasm/tap/carton - + - name: Test Insecure Context run: carton test --environment defaultBrowser --host 127.0.0.1 - + # - name: Archive # uses: actions/upload-artifact@v3 # if: always() @@ -31,6 +52,6 @@ jobs: # TODO: Figure out how to make chrome default without a confirmation # - name: Make Chrome Default # run: open -a "Google Chrome" --args --make-default-browser -# +# # - name: Test Secure Context # run: carton test --environment defaultBrowser --host localhost diff --git a/.github/workflows/Linux.yml b/.github/workflows/Linux.yml index 896885a2..8cf8624e 100644 --- a/.github/workflows/Linux.yml +++ b/.github/workflows/Linux.yml @@ -5,24 +5,45 @@ on: push: branches: - 'main' + paths: + - 'Sources/**' + - 'Tests/**' + - 'Macros/**' + - 'Dependencies/**' + - 'Package.swift' + - 'Package.resolved' + - '.github/workflows/Linux.yml' pull_request: branches: - '**' + paths: + - 'Sources/**' + - 'Tests/**' + - 'Macros/**' + - 'Dependencies/**' + - 'Package.swift' + - 'Package.resolved' + - '.github/workflows/Linux.yml' + +concurrency: + group: linux-${{ github.ref }} + cancel-in-progress: true jobs: Build_Test-Linux-Linux: runs-on: ubuntu-latest + timeout-minutes: 30 steps: - - uses: actions/checkout@v3 - + - uses: actions/checkout@v5 + - name: Install Linux Dependencies run: sudo apt-get update --fix-missing; sudo apt-get install freeglut3-dev; sudo apt-get install libopenal-dev - + - name: Swift Version run: swift --version - + - name: Build run: swift build - name: Test diff --git a/.github/workflows/Windows.yml b/.github/workflows/Windows.yml index 115e9373..1ff70d35 100644 --- a/.github/workflows/Windows.yml +++ b/.github/workflows/Windows.yml @@ -4,23 +4,44 @@ on: push: branches: - 'main' + paths: + - 'Sources/**' + - 'Tests/**' + - 'Macros/**' + - 'Dependencies/**' + - 'Package.swift' + - 'Package.resolved' + - '.github/workflows/Windows.yml' pull_request: branches: - '**' + paths: + - 'Sources/**' + - 'Tests/**' + - 'Macros/**' + - 'Dependencies/**' + - 'Package.swift' + - 'Package.resolved' + - '.github/workflows/Windows.yml' + +concurrency: + group: windows-${{ github.ref }} + cancel-in-progress: true jobs: Build_Test-Windows-Windows: runs-on: windows-latest + timeout-minutes: 30 steps: - uses: compnerd/gha-setup-swift@main with: branch: swift-5.10-release tag: 5.10-RELEASE - - uses: actions/checkout@v3 - + - uses: actions/checkout@v5 + - name: Swift Version run: swift --version - + - name: Build run: swift build - name: Test diff --git a/.github/workflows/iOS-tvOS.yml b/.github/workflows/iOS-tvOS.yml index a2b23b84..3c285612 100644 --- a/.github/workflows/iOS-tvOS.yml +++ b/.github/workflows/iOS-tvOS.yml @@ -6,13 +6,26 @@ on: pull_request: branches: - '**' + paths: + - 'Sources/**' + - 'Tests/**' + - 'Macros/**' + - 'Dependencies/**' + - 'Package.swift' + - 'Package.resolved' + - '.github/workflows/iOS-tvOS.yml' + +concurrency: + group: ios-tvos-${{ github.ref }} + cancel-in-progress: true jobs: Build_Test-macOS-iOS: runs-on: macos-latest + timeout-minutes: 30 steps: - - uses: actions/checkout@v4 - + - uses: actions/checkout@v5 + - name: Swift Version run: swift --version diff --git a/.github/workflows/macOS.yml b/.github/workflows/macOS.yml index 51280e16..c2ef1072 100644 --- a/.github/workflows/macOS.yml +++ b/.github/workflows/macOS.yml @@ -6,26 +6,39 @@ on: pull_request: branches: - '**' + paths: + - 'Sources/**' + - 'Tests/**' + - 'Macros/**' + - 'Dependencies/**' + - 'Package.swift' + - 'Package.resolved' + - '.github/workflows/macOS.yml' + +concurrency: + group: macos-${{ github.ref }} + cancel-in-progress: true jobs: Build_Test-macOS-macOS: runs-on: macos-15 + timeout-minutes: 45 steps: - - uses: actions/checkout@v4 - + - uses: actions/checkout@v5 + - name: Select Xcode version run: sudo xcode-select -s '/Applications/Xcode_26.1.app/Contents/Developer' - + - name: Swift Version run: swift --version - + - name: Build using Swift x86_64 run: swift build --triple x86_64-apple-macos - name: Build using Swift arm64 run: swift build --triple arm64-apple-macos - name: Test using Swift run: swift test - + - name: Build using Xcode run: xcodebuild -scheme GateEngine ONLY_ACTIVE_ARCH=NO -destination platform=macOS -configuration Release - name: Test using Xcode From f74518729e40479924cc20a9915fff266104b1a4 Mon Sep 17 00:00:00 2001 From: 0xLeif Date: Mon, 6 Jul 2026 19:45:33 -0600 Subject: [PATCH 2/4] Fix: resolve Linux/Windows/Android CI build failures - BinaryCodable+Collections.swift: use `public import DequeModule` and `public import OrderedCollections` instead of the `Collections` umbrella; under Swift 6's member import visibility, member lookups (append, reserveCapacity, etc.) require importing the module that actually defines Deque/OrderedSet/OrderedDictionary, and `public` is required since these types appear in public extensions here. - Shaders target (HLSLCodeGenerator.swift, MSLCodeGenerator.swift): same member-import-visibility fix for OrderedSet; add the OrderedCollections product dependency to the Shaders target in Package.swift. - Windows.yml: GateEngine's swift-tools-version is 6.1, but the workflow installed Swift 5.10, causing SwiftPM to refuse to resolve the manifest. Install Swift 6.1 via the non-deprecated swift-version/swift-build inputs instead. - Android.yml: the legacy swift-5.8-android-24-sdk destination bundle is incompatible with the Swift toolchain now preinstalled on ubuntu-latest, causing missing-header errors (stdio.h, inttypes.h) when cross-compiling. Switch to the modern `swift sdk install` artifact-bundle flow with the 6.1 Android SDK release and `--swift-sdk aarch64-unknown-linux-android24`, matching this package's swift-tools-version floor. Co-Authored-By: Claude Opus 4.8 (1M context) --- .github/workflows/Android.yml | 14 ++++++++------ .github/workflows/Windows.yml | 7 +++++-- Package.swift | 3 ++- .../BinaryCodable/BinaryCodable+Collections.swift | 8 +++++++- Sources/Shaders/Generators/HLSLCodeGenerator.swift | 5 ++++- Sources/Shaders/Generators/MSLCodeGenerator.swift | 5 ++++- 6 files changed, 30 insertions(+), 12 deletions(-) diff --git a/.github/workflows/Android.yml b/.github/workflows/Android.yml index 08316eca..b5996081 100644 --- a/.github/workflows/Android.yml +++ b/.github/workflows/Android.yml @@ -36,15 +36,17 @@ jobs: - uses: actions/checkout@v5 - name: Install Android SDK + # The old swift-5.8-android-24-sdk destination bundle is incompatible with the Swift + # toolchain now preinstalled on ubuntu-latest (6.x): its sysroot doesn't resolve against + # the newer compiler's search paths (missing stdio.h/inttypes.h). Use the modern + # `swift sdk install` artifact-bundle flow with an SDK matching this package's + # swift-tools-version (6.1) floor instead of the legacy `--destination` JSON file. run: | - cd .. - wget -q https://github.com/finagolfin/swift-android-sdk/releases/download/5.8/swift-5.8-android-24-sdk.tar.xz - tar xf swift-5.8-android-24-sdk.tar.xz - cd GateEngine + swift sdk install https://github.com/finagolfin/swift-android-sdk/releases/download/6.1/swift-6.1-RELEASE-android-24-0.1.artifactbundle.tar.gz --checksum 971f3b1fd03c059803d625f0a412d7e8c4c6f34440f5216ceaf13e886e8e706f - name: Swift Version run: swift --version - name: Build using Swift - run: swift build --destination ../swift-5.8-android-24-sdk/usr/swiftpm-android-aarch64.json -Xlinker -rpath -Xlinker \$ORIGIN/lib/swift/android + run: swift build --swift-sdk aarch64-unknown-linux-android24 - name: Test using Swift - run: swift test --destination ../swift-5.8-android-24-sdk/usr/swiftpm-android-aarch64.json -Xlinker -rpath -Xlinker \$ORIGIN/lib/swift/android + run: swift build --build-tests --swift-sdk aarch64-unknown-linux-android24 diff --git a/.github/workflows/Windows.yml b/.github/workflows/Windows.yml index 1ff70d35..54542cae 100644 --- a/.github/workflows/Windows.yml +++ b/.github/workflows/Windows.yml @@ -35,8 +35,11 @@ jobs: steps: - uses: compnerd/gha-setup-swift@main with: - branch: swift-5.10-release - tag: 5.10-RELEASE + # GateEngine's swift-tools-version is 6.1; installing 5.10 caused SwiftPM to refuse to + # resolve the manifest ("using Swift tools version 6.1.0 but the installed version is + # 5.10.0"). Use the non-deprecated swift-version/swift-build inputs at 6.1. + swift-version: swift-6.1-release + swift-build: 6.1-RELEASE - uses: actions/checkout@v5 - name: Swift Version diff --git a/Package.swift b/Package.swift index 99d8d38a..46b9c0a3 100644 --- a/Package.swift +++ b/Package.swift @@ -233,7 +233,8 @@ let package = Package( dependencies: [ "GateUtilities", "GameMath", - .product(name: "Collections", package: "swift-collections") + .product(name: "Collections", package: "swift-collections"), + .product(name: "OrderedCollections", package: "swift-collections") ], swiftSettings: .default(withCustomization: { settings in settings.append(.define("GATEENGINE_DEBUG_SHADERS", .when(configuration: .debug))) diff --git a/Sources/GateUtilities/BinaryCodable/BinaryCodable+Collections.swift b/Sources/GateUtilities/BinaryCodable/BinaryCodable+Collections.swift index f7bcd949..0305a2bc 100644 --- a/Sources/GateUtilities/BinaryCodable/BinaryCodable+Collections.swift +++ b/Sources/GateUtilities/BinaryCodable/BinaryCodable+Collections.swift @@ -7,7 +7,13 @@ #if canImport(Collections) -import Collections +// `Deque`, `OrderedSet`, and `OrderedDictionary` are defined in `DequeModule` and +// `OrderedCollections` respectively; the `Collections` umbrella module only re-exports them. +// Under Swift 6's member import visibility, the defining modules must be imported directly for +// their members (append, reserveCapacity, etc.) to resolve, and `public import` is required +// because these types appear in the `public` extensions below. +public import DequeModule +public import OrderedCollections extension Deque: BinaryCodable where Element: BinaryCodable {} public extension Deque where Element: BinaryCodable { diff --git a/Sources/Shaders/Generators/HLSLCodeGenerator.swift b/Sources/Shaders/Generators/HLSLCodeGenerator.swift index f5651775..7b72d10a 100644 --- a/Sources/Shaders/Generators/HLSLCodeGenerator.swift +++ b/Sources/Shaders/Generators/HLSLCodeGenerator.swift @@ -6,7 +6,10 @@ */ #if DEBUG || canImport(Direct3D12) -import Collections +// Import the module that actually defines `OrderedSet` rather than the `Collections` umbrella +// module (which only re-exports it) so member lookups (append, sort(by:), etc.) resolve under +// Swift 6's member import visibility checking. +import OrderedCollections import Foundation package final class HLSLCodeGenerator: CodeGenerator { diff --git a/Sources/Shaders/Generators/MSLCodeGenerator.swift b/Sources/Shaders/Generators/MSLCodeGenerator.swift index f90e9dd4..f5dbf17d 100644 --- a/Sources/Shaders/Generators/MSLCodeGenerator.swift +++ b/Sources/Shaders/Generators/MSLCodeGenerator.swift @@ -6,7 +6,10 @@ */ #if DEBUG || canImport(MetalKit) -import Collections +// Import the module that actually defines `OrderedSet` rather than the `Collections` umbrella +// module (which only re-exports it) so member lookups (append, sort(by:), etc.) resolve under +// Swift 6's member import visibility checking. +import OrderedCollections import Foundation package final class MSLCodeGenerator: CodeGenerator { From df6adc64ed8ef5cc5712eff4397b4548220d7938 Mon Sep 17 00:00:00 2001 From: 0xLeif Date: Mon, 6 Jul 2026 19:56:51 -0600 Subject: [PATCH 3/4] Fix: Android CI scope and GameMath compiler timeout - Android.yml: install a matching Swift 6.2 toolchain (rather than relying on whatever ubuntu-latest ships) and scope the cross-compiled build to GameMath + GateUtilities only, matching the same working configuration already validated on the swift-6-migration branch. Gravity (vendored C using bzero/glibc-only headers) and OpenALSoft (no Android config.h or audio backend wired up) are not portable to Android's Bionic libc and are out of scope here. - OrientedBoundingBox3D.swift: decompose a compound arithmetic expression in the OBB-vs-OBB intersection test that a Swift 6.3 toolchain fails to type-check in reasonable time (seen timing out the Linux build); behavior is unchanged. Co-Authored-By: Claude Opus 4.8 (1M context) --- .github/workflows/Android.yml | 28 +++++++++++++++---- .../3D Colliders/OrientedBoundingBox3D.swift | 6 +++- 2 files changed, 27 insertions(+), 7 deletions(-) diff --git a/.github/workflows/Android.yml b/.github/workflows/Android.yml index b5996081..f549f90c 100644 --- a/.github/workflows/Android.yml +++ b/.github/workflows/Android.yml @@ -35,18 +35,34 @@ jobs: steps: - uses: actions/checkout@v5 + - name: Install Swift 6.2 + uses: swift-actions/setup-swift@v2 + with: + swift-version: "6.2" + - name: Install Android SDK # The old swift-5.8-android-24-sdk destination bundle is incompatible with the Swift # toolchain now preinstalled on ubuntu-latest (6.x): its sysroot doesn't resolve against # the newer compiler's search paths (missing stdio.h/inttypes.h). Use the modern - # `swift sdk install` artifact-bundle flow with an SDK matching this package's - # swift-tools-version (6.1) floor instead of the legacy `--destination` JSON file. + # `swift sdk install` artifact-bundle flow with a matching Swift 6.2 toolchain instead of + # the legacy `--destination` JSON file, matching the same fix already validated on the + # swift-6-migration branch. run: | - swift sdk install https://github.com/finagolfin/swift-android-sdk/releases/download/6.1/swift-6.1-RELEASE-android-24-0.1.artifactbundle.tar.gz --checksum 971f3b1fd03c059803d625f0a412d7e8c4c6f34440f5216ceaf13e886e8e706f + swift sdk install https://github.com/finagolfin/swift-android-sdk/releases/download/6.2/swift-6.2-RELEASE-android-24-0.1.artifactbundle.tar.gz --checksum c26ebfd4e32c0ca1beabcc45729b62042da57ee76d7d043f63f2235da90dc491 + + - name: List SDKs + run: swift sdk list + - name: Swift Version run: swift --version - name: Build using Swift - run: swift build --swift-sdk aarch64-unknown-linux-android24 - - name: Test using Swift - run: swift build --build-tests --swift-sdk aarch64-unknown-linux-android24 + # ANDROID_NDK_ROOT must be unset for the SDK to function properly + # (GitHub Actions runners have this set by default). + # Only build Android-portable targets: Gravity (vendored C, uses bzero/glibc-only headers) + # and OpenALSoft (no Android config.h/backend) are not portable to Android's Bionic libc + # and are excluded from the cross-compiled build here, matching the same scoping already + # validated on the swift-6-migration branch. + env: + ANDROID_NDK_ROOT: "" + run: swift build --target GameMath --target GateUtilities --swift-sdk aarch64-unknown-linux-android24 diff --git a/Sources/GameMath/3D Types/3D Physics/3D Colliders/OrientedBoundingBox3D.swift b/Sources/GameMath/3D Types/3D Physics/3D Colliders/OrientedBoundingBox3D.swift index ab20de6a..78ce0544 100755 --- a/Sources/GameMath/3D Types/3D Physics/3D Colliders/OrientedBoundingBox3D.swift +++ b/Sources/GameMath/3D Types/3D Physics/3D Colliders/OrientedBoundingBox3D.swift @@ -255,7 +255,11 @@ extension OrientedBoundingBox3D { for i in 0..<3 { ra = lhs.radius[0] * absR[0][i] + lhs.radius[1] * absR[1][i] + lhs.radius[2] * absR[2][i] rb = rhs.radius[i] - if abs(t[0] * r[0][i] + t[1] * r[1][i] + t[2] * r[2][i]) > ra + rb { + let projection0: Float = t[0] * r[0][i] + let projection1: Float = t[1] * r[1][i] + let projection2: Float = t[2] * r[2][i] + let projection: Float = projection0 + projection1 + projection2 + if abs(projection) > ra + rb { return false } } From fd6606790bf72204ad619778b27922b91eea26a7 Mon Sep 17 00:00:00 2001 From: 0xLeif Date: Mon, 6 Jul 2026 20:19:46 -0600 Subject: [PATCH 4/4] Fix: remaining MemberImportVisibility errors in GateEngine target RenderingGeometryComponent.swift, DeferredDelaySystem.swift, RawGeometry.swift, and WASIPlatform.swift use Deque/OrderedSet but only relied on the Collections umbrella module (or GateEngine.swift's @_exported import), which does not satisfy Swift 6's per-file member import visibility check. Import DequeModule/OrderedCollections directly (public where the types appear in public API), and add the matching product dependencies to the GateEngine target in Package.swift. Mirrors the same fix already applied on the swift-6-migration branch. Co-Authored-By: Claude Opus 4.8 (1M context) --- Package.swift | 4 ++++ .../ECS/3D Specific/RenderingGeometryComponent.swift | 2 ++ .../GateEngine/ECS/PlatformSystems/DeferredDelaySystem.swift | 1 + Sources/GateEngine/Resources/Geometry/Raw/RawGeometry.swift | 1 + .../Platform Implementations/WASI/WASIPlatform.swift | 1 + 5 files changed, 9 insertions(+) diff --git a/Package.swift b/Package.swift index 46b9c0a3..d6bb92f9 100644 --- a/Package.swift +++ b/Package.swift @@ -119,6 +119,10 @@ let package = Package( .product(name: "Atomics", package: "swift-atomics"), .product(name: "Collections", + package: "swift-collections"), + .product(name: "DequeModule", + package: "swift-collections"), + .product(name: "OrderedCollections", package: "swift-collections") ]) diff --git a/Sources/GateEngine/ECS/3D Specific/RenderingGeometryComponent.swift b/Sources/GateEngine/ECS/3D Specific/RenderingGeometryComponent.swift index bba5ea51..b01ac129 100644 --- a/Sources/GateEngine/ECS/3D Specific/RenderingGeometryComponent.swift +++ b/Sources/GateEngine/ECS/3D Specific/RenderingGeometryComponent.swift @@ -5,6 +5,8 @@ * http://stregasgate.com */ +public import OrderedCollections + @MainActor public struct RenderingGeometryComponent: ResourceConstrainedComponent { /// Rendering options applied to all `geometries` diff --git a/Sources/GateEngine/ECS/PlatformSystems/DeferredDelaySystem.swift b/Sources/GateEngine/ECS/PlatformSystems/DeferredDelaySystem.swift index 82bb11f5..05a4423b 100644 --- a/Sources/GateEngine/ECS/PlatformSystems/DeferredDelaySystem.swift +++ b/Sources/GateEngine/ECS/PlatformSystems/DeferredDelaySystem.swift @@ -6,6 +6,7 @@ */ import Collections +import DequeModule public typealias DeferredClosure = () -> Void public typealias DelayClosure = () -> Void diff --git a/Sources/GateEngine/Resources/Geometry/Raw/RawGeometry.swift b/Sources/GateEngine/Resources/Geometry/Raw/RawGeometry.swift index af4153e6..fd5a8dd7 100755 --- a/Sources/GateEngine/Resources/Geometry/Raw/RawGeometry.swift +++ b/Sources/GateEngine/Resources/Geometry/Raw/RawGeometry.swift @@ -6,6 +6,7 @@ */ import GameMath +public import DequeModule /// An element array object formatted as triangle primitives public struct RawGeometry: Codable, Sendable, Equatable, Hashable { diff --git a/Sources/GateEngine/System/Platforms/Platform Implementations/WASI/WASIPlatform.swift b/Sources/GateEngine/System/Platforms/Platform Implementations/WASI/WASIPlatform.swift index 70da67d2..ae38d553 100644 --- a/Sources/GateEngine/System/Platforms/Platform Implementations/WASI/WASIPlatform.swift +++ b/Sources/GateEngine/System/Platforms/Platform Implementations/WASI/WASIPlatform.swift @@ -7,6 +7,7 @@ #if HTML5 import Foundation import Collections +import OrderedCollections import DOM import JavaScriptKit import JavaScriptEventLoop