File tree Expand file tree Collapse file tree 13 files changed +62
-59
lines changed
.devcontainer/build-scripts Expand file tree Collapse file tree 13 files changed +62
-59
lines changed Original file line number Diff line number Diff line change @@ -7,7 +7,10 @@ source $SWIFT_BUILDROOT/.devcontainer/build-scripts/swift-define
77
88# Build
99cd $WORKING_DIR
10+ make $BUILDROOT_OPTIONS zstd-build
11+ make $BUILDROOT_OPTIONS libedit-build
1012make $BUILDROOT_OPTIONS libbsd-build
13+ make $BUILDROOT_OPTIONS icu-build
1114make $BUILDROOT_OPTIONS libxml2-build
1215make $BUILDROOT_OPTIONS openssl-build
1316make $BUILDROOT_OPTIONS libcurl-build
Original file line number Diff line number Diff line change 2121 if [ ! -d " $BUILDROOT_OUTPUT_ARCH /build/host-swift-6.0.3" ]; then
2222 echo " Generating host tools symlink for $i "
2323 ln -s ../../$SWIFT_TARGET_ARCH /build/host-swift-6.0.3 ./host-swift-6.0.3
24+ rm $BUILDROOT_OUTPUT_ARCH /build/host-swift-6.0.3/.stamp_host_installed
2425 fi
2526 fi
2627done
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+ set -e
3+
4+ # Configurable
5+ SWIFT_BUILDROOT=" ${SWIFT_BUILDROOT:= $(pwd)} "
6+ source $SWIFT_BUILDROOT /.devcontainer/build-scripts/swift-define
7+
8+ # Build
9+ cd $WORKING_DIR
10+ echo " BR2_PACKAGE_SWIFT_HELLO=y" >> $BUILDROOT_CONFIG
11+ make $BUILDROOT_OPTIONS swift-hello-build
12+ make $BUILDROOT_OPTIONS
13+ file $BUILDROOT_TARGET /usr/bin/swift-hello
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+ set -e
3+
4+ # Configurable
5+ SWIFT_BUILDROOT=" ${SWIFT_BUILDROOT:= $(pwd)} "
6+ source $SWIFT_BUILDROOT /.devcontainer/build-scripts/swift-define
7+
8+ # Build
9+ cd $WORKING_DIR
10+ make $BUILDROOT_OPTIONS swift-hello-build
11+ QEMU_TEST=" /usr/bin/$QEMU_BIN -L $BUILDROOT_TARGET $BUILDROOT_TARGET /usr/bin/swift-hello"
12+ echo " $QEMU_TEST "
13+ $QEMU_TEST
Original file line number Diff line number Diff line change @@ -12,10 +12,23 @@ BUILDROOT_DEFCONFIG=swift_${SWIFT_TARGET_ARCH}_defconfig
1212BUILDROOT_DIR=$WORKING_DIR/buildroot
1313BR2_EXTERNAL=$SWIFT_BUILDROOT
1414BUILDROOT_OUTPUT=$WORKING_DIR/output/$SWIFT_TARGET_ARCH
15+ BUILDROOT_TARGET=$BUILDROOT_OUTPUT/target
16+ BUILDROOT_CONFIG=$BUILDROOT_OUTPUT/.config
1517BUILDROOT_OPTIONS="O=$BUILDROOT_OUTPUT -C $BUILDROOT_DIR BR2_EXTERNAL=$BR2_EXTERNAL"
1618HOST_SWIFT_SRCDIR=$BUILDROOT_OUTPUT/build/host-swift-6.0.3
1719SWIFT_LLVM_BUILD_DIR=$HOST_SWIFT_SRCDIR/swift-source/build/buildbot_linux/llvm-linux-$(uname -m)
1820HOST_SWIFT_BUILDDIR=$HOST_SWIFT_SRCDIR/build
1921SWIFT_NATIVE_TOOLS=$HOST_SWIFT_BUILDDIR/usr/bin
2022SWIFT_LLVM_DIR=$HOST_SWIFT_BUILDDIR/llvm
2123DOCKER_FILE=$SWIFT_BUILDROOT/.devcontainer/Dockerfile
24+ if [[ "$SWIFT_TARGET_ARCH" == "arm64" ]]; then
25+ QEMU_BIN=qemu-aarch64-static
26+ elif [[ "$SWIFT_TARGET_ARCH" == "armv5" ]]; then
27+ QEMU_BIN=qemu-arm-static
28+ elif [[ "$SWIFT_TARGET_ARCH" == "armv6" ]]; then
29+ QEMU_BIN=qemu-arm-static
30+ elif [[ "$SWIFT_TARGET_ARCH" == "armv7" ]]; then
31+ QEMU_BIN=qemu-arm-static
32+ else
33+ QEMU_BIN=qemu-$SWIFT_TARGET_ARCH-static
34+ fi
Original file line number Diff line number Diff line change 1818 $SWIFT_BUILDROOT/.devcontainer/build-scripts/download-buildroot.sh
1919 $SWIFT_BUILDROOT/.devcontainer/build-scripts/build.sh
2020 - name : Archive Build artifacts
21- uses : actions/upload-artifact@v3
21+ uses : actions/upload-artifact@v4.5.0
2222 with :
2323 name : build-${{ matrix.arch }}
24- path : ./output/${{ matrix.arch }}/images
24+ path : /workspaces/buildroot-swift/output/${{ matrix.arch }}/images/rootfs.tar
25+ - name : Build Test
26+ run : |
27+ export SWIFT_BUILDROOT=$GITHUB_WORKSPACE
28+ export SWIFT_TARGET_ARCH=${{ matrix.arch }}
29+ $SWIFT_BUILDROOT/.devcontainer/build-scripts/build-test.sh
30+ - name : Upload test binary
31+ 32+ with :
33+ name : swift-hello-${{ matrix.arch }}
34+ path : /workspaces/buildroot-swift/output/${{ matrix.arch }}/target/usr/bin/swift-hello
Original file line number Diff line number Diff line change 11# Architecture
2- BR2_powerpc64 =y
2+ BR2_powerpc64le =y
33BR2_powerpc_power7=y
44
55# GNU C Toolchain
Original file line number Diff line number Diff line change @@ -4,7 +4,6 @@ config BR2_PACKAGE_SWIFT_HELLO
44 bool "swift-hello"
55 depends on BR2_PACKAGE_SWIFT
66 select BR2_PACKAGE_SWIFT_FOUNDATION
7- select BR2_PACKAGE_XCTEST
87 help
98 Demo application for Swift.
109
Original file line number Diff line number Diff line change @@ -13,10 +13,6 @@ let package = Package(
1313 . executableTarget(
1414 name: " swift-hello " ,
1515 dependencies: [ ]
16- ) ,
17- . testTarget(
18- name: " swift-helloTests " ,
19- dependencies: [ " swift-hello " ]
20- ) ,
16+ )
2117 ]
2218)
Original file line number Diff line number Diff line change 1- import Foundation
21#if canImport(Foundation)
32import Foundation
43#endif
@@ -19,6 +18,7 @@ struct Hello {
1918 }
2019 for _ in 0 ..< 5 {
2120 print ( UUID ( ) )
21+ print ( Date ( ) )
2222 try await Task . sleep ( nanoseconds: 500_000_000 )
2323 }
2424 }
@@ -28,4 +28,3 @@ func errorTest() async throws {
2828 print ( " Will throw " )
2929 throw CocoaError ( . userCancelled)
3030}
31-
You can’t perform that action at this time.
0 commit comments