Skip to content

Commit

Permalink
Merge pull request #10 from MillerTechnologyPeru/feature/6.0.2
Browse files Browse the repository at this point in the history
Update to Swift 6.0.2
  • Loading branch information
colemancda authored Dec 11, 2024
2 parents 7fd58cd + 0c60340 commit 4d4d8b6
Show file tree
Hide file tree
Showing 15 changed files with 54 additions and 87 deletions.
2 changes: 1 addition & 1 deletion .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# [Choice] Swift version: 5.6-focal, 5.5, 5.4, 5.3, 5.2, 5.1, 4.2
ARG VARIANT=5.10-jammy
ARG VARIANT=6.0.2-jammy
FROM swift:${VARIANT}

# [Option] Install zsh
Expand Down
6 changes: 4 additions & 2 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"dockerfile": "Dockerfile",
"args": {
// Update the VARIANT arg to pick a Swift version
"VARIANT": "5.10-jammy",
"VARIANT": "6.0.2-jammy",
// Options
"NODE_VERSION": "lts/*"
}
Expand All @@ -28,7 +28,9 @@

// Add the IDs of extensions you want installed when the container is created.
"extensions": [
"sswg.swift-lang"
"sswg.swift-lang",
"ms-vscode.cmake-tools",
"ms-vscode.makefile-tools"
]
}
},
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/buildroot-experimental.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ jobs:
strategy:
matrix:
config: ["nezha"]
runs-on: ubuntu-latest
container: swift:5.10-jammy
runs-on: Linux
container: swift:6.0.2-jammy
steps:
- name: Checkout
uses: actions/checkout@v3
Expand All @@ -22,7 +22,7 @@ jobs:
export BUILDROOT_RELEASE=2024.02.9
export DEBIAN_FRONTEND=noninteractive
export DEBCONF_NONINTERACTIVE_SEEN=true
export SWIFT_BIN_URL=https://github.com/MillerTechnologyPeru/swift/releases/download/swift-5.10-RELEASE/swift-5.10-Debian11-x86_64.tar.gz
export SWIFT_BIN_URL=https://github.com/MillerTechnologyPeru/swift/releases/download/swift-6.0.2-RELEASE/swift-6.0.2-Debian11-x86_64.tar.gz
apt update
$SRC_ROOT/.devcontainer/library-scripts/install-dependencies.sh
$SRC_ROOT/.devcontainer/library-scripts/install-swift.sh
Expand All @@ -41,7 +41,7 @@ jobs:
matrix:
config: ["qemu_ppc_mac99"]
runs-on: ubuntu-latest
container: swift:5.10-jammy
container: swift:6.0.2-jammy
steps:
- name: Checkout
uses: actions/checkout@v3
Expand All @@ -55,7 +55,7 @@ jobs:
export BUILDROOT_RELEASE=2024.02.9
export DEBIAN_FRONTEND=noninteractive
export DEBCONF_NONINTERACTIVE_SEEN=true
export SWIFT_BIN_URL=https://github.com/MillerTechnologyPeru/swift/releases/download/swift-5.10-RELEASE/swift-5.10-Debian11-x86_64.tar.gz
export SWIFT_BIN_URL=https://github.com/MillerTechnologyPeru/swift/releases/download/swift-6.0.2-RELEASE/swift-6.0.2-Debian11-x86_64.tar.gz
apt update
$SRC_ROOT/.devcontainer/library-scripts/install-dependencies.sh
$SRC_ROOT/.devcontainer/library-scripts/install-swift.sh
Expand All @@ -74,7 +74,7 @@ jobs:
matrix:
config: ["qemu_mips32r6el_malta", "qemu_mips64r6el_malta"]
runs-on: ubuntu-latest
container: swift:5.10-jammy
container: swift:6.0.2-jammy
steps:
- name: Checkout
uses: actions/checkout@v3
Expand All @@ -88,7 +88,7 @@ jobs:
export BUILDROOT_RELEASE=2024.02.9
export DEBIAN_FRONTEND=noninteractive
export DEBCONF_NONINTERACTIVE_SEEN=true
export SWIFT_BIN_URL=https://github.com/MillerTechnologyPeru/swift/releases/download/swift-5.10-RELEASE/swift-5.10-Debian11-x86_64.tar.gz
export SWIFT_BIN_URL=https://github.com/MillerTechnologyPeru/swift/releases/download/swift-6.0.2-RELEASE/swift-6.0.2-Debian11-x86_64.tar.gz
apt update
$SRC_ROOT/.devcontainer/library-scripts/install-dependencies.sh
$SRC_ROOT/.devcontainer/library-scripts/install-swift.sh
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/buildroot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ jobs:
strategy:
matrix:
config: ["imx6slevk", "aarch64_efi", "pc_x86_64_efi", "qemu_x86", "olimex_imx233_olinuxino", "raspberrypi0w", "qemu_ppc64le_pseries"]
runs-on: ubuntu-latest
container: swift:5.10-jammy
runs-on: Linux
container: swift:6.0.2-jammy
steps:
- name: Checkout
uses: actions/checkout@v3
Expand Down
39 changes: 0 additions & 39 deletions package/foundation/001-Foundation-strlcpy.patch

