Skip to content
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

Split some daemon projects out of launcher and core #29074

Merged
merged 4 commits into from May 10, 2024

Conversation

adammurdoch
Copy link
Member

Context

Introduce 3 projects to contain the daemon client, daemon-side services and shared protocol types. The intention is to move types out of launcher and core into these buckets, however in this PR only the types related to client stdin and user input handling have been moved.

The separation allows the different buckets of code to have different dependency graphs and target JVMs.

Contributor Checklist

  • Review Contribution Guidelines.
  • Make sure that all commits are signed off to indicate that you agree to the terms of Developer Certificate of Origin.
  • Make sure all contributed code can be distributed under the terms of the Apache License 2.0, e.g. the code was written by yourself or the original code is licensed under a license compatible to Apache License 2.0.
  • Check "Allow edit from maintainers" option in pull request so that additional changes can be pushed by Gradle team.
  • Provide integration tests (under <subproject>/src/integTest) to verify changes from a user perspective.
  • Provide unit tests (under <subproject>/src/test) to verify logic.
  • Update User Guide, DSL Reference, and Javadoc for public-facing changes.
  • Ensure that tests pass sanity check: ./gradlew sanityCheck.
  • Ensure that tests pass locally: ./gradlew <changed-subproject>:quickTest.

Reviewing cheatsheet

Before merging the PR, comments starting with

  • ❌ ❓must be fixed
  • 🤔 💅 should be fixed
  • 💭 may be fixed
  • 🎉 celebrate happy things

- `daemon-protocol` contains the types sent between client and daemon.
- `client-services` contains some services used by the client.
- `daemon-services` contains some services used by the daemon to interact with the client.

In this commit, only the services related to user input and client stdin handling have been moved.
Comment on lines 106 to 107
_ * event.convert("def") >> Either.left(12)
Specification._ * event.convert("def") >> Either.left(12)
Copy link
Member

Choose a reason for hiding this comment

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

This looks like an unintentional change.

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed.

Copy link
Member

@lptr lptr left a comment

Choose a reason for hiding this comment

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

LGTM.

api(project(":base-services"))
api(project(":logging-api"))
api(project(":serialization"))
api(project(":core"))
Copy link
Member

Choose a reason for hiding this comment

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

Would be nice if we could avoid this dependency here. Since one of the stated goals of this PR is to allow different buckets of code to target different JVM versions, and since this code is used by the launcher, I think we should avoid pulling in core if possible.

Do you know which code in project requires classes from core?

Copy link
Member Author

Choose a reason for hiding this comment

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

Pretty much all of the client projects, such as "launcher", pull in "core". For this PR I just want to get the buckets in place without detangling from core. This can happen in a later PR.

Copy link
Member Author

Choose a reason for hiding this comment

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

I've added some comments.

@@ -50,6 +51,8 @@ dependencies {
implementation(project(":file-watching"))
implementation(project(":problems-api"))
implementation(project(":problems"))
implementation(project(":client-services"))
implementation(project(":daemon-services"))
Copy link
Member

Choose a reason for hiding this comment

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

Seems odd to have this dependency here unless we plan to remove it in future iterations -- in which case I think it would be a good idea to note that here

Copy link
Member Author

Choose a reason for hiding this comment

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

"launcher" still needs to be split up. It currently contains the client, daemon and tooling API provider. In this PR, I just want to get the buckets in place. Detangling launcher can happen in a later PR.

Copy link
Member Author

Choose a reason for hiding this comment

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

I've added some comments

@@ -123,6 +123,7 @@ private ClassPath plusExtensionModules(ClassPath classpath, Set<Module> extensio
};

private static final String[] GRADLE_OPTIONAL_EXTENSION_MODULES = {
"gradle-daemon-services",
Copy link
Member

Choose a reason for hiding this comment

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

Why are these marked optional?

Copy link
Member Author

Choose a reason for hiding this comment

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

That's the magic incantation to make all of the tests pass. This PR is just about getting the buckets into place. We can solve all the weird problems in the various tests later.

@adammurdoch adammurdoch added this pull request to the merge queue May 9, 2024
@reinsch82
Copy link
Contributor

🎉

Merged via the queue into master with commit d1f8f3d May 10, 2024
26 of 27 checks passed
@adammurdoch adammurdoch deleted the am/task-select-error branch May 10, 2024 11:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants