Skip to content

Commit bfce834

Browse files
committed
GHA: adjust the file system layout to accommodate the installer
This adjusts the installation to shuffle around some of the installed files to match the expected layout post-installation. This is required to accommodate the installer which is beginning to expect the toolchain to be laid out as desired.
1 parent 6a902d9 commit bfce834

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

.github/workflows/swift-toolchain.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2277,6 +2277,13 @@ jobs:
22772277
22782278
$CMAKE_CPU = if ("${{ matrix.cpu }}" -eq "armv7") { "armv7-a" } else { "${{ matrix.cpu }}" }
22792279
2280+
$XCTestBinDir = switch ("${{ matrix.cpu }}") {
2281+
"armv7" { "bin32a" }
2282+
"i686" { "bin32" }
2283+
"x86_64" { "bin64" }
2284+
"aarch64" { "bin64a" }
2285+
}
2286+
22802287
cmake -B ${{ github.workspace }}/BinaryCache/xctest `
22812288
-D BUILD_SHARED_LIBS=YES `
22822289
-D CMAKE_BUILD_TYPE=Release `
@@ -2287,6 +2294,7 @@ jobs:
22872294
-D CMAKE_CXX_COMPILER=${{ matrix.cxx }} `
22882295
-D CMAKE_CXX_COMPILER_TARGET=${{ matrix.triple }} `
22892296
-D CMAKE_CXX_FLAGS="${{ matrix.cxxflags }}" `
2297+
-D CMAKE_INSTALL_BINDIR=$XCTestBinDir `
22902298
-D CMAKE_INSTALL_PREFIX=${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/${{ matrix.os }}.platform/Developer/Library/XCTest-development/usr `
22912299
-D CMAKE_Swift_COMPILER=${SWIFTC} `
22922300
-D CMAKE_Swift_COMPILER_TARGET=${{ matrix.triple_no_api_level }} `
@@ -2335,13 +2343,21 @@ jobs:
23352343
23362344
$CMAKE_CPU = if ("${{ matrix.cpu }}" -eq "armv7") { "armv7-a" } else { "${{ matrix.cpu }}" }
23372345
2346+
$TestingBinDir = switch ("${{ matrix.cpu }}") {
2347+
"armv7" { "bin32a" }
2348+
"i686" { "bin32" }
2349+
"x86_64" { "bin64" }
2350+
"aarch64" { "bin64a" }
2351+
}
2352+
23382353
cmake -B ${{ github.workspace }}/BinaryCache/testing `
23392354
-D BUILD_SHARED_LIBS=YES `
23402355
-D CMAKE_BUILD_TYPE=Release `
23412356
-D CMAKE_BUILD_WITH_INSTALL_RPATH=YES `
23422357
-D CMAKE_CXX_COMPILER=${{ matrix.cxx }} `
23432358
-D CMAKE_CXX_COMPILER_TARGET=${{ matrix.triple }} `
23442359
-D CMAKE_CXX_FLAGS="${{ matrix.cxxflags }}" `
2360+
-D CMAKE_INSTALL_BINDIR=$TestingBinDir `
23452361
-D CMAKE_INSTALL_PREFIX=${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/${{ matrix.os }}.platform/Developer/Library/Testing-development/usr `
23462362
-D CMAKE_Swift_COMPILER=${SWIFTC} `
23472363
-D CMAKE_Swift_COMPILER_TARGET=${{ matrix.triple_no_api_level }} `
@@ -2367,10 +2383,25 @@ jobs:
23672383
if: matrix.os != 'Android' || inputs.build_android
23682384
run: |
23692385
cmake --build ${{ github.workspace }}/BinaryCache/testing --target install
2386+
- name: Testing Install Fixup
2387+
if: matrix.os != 'Android' || inputs.build_android
2388+
run: |
2389+
$OS = "${{ matrix.os }}".ToLowerInvariant()
2390+
New-Item -ItemType Directory -Path "${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/${{ matrix.os }}.platform/Developer/Library/Testing-development/usr/lib/swift/${OS}/${{ matrix.cpu }}" -Force -ErrorAction Ignore | Out-Null
2391+
Move-Item -Path "${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/${{ matrix.os }}.platform/Developer/Library/Testing-development/usr/lib/swift/${OS}/Testing.lib" "${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/${{ matrix.os }}.platform/Developer/Library/Testing-development/usr/lib/swift/${OS}/${{ matrix.cpu }}/Testing.lib"
23702392
- name: Install xctest
23712393
if: matrix.os != 'Android' || inputs.build_android
23722394
run: |
23732395
cmake --build ${{ github.workspace }}/BinaryCache/xctest --target install
2396+
- name: XCTest Install Fixup
2397+
if: matrix.os != 'Android' || inputs.build_android
2398+
run: |
2399+
$OS = "${{ matrix.os }}".ToLowerInvariant()
2400+
New-Item -ItemType Directory -Path "${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/${{ matrix.os }}.platform/Developer/Library/XCTest-development/usr/lib/swift/${OS}/${{ matrix.cpu }}" -Force -ErrorAction Ignore | Out-Null
2401+
New-Item -ItemType Directory -Path "${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/${{ matrix.os }}.platform/Developer/Library/XCTest-development/usr/lib/swift/${OS}/XCTest.swiftmodule" -Force -ErrorAction Ignore | Out-Null
2402+
Move-Item -Path "${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/${{ matrix.os }}.platform/Developer/Library/XCTest-development/usr/lib/swift/${OS}/XCTest.lib" "${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/${{ matrix.os }}.platform/Developer/Library/XCTest-development/usr/lib/swift/${OS}/${{ matrix.cpu }}/XCTest.lib"
2403+
Move-Item -Path "${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/${{ matrix.os }}.platform/Developer/Library/XCTest-development/usr/lib/swift/${OS}/${{ matrix.cpu }}/XCTest.swiftdoc" "${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/${{ matrix.os }}.platform/Developer/Library/XCTest-development/usr/lib/swift/${OS}/XCTest.swiftmodule/${{ matrix.triple_no_api_level }}.swiftdoc"
2404+
Move-Item -Path "${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/${{ matrix.os }}.platform/Developer/Library/XCTest-development/usr/lib/swift/${OS}/${{ matrix.cpu }}/XCTest.swiftmodule" "${{ github.workspace }}/BuildRoot/Library/Developer/Platforms/${{ matrix.os }}.platform/Developer/Library/XCTest-development/usr/lib/swift/${OS}/XCTest.swiftmodule/${{ matrix.triple_no_api_level }}.swiftmodule"
23742405
- name: Install foundation
23752406
if: matrix.os != 'Android' || inputs.build_android
23762407
run: |

0 commit comments

Comments
 (0)