Skip to content

Run Command: Add SwiftBuild repl support #8971

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

bkhouri
Copy link
Contributor

@bkhouri bkhouri commented Jul 25, 2025

The swift run --repl was explicitly using the Native build system. This change modified the swift run --repl command to respect the --build-system <arg> command line option. The change introduces a new build output request replArguments. When provided, the build system is responsible for providing the arguments required for the REPL in the
BuildResult.

The Swift Run Command will inspect the build result for this property. If it's unavailable, the command provides an error indicating repl support is unavailable.

A caveat, more work is required to get proper REPL integration with the Package. At the moment, the System Library paths are not provided by the SwiftBuild System when a repl session is requested via the run command.

Relates to: #8846
issue: rdar://153822861

Depends on : #8942

@bkhouri
Copy link
Contributor Author

bkhouri commented Jul 25, 2025

@swift-ci test

@shahmishal
Copy link
Member

@swift-ci test

@bkhouri bkhouri force-pushed the t/main/gh8846_rdar153822861_support_swift_run_repl_with_swiftbuild branch from 88cb4e2 to 3f9e6ca Compare July 28, 2025 13:32
@bkhouri
Copy link
Contributor Author

bkhouri commented Jul 28, 2025

@swift-ci test

@bkhouri
Copy link
Contributor Author

bkhouri commented Jul 28, 2025

@swift-ci test windows

@bkhouri bkhouri marked this pull request as ready for review July 29, 2025 14:47
@bkhouri bkhouri enabled auto-merge (squash) July 29, 2025 19:56
bkhouri added 2 commits July 30, 2025 12:51
The `swift run --repl` was explicitely using the Native build system.
This change modified the `swift run --repl` command to respect the
`--build-system <arg>` command line option.  The change introduces a new
build output request `replArguments`.  When provided, the build system
is responsible for providing the arguments required for the REPL in the
BuildResult.

The Swift Run Command will inspect the build repsult for this property.
If it's unavailable, the command provides an error indicating repl
support is unavailable.

A caveat, more work is required to get proper REPL integation with the
Package.  At the moment, the System Library paths are not provided by
the SwiftBuild System when a repl session is requested via the `run`
command.

Relates to: swiftlang#8846
issue: rdar://153822861
@bkhouri bkhouri force-pushed the t/main/gh8846_rdar153822861_support_swift_run_repl_with_swiftbuild branch from 3f9e6ca to f0d1b7f Compare July 30, 2025 16:56
@bkhouri
Copy link
Contributor Author

bkhouri commented Jul 30, 2025

@swift-ci test

@bkhouri bkhouri requested a review from owenv July 30, 2025 16:57
@bkhouri
Copy link
Contributor Author

bkhouri commented Jul 30, 2025

@swift-ci test windows

@bkhouri bkhouri merged commit 3fbec0b into swiftlang:main Jul 31, 2025
6 checks passed
@bkhouri bkhouri deleted the t/main/gh8846_rdar153822861_support_swift_run_repl_with_swiftbuild branch July 31, 2025 15:21
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