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

chore: Print better errors when bloopInstall failed #2200

Merged
merged 1 commit into from
Nov 23, 2023

Conversation

tgodzik
Copy link
Contributor

@tgodzik tgodzik commented Nov 23, 2023

Previously, we would get soemthing like:

Cause: Incomplete(node=Some(Task(_)), tpe=Error, msg=None, causes=List(Incomplete(node=Some(Task(_)), tpe=Error, msg=None, causes=List(Incomplete(node=Some(Task(_)), tpe=Error, msg=None, causes=List(Incomplete(node=Some(Task((taskDefinitionKey: ScopedKey(Scope(Select(ProjectRef(file:/tmp/sbt_14ffb38d/no-compile-incremental/,no-compile-incremental)), Select(ConfigKey(runtime)), Zero, Zero),fullClasspath)))), tpe=Error, msg=None, causes=List(Incomplete(node=Some(Task(_)), tpe=Error, msg=None, causes=List(Incomplete(node=Some(Task((taskDefinitionKey: ScopedKey(Scope(Select(ProjectRef(file:/tmp/sbt_14ffb38d/no-compile-incremental/,no-compile-incremental)), Select(ConfigKey(runtime)), Zero, Zero),dependencyClasspath)))), tpe=Error, msg=None, causes=List(Incomplete(node=Some(Task(_)), tpe=Error

which doesn't contain any useful information.

Now, I change to print errors if we have any direct causes of the failure, which would come from bloop task itself.

Previously, we would get soemthing like:

```
Cause: Incomplete(node=Some(Task(_)), tpe=Error, msg=None, causes=List(Incomplete(node=Some(Task(_)), tpe=Error, msg=None, causes=List(Incomplete(node=Some(Task(_)), tpe=Error, msg=None, causes=List(Incomplete(node=Some(Task((taskDefinitionKey: ScopedKey(Scope(Select(ProjectRef(file:/tmp/sbt_14ffb38d/no-compile-incremental/,no-compile-incremental)), Select(ConfigKey(runtime)), Zero, Zero),fullClasspath)))), tpe=Error, msg=None, causes=List(Incomplete(node=Some(Task(_)), tpe=Error, msg=None, causes=List(Incomplete(node=Some(Task((taskDefinitionKey: ScopedKey(Scope(Select(ProjectRef(file:/tmp/sbt_14ffb38d/no-compile-incremental/,no-compile-incremental)), Select(ConfigKey(runtime)), Zero, Zero),dependencyClasspath)))), tpe=Error, msg=None, causes=List(Incomplete(node=Some(Task(_)), tpe=Error
```

which doesn't contain any useful information.

Now, I change to print errors if we have any direct causes of the failure, which would come from bloop task itself.
@tgodzik tgodzik requested a review from adpi2 November 23, 2023 10:06
}
} else {
logger.error(
s"Couldn't run bloopGenerate. The issue could be caused by failing to compile the project."
Copy link
Member

Choose a reason for hiding this comment

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

Is it not supposed to not even try to compile the project?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

it should compile if there is source generation, so this might happen.

Copy link
Member

Choose a reason for hiding this comment

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

I would argue that if there is source generation it should only generate the sources, not compile.

But in general we don't know what's in the build and a compilation could happen.

@tgodzik tgodzik merged commit 2ee4293 into scalacenter:main Nov 23, 2023
17 checks passed
@tgodzik tgodzik deleted the better-errors branch November 23, 2023 16:08
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.

2 participants