This file was deleted.

2 changes: 1 addition & 1 deletion package/foundation/foundation.hash
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sha256 e25700bffc439b36c5c9acf169332c0dd9805fcd91cd570b4ce96163b70bae5b foundation-5.10.tar.gz
sha256 8af719f14a05cee2d32625cf455261fc74d13eeef3ba9e5b9547316743d5cde9 foundation-6.0.2.tar.gz
27 changes: 9 additions & 18 deletions package/foundation/foundation.mk
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
### Foundation
FOUNDATION_VERSION = 5.10
FOUNDATION_SITE = $(call github,apple,swift-corelibs-foundation,swift-$(FOUNDATION_VERSION)-RELEASE)
FOUNDATION_VERSION = 6.0.2
FOUNDATION_SITE = $(call github,swiftlang,swift-corelibs-foundation,swift-$(FOUNDATION_VERSION)-RELEASE)
FOUNDATION_LICENSE = Apache-2.0
FOUNDATION_LICENSE_FILES = LICENSE
FOUNDATION_INSTALL_STAGING = YES
Expand All @@ -13,19 +13,15 @@ FOUNDATION_CONF_OPTS += \
-DCMAKE_Swift_FLAGS_DEBUG="" \
-DCMAKE_Swift_FLAGS_RELEASE="" \
-DCMAKE_Swift_FLAGS_RELWITHDEBINFO="" \
-DCF_DEPLOYMENT_SWIFT=ON \
-Ddispatch_DIR="$(LIBSWIFTDISPATCH_BUILDDIR)/cmake/modules" \
-DICU_I18N_LIBRARY_RELEASE=${STAGING_DIR}/usr/lib/libicui18n.so \
-DICU_UC_LIBRARY_RELEASE=${STAGING_DIR}/usr/lib/libicuuc.so \
-DICU_I18N_LIBRARY_DEBUG=${STAGING_DIR}/usr/lib/libicui18n.so \
-DICU_UC_LIBRARY_DEBUG=${STAGING_DIR}/usr/lib/libicuuc.so \
-DICU_INCLUDE_DIR="${STAGING_DIR}/usr/include" \
-DICU_DATA_LIBRARY_RELEASE=${STAGING_DIR}/usr/lib/libicudata.so \
-DCURL_LIBRARY_RELEASE=${STAGING_DIR}/usr/lib/libcurl.so \
-DCURL_LIBRARY_DEBUG=${STAGING_DIR}/usr/lib/libcurl.so \
-DCURL_INCLUDE_DIR="${STAGING_DIR}/usr/include" \
-DLIBXML2_LIBRARY=${STAGING_DIR}/usr/lib/libxml2.so \
-DLIBXML2_INCLUDE_DIR=${STAGING_DIR}/usr/include/libxml2 \
-DLibRT_LIBRARIES=${STAGING_DIR}/usr/lib/librt.a \
-DSwiftFoundation_MODULE_TRIPLE=${SWIFT_TARGET_NAME} \
-DSwiftFoundation_MACRO=${SWIFT_NATIVE_PATH}/../lib/swift/host/plugins \

