Skip to content

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

Closed
wants to merge 1 commit into from
Closed

Conversation

lanza
Copy link
Contributor

@lanza lanza commented Apr 26, 2018

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 with IS_STDLIB causing circular shared object dependencies with SwiftImageInspectionShared. 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.

@lanza
Copy link
Contributor Author

lanza commented Apr 26, 2018

@compnerd This should let me pull in the library paths changes.

add_custom_command_target(swift_image_inspection_${arch}_static
COMMAND
"${CMAKE_COMMAND}" -E copy
"${SWIFT_BINARY_DIR}/lib/swift/${lowercase_sdk}/${arch}/libswiftImageInspectionShared.a"
Copy link
Member

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}
...

${FragileSupportLibraryPrimary})
swift_install_in_component(stdlib
FILES $<TARGET_FILE:swift_image_inspection_static_primary_arch>
DESTINATION "lib/swift_static/${lowercase_sdk}")
Copy link
Member

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?

Copy link
Contributor Author

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.

@compnerd
Copy link
Member

@swift-ci please test

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - 4e223ab244a06bff877017929135ca9ffa6ab686

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - f50060456e8e5c93b851a47931db14b48e6783cf

@lanza
Copy link
Contributor Author

lanza commented Apr 30, 2018

CI system error -_-

@lanza
Copy link
Contributor Author

lanza commented May 1, 2018

@compnerd this was an error with Swift's CI

@compnerd
Copy link
Member

compnerd commented May 2, 2018

@swift-ci please test

@swift-ci
Copy link
Contributor

swift-ci commented May 2, 2018

Build failed
Swift Test Linux Platform
Git Sha - f50060456e8e5c93b851a47931db14b48e6783cf

@lanza
Copy link
Contributor Author

lanza commented May 2, 2018

@compnerd please test

COMMAND
"${CMAKE_COMMAND}" -E copy $<TARGET_FILE:${FragileSupportLibraryPrimary}> ${LibraryLocationPrimary}
OUTPUT
"${LibraryLocationPrimary}/libswiftImageInspectionShared.a"
Copy link
Member

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}"

Copy link
Contributor Author

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").

COMMAND
"${CMAKE_COMMAND}" -E copy $<TARGET_FILE:${FragileSupportLibrary}> ${LibraryLocation}
OUTPUT
"${LibraryLocation}/libswiftImageInspectionShared.a"
Copy link
Member

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`
@lanza
Copy link
Contributor Author

lanza commented May 3, 2018

@compnerd please test

@compnerd
Copy link
Member

compnerd commented May 4, 2018

@swift-ci please test

@swift-ci
Copy link
Contributor

swift-ci commented May 4, 2018

Build failed
Swift Test Linux Platform
Git Sha - f50060456e8e5c93b851a47931db14b48e6783cf

@lanza lanza closed this May 4, 2018
@lanza lanza deleted the inspect-arch-sdk branch July 5, 2018 21:25
@lanza lanza restored the inspect-arch-sdk branch July 12, 2018 20:48
@lanza lanza deleted the inspect-arch-sdk branch July 12, 2018 20:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants