Skip to content

Commit 48b348d

Browse files
committed
Build trunk from last tag and centralize cmake variable
1 parent e2f696a commit 48b348d

File tree

4 files changed

+16
-87
lines changed

4 files changed

+16
-87
lines changed

.github/workflows/pull_request.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,6 @@ jobs:
3232
build-type: 'docker'
3333
build-compiler: '1'
3434
runner: 'self-hosted'
35-
- swift-version: 'development'
36-
build-type: 'docker'
37-
build-compiler: '1'
38-
runner: 'self-hosted'
3935
- swift-version: 'swift-6.2-branch'
4036
build-type: 'docker'
4137
build-compiler: '0'

swift-ci/sdks/android/build-docker

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,11 @@ HOST_OS=ubuntu24.04
2626
source ./scripts/toolchain-vars.sh
2727

2828
# Check-out and patch the sources
29-
if [[ "${BUILD_COMPILER}" != "1" ]]; then
29+
if [[ "${BUILD_COMPILER}" != "1" ]] || [[ "${BUILD_SCHEME}" == "development" ]]; then
3030
./scripts/fetch-source.sh --source-dir ${WORKDIR}/source --swift-tag ${SWIFT_TAG}
3131
else
32-
if [[ "${BUILD_SCHEME}" == "development" ]]; then
33-
./scripts/fetch-source.sh --source-dir ${WORKDIR}/source --swift-scheme main
34-
else
3532
./scripts/fetch-source.sh --source-dir ${WORKDIR}/source --swift-scheme release/6.2
3633
fi
37-
fi
3834
./patches/apply-patches.sh ${WORKDIR}/source/swift-project
3935

4036
mkdir -p ${WORKDIR}/products

swift-ci/sdks/android/patches/swift-android-trunk-libdispatch.patch

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -28,21 +28,6 @@ index 9a0f5b43e2d..5c7d1320a2d 100644
2828