ifeq (FOUNDATION_SUPPORTS_IN_SOURCE_BUILD),YES)
FOUNDATION_BUILDDIR = $(FOUNDATION_SRCDIR)
Expand All @@ -51,6 +47,9 @@ define FOUNDATION_CONFIGURE_CMDS
-DCMAKE_C_COMPILER=$(SWIFT_NATIVE_PATH)/clang \
-DCMAKE_C_FLAGS="-w -fuse-ld=lld -target $(SWIFT_TARGET_NAME) --sysroot=$(STAGING_DIR) $(SWIFT_EXTRA_FLAGS) -I$(STAGING_DIR)/usr/include -B$(STAGING_DIR)/usr/lib -B$(HOST_DIR)/lib/gcc/$(GNU_TARGET_NAME)/$(call qstrip,$(BR2_GCC_VERSION)) -L$(HOST_DIR)/lib/gcc/$(GNU_TARGET_NAME)/$(call qstrip,$(BR2_GCC_VERSION))" \
-DCMAKE_C_LINK_FLAGS="-target $(SWIFT_TARGET_NAME) --sysroot=$(STAGING_DIR)" \
-DCMAKE_CXX_COMPILER=$(SWIFT_NATIVE_PATH)/clang++ \
-DCMAKE_CXX_FLAGS="-w -fuse-ld=lld -target $(SWIFT_TARGET_NAME) --sysroot $(STAGING_DIR) -latomic $(SWIFT_EXTRA_FLAGS) -I$(STAGING_DIR)/usr/include -B$(STAGING_DIR)/usr/lib -B$(STAGING_DIR)/lib -B$(HOST_DIR)/lib/gcc/$(GNU_TARGET_NAME)/$(call qstrip,$(BR2_GCC_VERSION)) -L$(HOST_DIR)/lib/gcc/$(GNU_TARGET_NAME)/$(call qstrip,$(BR2_GCC_VERSION)) -I$(HOST_DIR)/$(GNU_TARGET_NAME)/include/c++/$(call qstrip,$(BR2_GCC_VERSION))/ -I$(HOST_DIR)/$(GNU_TARGET_NAME)/include/c++/$(call qstrip,$(BR2_GCC_VERSION))/$(GNU_TARGET_NAME)" \
-DCMAKE_CXX_LINK_FLAGS="-target $(SWIFT_TARGET_NAME) --sysroot=$(STAGING_DIR)" \
-DCMAKE_ASM_FLAGS="-target $(SWIFT_TARGET_NAME) --sysroot=$(STAGING_DIR)" \
$(FOUNDATION_CONF_OPTS) \
)
Expand All @@ -70,17 +69,9 @@ define FOUNDATION_INSTALL_STAGING_CMDS
cp $(FOUNDATION_BUILDDIR)/lib/*.so $(STAGING_DIR)/usr/lib/swift/linux/
# Copy CoreFoundation module
mkdir -p ${STAGING_DIR}/usr/lib/swift/CoreFoundation
cp $(FOUNDATION_BUILDDIR)/CoreFoundation.framework/Headers/*.h ${STAGING_DIR}/usr/lib/swift/CoreFoundation/
cp $(FOUNDATION_SRCDIR)/Sources/CoreFoundation/include/*.h ${STAGING_DIR}/usr/lib/swift/CoreFoundation/
touch ${STAGING_DIR}/usr/lib/swift/CoreFoundation/module.map
echo 'framework module CoreFoundation [extern_c] [system] { umbrella header "${STAGING_DIR}/usr/lib/swift/CoreFoundation/CoreFoundation.h" }' > ${STAGING_DIR}/usr/lib/swift/CoreFoundation/module.map
# Copy CFXMLInterface module
mkdir -p ${STAGING_DIR}/usr/lib/swift/CFXMLInterface
touch ${STAGING_DIR}/usr/lib/swift/CFXMLInterface/module.map
echo 'framework module CFXMLInterface [extern_c] [system] { umbrella header "${STAGING_DIR}/usr/lib/swift/CFXMLInterface/CFXMLInterface.h" }' > ${STAGING_DIR}/usr/lib/swift/CFXMLInterface/module.map
# Copy CFURLSessionInterface module
mkdir -p ${STAGING_DIR}/usr/lib/swift/CFURLSessionInterface
touch ${STAGING_DIR}/usr/lib/swift/CFURLSessionInterface/module.map
echo 'framework module CFURLSessionInterface [extern_c] [system] { umbrella header "${STAGING_DIR}/usr/lib/swift/CFURLSessionInterface/CFURLSessionInterface.h" }' > ${STAGING_DIR}/usr/lib/swift/CFURLSessionInterface/module.map
# Copy Swift modules
cp $(FOUNDATION_BUILDDIR)/swift/* ${STAGING_DIR}/usr/lib/swift/linux/$(SWIFT_TARGET_ARCH)/
# Restore Dispatch headers
Expand Down
2 changes: 1 addition & 1 deletion package/libdispatch/libdispatch.hash
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sha256 16e088cf12654d22658879710b9694a6fad1c94d5e5d0c597741b71fbcb3e034 libdispatch-5.10.tar.gz
sha256 3df429b22d9294c0ca5291c86e83a35f6326600a1c271933107bba199b919008 libdispatch-6.0.2.tar.gz
4 changes: 2 additions & 2 deletions package/libdispatch/libdispatch.mk
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
### Grand Central Dispatch
LIBDISPATCH_VERSION = 5.10
LIBDISPATCH_SITE = $(call github,apple,swift-corelibs-libdispatch,swift-$(LIBDISPATCH_VERSION)-RELEASE)
LIBDISPATCH_VERSION = 6.0.2
LIBDISPATCH_SITE = $(call github,swiftlang,swift-corelibs-libdispatch,swift-$(LIBDISPATCH_VERSION)-RELEASE)
LIBDISPATCH_LICENSE = Apache-2.0
LIBDISPATCH_LICENSE_FILES = LICENSE
LIBDISPATCH_INSTALL_STAGING = YES
Expand Down
2 changes: 1 addition & 1 deletion package/libswiftdispatch/libswiftdispatch.hash
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sha256 16e088cf12654d22658879710b9694a6fad1c94d5e5d0c597741b71fbcb3e034 libswiftdispatch-5.10.tar.gz
sha256 3df429b22d9294c0ca5291c86e83a35f6326600a1c271933107bba199b919008 libswiftdispatch-6.0.2.tar.gz
4 changes: 2 additions & 2 deletions package/libswiftdispatch/libswiftdispatch.mk
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
### Grand Central Dispatch with Swift overlay
LIBSWIFTDISPATCH_VERSION = 5.10
LIBSWIFTDISPATCH_SITE = $(call github,apple,swift-corelibs-libdispatch,swift-$(LIBSWIFTDISPATCH_VERSION)-RELEASE)
LIBSWIFTDISPATCH_VERSION = 6.0.2
LIBSWIFTDISPATCH_SITE = $(call github,swiftlang,swift-corelibs-libdispatch,swift-$(LIBSWIFTDISPATCH_VERSION)-RELEASE)
LIBSWIFTDISPATCH_LICENSE = Apache-2.0
LIBSWIFTDISPATCH_LICENSE_FILES = LICENSE
LIBSWIFTDISPATCH_INSTALL_STAGING = YES
Expand Down
2 changes: 1 addition & 1 deletion package/swift/swift.hash
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sha256 874c3b6668fb138db35c9f1c63570dafacac8476a6094b17764a51a45a1b69a2 swift-5.10.tar.gz
sha256 1489681860e92cee5ddd869a06531d7a1746b2f4ea105a2ff3b631ebcbcffd34 swift-6.0.2.tar.gz
27 changes: 20 additions & 7 deletions package/swift/swift.mk
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
### Apple's Swift Programming Language
SWIFT_VERSION = 5.10
SWIFT_SITE = $(call github,apple,swift,swift-$(SWIFT_VERSION)-RELEASE)
SWIFT_VERSION = 6.0.2
SWIFT_SITE = $(call github,swiftlang,swift,swift-$(SWIFT_VERSION)-RELEASE)
SWIFT_LICENSE = Apache-2.0
SWIFT_LICENSE_FILES = LICENSE.txt
SWIFT_TARGET_ARCH = $(call qstrip,$(BR2_PACKAGE_SWIFT_TARGET_ARCH))
Expand Down Expand Up @@ -65,6 +65,8 @@ $(SWIFTC_EXTRA_FLAGS) \
-sdk ${STAGING_DIR} \
"

SWIFT_STRING_PROCESSING_SRCDIR=$(SWIFT_BUILDDIR)/swift-experimental-string-processing-swift-$(SWIFT_VERSION)-RELEASE

SWIFT_CONF_OPTS = \
-DCMAKE_C_COMPILER=$(SWIFT_NATIVE_PATH)/clang \
-DCMAKE_CXX_COMPILER=$(SWIFT_NATIVE_PATH)/clang++ \
Expand All @@ -85,23 +87,27 @@ SWIFT_CONF_OPTS = \
-DSWIFT_BUILD_REMOTE_MIRROR=OFF \
-DSWIFT_BUILD_SOURCEKIT=OFF \
-DSWIFT_BUILD_STDLIB_EXTRA_TOOLCHAIN_CONTENT=OFF \
-DSWIFT_BUILD_SYNTAXPARSERLIB=OFF \
-DSWIFT_ENABLE_SOURCEKIT_TESTS=OFF \
-DSWIFT_INCLUDE_DOCS=OFF \
-DSWIFT_INCLUDE_TOOLS=OFF \
-DSWIFT_INCLUDE_TESTS=OFF \
-DSWIFT_HOST_VARIANT_ARCH=${SWIFT_TARGET_ARCH} \
-DSWIFT_SDKS=LINUX \
-DSWIFT_SDK_LINUX_ARCH_${SWIFT_TARGET_ARCH}_PATH=${STAGING_DIR} \
-DSWIFT_SDK_LINUX_ARCH_${SWIFT_TARGET_ARCH}_LIBC_INCLUDE_DIRECTORY=${STAGING_DIR}/usr/include \
-DSWIFT_PATH_TO_LIBDISPATCH_SOURCE=${LIBDISPATCH_SRCDIR} \
-DSWIFT_ENABLE_EXPERIMENTAL_CONCURRENCY=ON \
-DSWIFT_ENABLE_EXPERIMENTAL_STRING_PROCESSING=ON \
-DSWIFT_PATH_TO_STRING_PROCESSING_SOURCE=${SWIFT_STRING_PROCESSING_SRCDIR} \
-DSWIFT_ENABLE_EXPERIMENTAL_CXX_INTEROP=OFF \
-DSWIFT_ENABLE_CXX_INTEROP_SWIFT_BRIDGING_HEADER=OFF \
-DSWIFT_BUILD_STDLIB_CXX_MODULE=OFF \
-DSWIFT_ENABLE_EXPERIMENTAL_DIFFERENTIABLE_PROGRAMMING=ON \
-DSWIFT_ENABLE_EXPERIMENTAL_DISTRIBUTED=ON \
-DSWIFT_ENABLE_EXPERIMENTAL_NONESCAPABLE_TYPES=ON \
-DSWIFT_ENABLE_EXPERIMENTAL_OBSERVATION=ON \
-DSWIFT_ENABLE_SYNCHRONIZATION=ON \
-DSWIFT_INCLUDE_TESTS=OFF \
-DSWIFT_INCLUDE_TEST_BINARIES=OFF \
-DSWIFT_BUILD_TEST_SUPPORT_MODULES=OFF \
-DSWIFT_BUILD_TEST_SUPPORT_MODULES=OFF \
-DZLIB_LIBRARY=$(STAGING_DIR)/usr/lib/libz.so \

ifeq ($(SWIFT_TARGET_ARCH),armv7)
Expand Down Expand Up @@ -150,6 +156,13 @@ else
endif

define SWIFT_CONFIGURE_CMDS
# Fetch Swift string processing sources
(mkdir -p $(SWIFT_BUILDDIR) && \
cd $(SWIFT_BUILDDIR) && \
wget https://github.com/swiftlang/swift-experimental-string-processing/archive/refs/tags/swift-${SWIFT_VERSION}-RELEASE.tar.gz && \
tar -xvf swift-${SWIFT_VERSION}-RELEASE.tar.gz && \
rm -rf swift-${SWIFT_VERSION}-RELEASE.tar.gz \
)
# Configure for Ninja
(mkdir -p $(SWIFT_BUILDDIR) && \
cd $(SWIFT_BUILDDIR) && \
Expand Down Expand Up @@ -183,7 +196,7 @@ define SWIFT_INSTALL_STAGING_CMDS
rm $(SWIFT_BUILDDIR)/lib/swift/linux/libstdcxx.modulemap
endef

HOST_SWIFT_SUPPORT_DIR=$(HOST_DIR)/usr/share/swift
HOST_SWIFT_SUPPORT_DIR = $(HOST_DIR)/usr/share/swift
SWIFT_DESTINATION_FILE = $(HOST_SWIFT_SUPPORT_DIR)/toolchain.json

define HOST_SWIFT_INSTALL_CMDS
Expand Down
2 changes: 1 addition & 1 deletion package/xctest/xctest.hash
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sha256 b298316185270ac43ecdaf4c2fbd4329af51a18b174650510d7526238e9ca6fa xctest-5.10.tar.gz
sha256 b298316185270ac43ecdaf4c2fbd4329af51a18b174650510d7526238e9ca6fa xctest-6.0.2.tar.gz
4 changes: 2 additions & 2 deletions package/xctest/xctest.mk
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
### XCTest
XCTEST_VERSION = 5.10
XCTEST_SITE = $(call github,apple,swift-corelibs-xctest,swift-$(XCTEST_VERSION)-RELEASE)
XCTEST_VERSION = 6.0.2
XCTEST_SITE = $(call github,swiftlang,swift-corelibs-xctest,swift-$(XCTEST_VERSION)-RELEASE)
XCTEST_LICENSE = Apache-2.0
XCTEST_LICENSE_FILES = LICENSE
XCTEST_INSTALL_STAGING = YES
Expand Down

0 comments on commit 4d4d8b6

Please sign in to comment.