Skip to content

Clean up non-core commands #5917

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 1 commit into from
Dec 1, 2022
Merged

Clean up non-core commands #5917

merged 1 commit into from
Dec 1, 2022

Conversation

neonichu
Copy link
Contributor

This separates out the collections and registry commands from the Commands module, allowing to simplify the first stage of bootstrap:

  • Moves the command implementations to new modules PackageCollectionsTool and PackageRegistryTool.
  • Adds a new multi-tool entry point executable swift-package-manager. This used to be included in swift-package, but that would render the separation moot and also seems like a better structure. For installation into the toolchain, we're simply installing the new executable under the name swift-package, so nothing changes there.
  • Remove package-collections related stuff from the CMake build, it was anyway completely unused.

@neonichu neonichu requested a review from abertelrud as a code owner November 18, 2022 20:51
@neonichu neonichu self-assigned this Nov 18, 2022
@neonichu neonichu requested review from tomerd and elsh as code owners November 18, 2022 20:51
@neonichu
Copy link
Contributor Author

@swift-ci please smoke test

@neonichu
Copy link
Contributor Author

@swift-ci please smoke test

@neonichu neonichu force-pushed the cleanup-non-core-commands branch from 3462cbd to 9eb4caa Compare November 18, 2022 21:05
@neonichu
Copy link
Contributor Author

@swift-ci please smoke test

@MaxDesiatov
Copy link
Contributor

  • Moves the command implementations to new modules PackageCollectionsTool and PackageRegistryTool.

Based on this, would you like experimental-destinations command introduced in #5911 to be moved to a separate module too?

@neonichu
Copy link
Contributor Author

Based on this, would you like experimental-destinations command introduced in #5911 to be moved to a separate module too?

I think it's fine to be in Commands since it doesn't need further dependencies. The main goal of this is to thin out the number of things that need to be built with CMake and to ideally not grow them.

@neonichu
Copy link
Contributor Author

--- bootstrap: note: Installing /home/build-user/build/buildbot_incremental/swiftpm-linux-x86_64/x86_64-unknown-linux-gnu/release/swift-package-manager to /home/build-user/build/buildbot_incremental/toolchain-linux-x86_64/usr/bin/swift-package/swift-package-manager

Looks like the change to bootstrap is not quite right, it is creating a directory called swift-package 😆

This separates out the collections and registry commands from the `Commands` module, allowing to simplify the first stage of bootstrap:

- Moves the command implementations to new modules `PackageCollectionsTool` and `PackageRegistryTool`.
- Adds a new multi-tool entry point executable `swift-package-manager`. This used to be included in `swift-package`, but that would render the separation moot and also seems like a better structure. For installation into the toolchain, we're simply installing the new executable under the name `swift-package`, so nothing changes there.
- Remove package-collections related stuff from the CMake build, it was anyway completely unused.
@neonichu neonichu force-pushed the cleanup-non-core-commands branch from 9eb4caa to 4326336 Compare November 18, 2022 23:17
@neonichu
Copy link
Contributor Author

@swift-ci please smoke test

Copy link
Contributor

@tomerd tomerd left a comment

Choose a reason for hiding this comment

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

🥳

@tomerd
Copy link
Contributor

tomerd commented Nov 18, 2022

cc @yim-lee

@neonichu
Copy link
Contributor Author

@swift-ci please test package compatibility

@neonichu
Copy link
Contributor Author

Hmmmm

[/Users/ec2-user/jenkins/workspace-private/swift-package-manager-source-compat-suite-PR-macos/swift/utils/build-script] ERROR: can't find CMake (please install CMake)

Is that an infra issue, @shahmishal?

@neonichu
Copy link
Contributor Author

@swift-ci please test package compatibility

@neonichu neonichu merged commit c29adb3 into main Dec 1, 2022
@neonichu neonichu deleted the cleanup-non-core-commands branch December 1, 2022 00:14
@MaxDesiatov
Copy link
Contributor

MaxDesiatov commented Dec 12, 2022

  • Adds a new multi-tool entry point executable swift-package-manager.

Is this new multi-tool entry point supposed to be the only one available? Is there much sense in declaring separate executableTargets for new top-level commands, in addition to adding a case to this entry point?

@neonichu
Copy link
Contributor Author

Is this new multi-tool entry point supposed to be the only one available? Is there much sense in declaring separate executableTargets for new top-level commands, in addition to adding a case to this entry point?

Yes, for two reasons:

  • not all platforms support symlinks in the way Unix-style platforms do, so e.g. on Windows we will not use the multi-tool but instead the individual binaries
  • for local testing/debugging, it can be useful to just build and run the individual tools, especially because the symlinking is not something that we can currently express in SwiftPM, so only builds with the bootstrap scripts have them.

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