Skip to content

build-presets: enable testing of libswift bootstrapping on two CI bots #39718

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Oct 19, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -605,6 +605,13 @@ elseif(LIBSWIFT_BUILD_MODE STREQUAL "BOOTSTRAPPING" OR LIBSWIFT_BUILD_MODE STREQ
set(SWIFT_EXEC_FOR_LIBSWIFT "${SWIFT_NATIVE_SWIFT_TOOLS_PATH}/swiftc")
endif()

if(LIBSWIFT_BUILD_MODE STREQUAL "HOSTTOOLS" OR LIBSWIFT_BUILD_MODE STREQUAL "BOOTSTRAPPING-WITH-HOSTLIBS")
if(SWIFT_ENABLE_ARRAY_COW_CHECKS)
message(STATUS "array COW checks disabled when building libswift with host libraries")
set(SWIFT_ENABLE_ARRAY_COW_CHECKS FALSE)
endif()
endif()

# This setting causes all CMakeLists.txt to automatically have
# ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CURRENT_SOURCE_DIR} as an
# include_directories path. This is done for developer
Expand Down
4 changes: 2 additions & 2 deletions cmake/modules/AddSwift.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -910,7 +910,7 @@ function(add_swift_host_tool executable)

# At build time link against the built swift libraries from the
# previous bootstrapping stage.
get_bootstrapping_swift_lib_dir(bs_lib_dir "${bootstrapping}")
get_bootstrapping_swift_lib_dir(bs_lib_dir "${ASHT_BOOTSTRAPPING}")
target_link_directories(${executable} PRIVATE ${bs_lib_dir})

# At runtime link against the built swift libraries from the current
Expand Down Expand Up @@ -979,7 +979,7 @@ function(add_swift_host_tool executable)
elseif(LIBSWIFT_BUILD_MODE STREQUAL "BOOTSTRAPPING")
# At build time link against the built swift libraries from the
# previous bootstrapping stage.
get_bootstrapping_swift_lib_dir(bs_lib_dir "${bootstrapping}")
get_bootstrapping_swift_lib_dir(bs_lib_dir "${ASHT_BOOTSTRAPPING}")
target_link_directories(${executable} PRIVATE ${bs_lib_dir})

# At runtime link against the built swift libraries from the current
Expand Down
61 changes: 44 additions & 17 deletions stdlib/public/Platform/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,27 +20,54 @@ set(swiftDarwin_target_sdks ALL_APPLE_PLATFORMS)
if(SWIFT_FREESTANDING_FLAVOR STREQUAL "apple")
set(swiftDarwin_target_sdks ALL_APPLE_PLATFORMS FREESTANDING)
endif()
add_swift_target_library(swiftDarwin ${SWIFT_STDLIB_LIBRARY_BUILD_TYPES} IS_SDK_OVERLAY
${swift_platform_sources}
POSIXError.swift
MachError.swift

"${SWIFT_SOURCE_DIR}/stdlib/linker-support/magic-symbols-for-install-name.c"
set(swiftDarwin_common_options
IS_SDK_OVERLAY
${swift_platform_sources}
POSIXError.swift
MachError.swift

GYB_SOURCES
${swift_platform_gyb_sources}
Darwin.swift.gyb
"${SWIFT_SOURCE_DIR}/stdlib/linker-support/magic-symbols-for-install-name.c"

SWIFT_COMPILE_FLAGS
${SWIFT_RUNTIME_SWIFT_COMPILE_FLAGS}
${SWIFT_STANDARD_LIBRARY_SWIFT_FLAGS}
-Xfrontend -disable-objc-attr-requires-foundation-module
${swift_platform_compile_flags}
LINK_FLAGS "${SWIFT_RUNTIME_SWIFT_LINK_FLAGS}"
TARGET_SDKS "${swiftDarwin_target_sdks}"
INSTALL_IN_COMPONENT sdk-overlay
GYB_SOURCES
${swift_platform_gyb_sources}
Darwin.swift.gyb

DEPENDS ${darwin_depends})
SWIFT_COMPILE_FLAGS
${SWIFT_RUNTIME_SWIFT_COMPILE_FLAGS}
${SWIFT_STANDARD_LIBRARY_SWIFT_FLAGS}
-Xfrontend -disable-objc-attr-requires-foundation-module
${swift_platform_compile_flags}
LINK_FLAGS "${SWIFT_RUNTIME_SWIFT_LINK_FLAGS}"
DEPENDS ${darwin_depends})


if(${LIBSWIFT_BUILD_MODE} STREQUAL "BOOTSTRAPPING")

set(swiftDarwin_common_bootstrapping_options
${swiftDarwin_common_options}
SHARED
IS_STDLIB
SDK ${SWIFT_HOST_VARIANT_SDK}
ARCHITECTURE ${SWIFT_HOST_VARIANT_ARCH}
INSTALL_IN_COMPONENT "never_install")

add_swift_target_library_single(swiftDarwin-bootstrapping0 swiftDarwin
${swiftDarwin_common_bootstrapping_options}
BOOTSTRAPPING 0)

add_swift_target_library_single(swiftDarwin-bootstrapping1 swiftDarwin
${swiftDarwin_common_bootstrapping_options}
BOOTSTRAPPING 1)

add_dependencies(bootstrapping1-all swiftDarwin-bootstrapping1)
add_dependencies(bootstrapping0-all swiftDarwin-bootstrapping0)
endif()

add_swift_target_library(swiftDarwin ${SWIFT_STDLIB_LIBRARY_BUILD_TYPES}
${swiftDarwin_common_options}
TARGET_SDKS "${swiftDarwin_target_sdks}"
INSTALL_IN_COMPONENT sdk-overlay)

set(swiftGlibc_target_sdks ANDROID CYGWIN FREEBSD OPENBSD LINUX HAIKU)
if(SWIFT_FREESTANDING_FLAVOR STREQUAL "linux")
Expand Down
3 changes: 3 additions & 0 deletions utils/build-presets.ini
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@ skip-test-ios-host
skip-test-tvos-host
skip-test-watchos-host

libswift=bootstrapping-with-hostlibs

[preset: buildbot,tools=RA,stdlib=RD,test=non_executable]
mixin-preset=
Expand Down Expand Up @@ -371,6 +372,8 @@ install-swiftpm
install-swift-driver
install-libcxx

libswift=bootstrapping

[preset: buildbot_incremental,tools=RA,stdlib=RA,apple_silicon]
mixin-preset=buildbot_incremental,tools=RA,stdlib=RA

Expand Down