Skip to content

Several changes in build-script-helper.py to support building indexstore-db in a unified build #154

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 8 commits into from
Aug 4, 2022

Conversation

ahoppen
Copy link
Member

@ahoppen ahoppen commented Jul 29, 2022

This contains the analogous changes from swiftlang/sourcekit-lsp#597 as well as the following additional ones:

  • Add SWIFTCI_USE_LOCAL_DEPS=1 environment variable when invoking SwiftPM
    • So far, this has not been relevant because indexstore-db didn’t have any dependencies. Once we build indexstore-db in a unified SwiftPM the swift build invocation will also resolve Package.swift for the other packages in the unified build, which need this environment variable.

@ahoppen ahoppen force-pushed the pr/unified-build branch 5 times, most recently from b048385 to f1bdb6d Compare August 3, 2022 06:11
@ahoppen ahoppen changed the title WIP: Build indexstore-db in a unified build Several changes in build-script-helper.py to support building indexstore-db in a unified build Aug 3, 2022
@ahoppen ahoppen marked this pull request as ready for review August 3, 2022 06:13
@benlangmuir
Copy link
Contributor

This contains the analogous changes from apple/sourcekit-lsp#597 as well as the following additional ones:

  • Build all libraries as static libraries instead of auto

    • Otherwise, we can’t explicitly build these libraries by specifying e.g. --product IndexStoreDB. But we need to be able to request explicit builds once we build indexstore-db in a unified SwiftPM build.
    • I’m open to debate whether these should be .dynamic instead of .static but static libraries appear to work at the moment.

Since we don't "install" this product anywhere currently, how about we just use the test target instead? Then we can keep the main products 'auto'.

--product IndexStoreDBPackageTests

ahoppen added 8 commits August 3, 2022 19:08
AFAICT cleaning the build directory prior to building was done to work around a bug in SwiftPM at some point. I don’t think that it’s needed anymore.
When we build SourceKit-LSP in a unified SwiftPM workspace, a simple `swift build` invocation will build all products in the unified workspace (not just SourceKit-LSP products).
So far, this has not been relevant because indexstore-db didn’t have any dependencies. Once we build indexstore-db in a unified SwiftPM the `swift build` invocation will also resolve Package.swift for the other packages in the unified build, which need this environment variable.
`--build-path` has been deprectated in favor of `--scratch-path` in SwiftPM.
@ahoppen ahoppen merged commit c864719 into swiftlang:main Aug 4, 2022
@ahoppen ahoppen deleted the pr/unified-build branch August 4, 2022 07:24
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