2929
toolchain_path = product.native_toolchain_path(args.host_target)
3030
cmake_swiftc_path = os.getenv('CMAKE_Swift_COMPILER',
31-
diff --git a/swift-corelibs-libdispatch/cmake/modules/SwiftSupport.cmake b/swift-corelibs-libdispatch/cmake/modules/SwiftSupport.cmake
32-
index 3da519e..e2dd8ed 100644
33-
--- a/swift-corelibs-libdispatch/cmake/modules/SwiftSupport.cmake
34-
+++ b/swift-corelibs-libdispatch/cmake/modules/SwiftSupport.cmake
35-
@@ -4,6 +4,10 @@ if(NOT dispatch_MODULE_TRIPLE)
36-
set(module_triple_command "${CMAKE_Swift_COMPILER}" -print-target-info)
37-
if(CMAKE_Swift_COMPILER_TARGET)
38-
list(APPEND module_triple_command -target ${CMAKE_Swift_COMPILER_TARGET})
39-
+ else()
40-
+ set(arg_list ${CMAKE_Swift_FLAGS})
41-
+ separate_arguments(arg_list)
42-
+ list(APPEND module_triple_command ${arg_list})
43-
endif()
44-
execute_process(COMMAND ${module_triple_command} OUTPUT_VARIABLE target_info_json)
45-
4631
diff --git a/swift-corelibs-libdispatch/src/swift/CMakeLists.txt b/swift-corelibs-libdispatch/src/swift/CMakeLists.txt
4732
index 38bef37..d0ddf98 100644
4833
--- a/swift-corelibs-libdispatch/src/swift/CMakeLists.txt

swift-ci/sdks/android/patches/swift-android.patch

Lines changed: 15 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,16 @@ diff --git a/swift/utils/build-script-impl b/swift/utils/build-script-impl
2626
index 16e05052609..7ab8cebfab8 100755
2727
--- a/swift/utils/build-script-impl
2828
+++ b/swift/utils/build-script-impl
29+
@@ -828,6 +828,9 @@ function set_build_options_for_host() {
30+
# and it must be the same for both LLVM and Swift
31+
32+
if [[ "${SWIFT_HOST_TRIPLE}" ]] ; then
33+
+ SWIFT_TARGET_CMAKE_OPTIONS+=(
34+
+ -DCMAKE_Swift_COMPILER_TARGET:STRING="${SWIFT_HOST_TRIPLE}"
35+
+ )
36+
llvm_cmake_options+=(
37+
-DLLVM_HOST_TRIPLE:STRING="${SWIFT_HOST_TRIPLE}"
38+
)
2939
@@ -2622,6 +2622,7 @@ for host in "${ALL_HOSTS[@]}"; do
3040
echo "Cleaning the libdispatch build directory"
3141
call rm -rf "${LIBDISPATCH_BUILD_DIR}"
@@ -48,15 +58,16 @@ index 324d1a77eea..e88601a8701 100644
4858

4959
from . import cmake_product
5060
from . import product
51-
@@ -115,6 +117,22 @@ class SwiftTestingCMakeShim(cmake_product.CMakeProduct):
61+
@@ -115,6 +117,24 @@ class SwiftTestingCMakeShim(cmake_product.CMakeProduct):
5262
# FIXME: If we build macros for the builder, specify the path.
5363
self.cmake_options.define('SwiftTesting_MACRO', 'NO')
5464

5565
+ if host_target.startswith('android') and self.is_cross_compile_target(host_target):
5666
+ host_config = HostSpecificConfiguration(host_target, self.args)
5767
+ self.cmake_options.extend(host_config.cmake_options)
58-
+ flags = '-target %s-unknown-linux-android%s ' % (self.args.android_arch,
59-
+ self.args.android_api_level)
68+
+ triple = '%s-unknown-linux-android%s' % (self.args.android_arch,
69+
+ self.args.android_api_level)
70+
+ flags = '-target %s ' % (triple)
6071
+
6172
+ flags += '-resource-dir %s/lib/swift ' % (
6273
+ self.host_install_destdir(host_target) + self.args.install_prefix)
@@ -65,6 +76,7 @@ index 324d1a77eea..e88601a8701 100644
6576
+ flags += '-sdk %s/sysroot ' % (ndk_path)
6677
+ flags += '-tools-directory %s/bin' % (ndk_path)
6778
+ self.cmake_options.define('CMAKE_Swift_FLAGS', flags)
79+
+ self.cmake_options.define('CMAKE_Swift_COMPILER_TARGET', triple)
6880
+ self.cmake_options.define('CMAKE_CXX_COMPILER_WORKS', 'True')
6981
+ self.cmake_options.define('CMAKE_FIND_ROOT_PATH', self.args.cross_compile_deps_path)
7082
+
@@ -83,36 +95,6 @@ index 7f290d16..95366592 100644
8395
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
8496
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
8597
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
86-
diff --git a/swift-corelibs-xctest/cmake/modules/PlatformInfo.cmake b/swift-corelibs-xctest/cmake/modules/PlatformInfo.cmake
87-
index 468dc61..a90ae3d 100644
88-
--- a/swift-corelibs-xctest/cmake/modules/PlatformInfo.cmake
89-
+++ b/swift-corelibs-xctest/cmake/modules/PlatformInfo.cmake
90-
@@ -2,6 +2,10 @@
91-
set(print_target_info_invocation "${CMAKE_Swift_COMPILER}" -print-target-info)
92-
if(CMAKE_Swift_COMPILER_TARGET)
93-
list(APPEND print_target_info_invocation -target ${CMAKE_Swift_COMPILER_TARGET})
94-
+else()
95-
+ set(arg_list ${CMAKE_Swift_FLAGS})
96-
+ separate_arguments(arg_list)
97-
+ list(APPEND print_target_info_invocation ${arg_list})
98-
endif()
99-
execute_process(COMMAND ${print_target_info_invocation} OUTPUT_VARIABLE target_info_json)
100-
message(CONFIGURE_LOG "Swift Target Info: ${print_target_info_invocation}\n"
101-
diff --git a/swift-foundation/cmake/modules/SwiftFoundationSwiftSupport.cmake b/swift-foundation/cmake/modules/SwiftFoundationSwiftSupport.cmake
102-
index cbdfc2a..bb4121d 100644
103-
--- a/swift-foundation/cmake/modules/SwiftFoundationSwiftSupport.cmake
104-
+++ b/swift-foundation/cmake/modules/SwiftFoundationSwiftSupport.cmake
105-
@@ -37,6 +37,10 @@ function(_swift_foundation_install_target module)
106-
set(module_triple_command "${CMAKE_Swift_COMPILER}" -print-target-info)
107-
if(CMAKE_Swift_COMPILER_TARGET)
108-
list(APPEND module_triple_command -target ${CMAKE_Swift_COMPILER_TARGET})
109-
+ else()
110-
+ set(arg_list ${CMAKE_Swift_FLAGS})
111-
+ separate_arguments(arg_list)
112-
+ list(APPEND module_triple_command ${arg_list})
113-
endif()
114-
execute_process(COMMAND ${module_triple_command} OUTPUT_VARIABLE target_info_json)
115-
string(JSON module_triple GET "${target_info_json}" "target" "moduleTriple")
11698
diff --git a/swift-testing/CMakeLists.txt b/swift-testing/CMakeLists.txt
11799
index 1be9a4b..bd7b1bd 100644
118100
--- a/swift-testing/CMakeLists.txt
@@ -125,33 +107,3 @@ index 1be9a4b..bd7b1bd 100644
125107
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
126108
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
127109
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
128-
diff --git a/swift-testing/cmake/modules/PlatformInfo.cmake b/swift-testing/cmake/modules/PlatformInfo.cmake
129-
index 94c60ef..ab8a491 100644
130-
--- a/swift-testing/cmake/modules/PlatformInfo.cmake
131-
+++ b/swift-testing/cmake/modules/PlatformInfo.cmake
132-
@@ -9,6 +9,10 @@
133-
set(print_target_info_invocation "${CMAKE_Swift_COMPILER}" -print-target-info)
134-
if(CMAKE_Swift_COMPILER_TARGET)
135-
list(APPEND print_target_info_invocation -target ${CMAKE_Swift_COMPILER_TARGET})
136-
+else()
137-
+ set(arg_list ${CMAKE_Swift_FLAGS})
138-
+ separate_arguments(arg_list)
139-
+ list(APPEND print_target_info_invocation ${arg_list})
140-
endif()
141-
execute_process(COMMAND ${print_target_info_invocation} OUTPUT_VARIABLE target_info_json)
142-
message(CONFIGURE_LOG "Swift Target Info: ${print_target_info_invocation}\n"
143-
diff --git a/swift-testing/cmake/modules/TargetTriple.cmake b/swift-testing/cmake/modules/TargetTriple.cmake
144-
index e087cc4..02f3a95 100644
145-
--- a/swift-testing/cmake/modules/TargetTriple.cmake
146-
+++ b/swift-testing/cmake/modules/TargetTriple.cmake
147-
@@ -10,6 +10,10 @@
148-
set(SWT_TARGET_INFO_COMMAND "${CMAKE_Swift_COMPILER}" -print-target-info)
149-
if(CMAKE_Swift_COMPILER_TARGET)
150-
list(APPEND SWT_TARGET_INFO_COMMAND -target ${CMAKE_Swift_COMPILER_TARGET})
151-
+else()
152-
+ set(arg_list ${CMAKE_Swift_FLAGS})
153-
+ separate_arguments(arg_list)
154-
+ list(APPEND SWT_TARGET_INFO_COMMAND ${arg_list})
155-
endif()
156-
execute_process(COMMAND ${SWT_TARGET_INFO_COMMAND} OUTPUT_VARIABLE SWT_TARGET_INFO_JSON)
157-
string(JSON SWT_TARGET_TRIPLE GET "${SWT_TARGET_INFO_JSON}" "target" "unversionedTriple")

0 commit comments

Comments
 (0)