Skip to content

Replace several (test-)tool binaries with symlinks to swift-frontend #65387

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 7 commits into from
Apr 25, 2023

Conversation

eeckstein
Copy link
Contributor

  • sil-opt
  • sil-func-extractor
  • sil-nm
  • sil-llvm-gen
  • sil-passpipeline-dumper
  • swift-dependency-tool
  • swift-llvm-opt

This saves build time and disk space.
It also makes those (test-) tools available wherever the compiler itself is available

rdar://76551283

@eeckstein eeckstein requested a review from artemcm as a code owner April 24, 2023 11:56
@eeckstein
Copy link
Contributor Author

@swift-ci smoke test

@eeckstein eeckstein requested a review from edymtt April 24, 2023 11:58
SOURCE "swift-frontend${CMAKE_EXECUTABLE_SUFFIX}"
DESTINATION "swift-llvm-opt${CMAKE_EXECUTABLE_SUFFIX}"
WORKING_DIRECTORY "${SWIFT_RUNTIME_OUTPUT_INTDIR}")

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We would need to add the commands to install the symlinks, so that we don't drop those in the final toolchains.

This is a possible snippet to apply at the end of the file, together with the other installation commands.

Suggested change
swift_install_in_component(FILES "${SWIFT_RUNTIME_OUTPUT_INTDIR}/sil-opt${CMAKE_EXECUTABLE_SUFFIX}"
DESTINATION "bin"
COMPONENT tools)
swift_install_in_component(FILES "${SWIFT_RUNTIME_OUTPUT_INTDIR}/sil-func-extractor${CMAKE_EXECUTABLE_SUFFIX}"
DESTINATION "bin"
COMPONENT tools)
swift_install_in_component(FILES "${SWIFT_RUNTIME_OUTPUT_INTDIR}/sil-nm${CMAKE_EXECUTABLE_SUFFIX}"
DESTINATION "bin"
COMPONENT tools)
swift_install_in_component(FILES "${SWIFT_RUNTIME_OUTPUT_INTDIR}/sil-llvm-gen${CMAKE_EXECUTABLE_SUFFIX}"
DESTINATION "bin"
COMPONENT tools)
swift_install_in_component(FILES "${SWIFT_RUNTIME_OUTPUT_INTDIR}/sil-passpipeline-dumper${CMAKE_EXECUTABLE_SUFFIX}"
DESTINATION "bin"
COMPONENT testsuite-tools)
swift_install_in_component(FILES "${SWIFT_RUNTIME_OUTPUT_INTDIR}/swift-dependency-tool${CMAKE_EXECUTABLE_SUFFIX}"
DESTINATION "bin"
COMPONENT tools)
swift_install_in_component(FILES "${SWIFT_RUNTIME_OUTPUT_INTDIR}/swift-llvm-opt${CMAKE_EXECUTABLE_SUFFIX}"
DESTINATION "bin"
COMPONENT tools)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(please double check I got the components right)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@edymtt It's not the intention of this PR to install the symlinks. We can decide later if we want this.
If someone (a compiler engineer) needs such a tool in an installed toolchain he/she can easily create the symlink.

@eeckstein eeckstein merged commit f5ac037 into swiftlang:main Apr 25, 2023
@eeckstein eeckstein deleted the symlink-tools branch April 25, 2023 07:09
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.

2 participants