Skip to content

[6.0] Add prepare for index experimental build argument #7638

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 3 commits into from
Jun 13, 2024

Conversation

bnbarham
Copy link
Contributor

@bnbarham bnbarham commented Jun 5, 2024

@bnbarham bnbarham requested a review from a team as a code owner June 5, 2024 17:12
@bnbarham bnbarham requested a review from dschaefer2 June 5, 2024 17:12
@bnbarham
Copy link
Contributor Author

bnbarham commented Jun 5, 2024

@swift-ci please test

@dschaefer2
Copy link
Member

The failure is a change to llbuildTargetName. Code should be

let targetName = target.target.getLLBuildTargetName(config: target.buildParameters.buildConfig)

@bnbarham
Copy link
Contributor Author

bnbarham commented Jun 5, 2024

Looks like we need to cherry-pick the cross compilation changes first 😅.

This will be used by sourcekit-lsp to build the swiftmodule files it
needs for indexing.

Adds experimental-prepare-for-indexing flag to swift build. Creates a
llbuild manifest specific for the prepare build that skips generating
object files and linking of those files and calls swiftc to only create
the swiftmodule as quickly as it can.

### Motivation:

To support background indexing in sourcekit-lsp, it will request a
prepare for index build to build the swiftmodule files it needs to do
indexing. This build should be minimal to ensure indexing is fast so it
can respond to language server requests that require the index as soon
as possible.

### Modifications:

- Add an experimental-prepare-for-indexing flag to the BuildOptions and
pass it around to every that needs it.
- Build a custom llbuild manifest so that only the commands necessary
are added to the prepare build
- Add a target property that also ensures tool builds required for the
prepare build are performed as usual.
- In SwiftTargetBuildDescription, pass compile options that put the
swift compiler in prepare "mode".
- Ensure object files and binaries are only generated for tools when in
prepare mode.

### Result:

Implements prepare build mode without affecting regular build mode.

(cherry picked from commit 7bd34cc)
…wiftlang#7627)

This allows the C module to be targeted directly with the --target
argument. It is a no-op however, since the output of C modules are not
required for indexing.

(cherry picked from commit 09efb06)
@bnbarham
Copy link
Contributor Author

@swift-ci please test

@dschaefer2
Copy link
Member

@swift-ci Please test Windows

@bnbarham bnbarham merged commit 1767f20 into swiftlang:release/6.0 Jun 13, 2024
5 checks passed
@bnbarham bnbarham deleted the cherry-prepare branch June 13, 2024 00:26
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