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
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1147,7 +1147,22 @@ object BloopDefaults {
)
.map(fail =>
if (fail.nonEmpty) {
logger.error(s"Couldn't run bloopGenerate. Cause: ${fail.mkString("\n")}")
val messages = fail.flatMap { incomplete =>
incomplete.directCause.zip(incomplete.message)
}

if (messages.nonEmpty) {
logger.error(s"Couldn't run bloopGenerate. The issue might be caused by:")
messages.foreach {
case (t, message) =>
logger.error(message)
logger.trace(t)
}
} 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.

)
}
throw fail.head
}
)
Expand Down
Loading