-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Configure the swiftImageInspectionShared to generate arch & sdk specific directories #16191
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
Conversation
@compnerd This should let me pull in the library paths changes. |
stdlib/public/runtime/CMakeLists.txt
Outdated
add_custom_command_target(swift_image_inspection_${arch}_static | ||
COMMAND | ||
"${CMAKE_COMMAND}" -E copy | ||
"${SWIFT_BINARY_DIR}/lib/swift/${lowercase_sdk}/${arch}/libswiftImageInspectionShared.a" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you see if you can get away with a generator expression?
set(FragileSupportLibrary swiftImageInspectionShared-${SWIFT_SDK_${sdk}_LIB_SUBDIR}-${arch})
set(LibraryLocation ${SWIFTSTATICLIBRARY_DIR}/${lowercase_sdk}/${arch})
add_custom_command_target(swift_image_inspection_${arch}_static
COMMAND
"${CMAKE_COMMAND} -E copy $<TARGET_FILE:${FragileSupportLibrary}> ${LibraryLocation}
...
stdlib/public/runtime/CMakeLists.txt
Outdated
${FragileSupportLibraryPrimary}) | ||
swift_install_in_component(stdlib | ||
FILES $<TARGET_FILE:swift_image_inspection_static_primary_arch> | ||
DESTINATION "lib/swift_static/${lowercase_sdk}") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't the previous for loop cover this already?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a temporary addition to put it at lib/swift_static/linux/libswiftImageInspectionShared.a
since the compiler adds this as the linker path on master. The above loop puts them at lib/swift_static/linux/x86_64
.
One of the PRs on top of this removes the code that does things for non-arch specific paths.
@swift-ci please test |
Build failed |
Build failed |
CI system error -_- |
@compnerd this was an error with Swift's CI |
@swift-ci please test |
Build failed |
@compnerd please test |
stdlib/public/runtime/CMakeLists.txt
Outdated
COMMAND | ||
"${CMAKE_COMMAND}" -E copy $<TARGET_FILE:${FragileSupportLibraryPrimary}> ${LibraryLocationPrimary} | ||
OUTPUT | ||
"${LibraryLocationPrimary}/libswiftImageInspectionShared.a" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"${LibraryLocationPrimary}/${CMAKE_STATIC_LIBRARY_PREFIX}swiftImageInspectionShared${CMAKE_STATIC_LIBRARY_SUFFIX}"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Technically correct, but it is wrapped within if("${sdk}" STREQUAL "LINUX")
.
stdlib/public/runtime/CMakeLists.txt
Outdated
COMMAND | ||
"${CMAKE_COMMAND}" -E copy $<TARGET_FILE:${FragileSupportLibrary}> ${LibraryLocation} | ||
OUTPUT | ||
"${LibraryLocation}/libswiftImageInspectionShared.a" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"${LibraryLocation}/${CMAKE_STATIC_LIBRARY_PREFIX}swiftImageInspectionShared${CMAKE_STATIC_LIBRARY_SUFFIX}"
…fic libraries Previously, swiftImageInspectionShared generated one specific library at `lib/libswiftImageInspectionShared.a` for only the main arch and sdk. Generic cross compilation and various changes to the build system to get cross compilation to work will require swiftImageInspectionShared to generate libraries at the proper subdirectory. Change the outputs to agree with paths such as `lib/swift/linux/x86_64`
@compnerd please test |
@swift-ci please test |
Build failed |
Previously, swiftImageInspectionShared generated one specific library at
lib/libswiftImageInspectionShared.a
for only the main arch and sdk.Generic cross compilation and various changes to the build system to get
cross compilation to work will require swiftImageInspectionShared to
generate libraries at the proper subdirectory. Change the outputs to
agree with paths such as
lib/swift/linux/x86_64
Some ugly workarounds had to be used due to
add_swift_library
being invoked withIS_STDLIB
causing circular shared object dependencies withSwiftImageInspectionShared
. Thus the libraries had to be manually copied to`swift_static.The copy/pasting from
lib/swift/linux/libswiftImageInspectionShared.a
to ../swift_static/..` will be removed in an upcoming PR as it will no longer be needed.