Skip to content

Commit 7aa050d

Browse files
authored
[6.2] CMake: make the libswiftCompatibilitySpan symlink relative symlink (#84201)
- **Explanation**: create the symlink from libswiftCompatibilitySpan.dylib to libswiftCore.dylib in the Swift build folder as a relative one instead of an absolute one, to support device testing. - **Scope**: CMake code that creates the symlink for libswiftCompatibilitySpan.dylib during builds - **Issues**: rdar://159314722 - **Original PRs**: #84200 - **Risk**: Low, scope is limited to configurations that run tests on a machine different form the builder, regular CI tests are not affected (since symlinks are valid on the builder itself), and packaging regenerates the symlink with a different mechanism. - **Testing**: ensured at desk that `stdlib/Span` test can run on a different machine (i.e. using `remote-run`) - **Reviewers**: waiting for reviews in the main PR
1 parent 04ed960 commit 7aa050d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

stdlib/public/core/CMakeLists.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -466,15 +466,15 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
466466
foreach(sdk ${SWIFT_SDKS})
467467
set(lib_dir "${SWIFT_SDK_${sdk}_LIB_SUBDIR}")
468468
set(lib_path "${SWIFTLIB_DIR}/${lib_dir}")
469-
set(compat_lib_name "${lib_path}/libswiftCompatibilitySpan.dylib")
470469

471470
# This doesn't depend on libswiftCore.dylib because we don't actually need
472471
# for it to exist to create the symlink, nor is there any need to recreate
473472
# the symlink if the dylib changes.
474473
add_custom_command_target(unused_var
475474
CUSTOM_TARGET_NAME "swiftCompatibilitySpan-symlink-${lib_dir}"
476-
OUTPUT "${compat_lib_name}"
477-
COMMAND ${CMAKE_COMMAND} "-E" "create_symlink" "${lib_path}/libswiftCore.dylib" "${compat_lib_name}")
475+
OUTPUT "${lib_path}/libswiftCompatibilitySpan.dylib"
476+
COMMAND ${CMAKE_COMMAND} "-E" "create_symlink" "libswiftCore.dylib" "libswiftCompatibilitySpan.dylib"
477+
WORKING_DIRECTORY ${lib_path})
478478
foreach(ARCH ${SWIFT_SDK_${sdk}_ARCHITECTURES})
479479
add_dependencies("swiftCore-${lib_dir}-${ARCH}" "swiftCompatibilitySpan-symlink-${lib_dir}")
480480
endforeach()

0 commit comments

Comments
 (0)