Skip to content

Link swift-ide-test against the new (early)swift-driver and exercise its getSingleFrontendInvocationFromDriverArguments C API #75840

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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

artemcm
Copy link
Contributor

@artemcm artemcm commented Aug 12, 2024

This lays the groundwork for what it takes to start using the new driver's C API from compiler products such as SourceKit
Using: swiftlang/swift-driver#1679

@artemcm artemcm force-pushed the NewDriverTooling branch 3 times, most recently from f9b24d1 to 28a7f4f Compare September 10, 2024 17:38
@artemcm artemcm force-pushed the NewDriverTooling branch 5 times, most recently from a76378a to 2bceadb Compare September 17, 2024 23:30
@artemcm artemcm changed the title [DNM] Test linking swift-ide-test against earlyswiftdriver and using its tooling library Link swift-ide-test against the new (early)swift-driver and exercise its getSingleFrontendInvocationFromDriverArguments C API Sep 17, 2024
@artemcm
Copy link
Contributor Author

artemcm commented Sep 17, 2024

1 similar comment
@artemcm
Copy link
Contributor Author

artemcm commented Sep 18, 2024

@artemcm
Copy link
Contributor Author

artemcm commented Sep 20, 2024

@swift-ci test

1 similar comment
@artemcm
Copy link
Contributor Author

artemcm commented Oct 7, 2024

@swift-ci test

@artemcm
Copy link
Contributor Author

artemcm commented Oct 23, 2024

@swift-ci test

@artemcm
Copy link
Contributor Author

artemcm commented Oct 23, 2024

@swift-ci test

1 similar comment
@artemcm
Copy link
Contributor Author

artemcm commented Oct 24, 2024

@swift-ci test

@artemcm artemcm force-pushed the NewDriverTooling branch from 400e9eb to 10b66da Compare June 24, 2025 18:28
@artemcm
Copy link
Contributor Author

artemcm commented Jun 24, 2025

@swift-ci test

artemcm and others added 4 commits July 18, 2025 20:50
…e its 'getSingleFrontendInvocationFromDriverArguments' API

This lays the groundwork for what it takes to start using the new driver's C API from compiler products such as SourceKit
…id conflict with the new driver's corresponding entry
…tionFromDriverArgumentsV3`

This is the most recent version of the API.
To function properly in "in-process" mode `swift-driver` requires
all swift scanner symbols to be present in the binary to be discoverable
by dlsym.
@xedin xedin force-pushed the NewDriverTooling branch from 10b66da to ff94c64 Compare July 22, 2025 18:03
@xedin
Copy link
Contributor

xedin commented Jul 22, 2025

@swift-ci please test

@artemcm artemcm marked this pull request as ready for review July 22, 2025 18:11
@artemcm artemcm requested a review from tshortli as a code owner July 22, 2025 18:11
@xedin
Copy link
Contributor

xedin commented Jul 22, 2025

@swift-ci please test Windows platform

Comment on lines +17 to +19
set(SwiftDriver_DIR
"${CMAKE_BINARY_DIR}/../earlyswiftdriver-${SWIFT_HOST_VARIANT}-${SWIFT_HOST_VARIANT_ARCH}/${driver_package_configuration_dir}/cmake/modules/")
set(TSC_DIR "${CMAKE_BINARY_DIR}/../earlyswiftdriver-${SWIFT_HOST_VARIANT}-${SWIFT_HOST_VARIANT_ARCH}/${driver_package_configuration_dir}/dependencies/swift-tools-support-core/cmake/modules/")
Copy link
Contributor

Choose a reason for hiding this comment

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

I believe we have SWIFT_EARLY_SWIFT_DRIVER_BUILD already so you could use that. But I'd also do a check here for if SwiftDriver_DIR and TSC_DIR are already set.

Have we thought much about using FetchContent for the early swift driver (similar to swift-syntax)? CC @compnerd @etcwilde

Copy link
Member

Choose a reason for hiding this comment

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

Yeah, FetchContent or find_package should be what we use here instead of hard-coding these paths.

Copy link
Contributor

Choose a reason for hiding this comment

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

Well technically we are doing a find_package, just setting SwiftDriver_DIR beforehand 😅. We currently set SWIFT_EARLY_SWIFT_DRIVER_BUILD, I'm not entirely clear why we're not just setting SwiftDriver_DIR though?

Copy link
Contributor

Choose a reason for hiding this comment

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

Comment on lines +33 to +40
set_property(
TARGET swift-ide-test
APPEND PROPERTY INSTALL_RPATH "${CMAKE_BINARY_DIR}/../earlyswiftdriver-${SWIFT_HOST_VARIANT}-${SWIFT_HOST_VARIANT_ARCH}/${driver_package_configuration_dir}/lib/"
)
set_property(
TARGET swift-ide-test
APPEND PROPERTY INSTALL_RPATH "${CMAKE_BINARY_DIR}/../earlyswiftdriver-${SWIFT_HOST_VARIANT}-${SWIFT_HOST_VARIANT_ARCH}/${driver_package_configuration_dir}/dependencies/swift-tools-support-core/lib/"
)
Copy link
Contributor

Choose a reason for hiding this comment

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

Definitely don't want an absolute INSTALL_RPATH. I would have also thought that this isn't needed regardless - the lib to be in the same place as swift-syntax, which is already on the rpath.

@xedin xedin force-pushed the NewDriverTooling branch from 8d2fc81 to ff94c64 Compare July 22, 2025 22:14
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.

4 participants