scalacenter / bloop

Bloop is a build server and CLI tool to compile, test and run Scala fast from any editor or build tool.
https://scalacenter.github.io/bloop/
Apache License 2.0
906 stars 202 forks source link

Inaccurate Scalaz-deriving Errors #1503

Open j-potts opened 3 years ago

j-potts commented 3 years ago

Hey guys,

Looks like there may be some compatibility issues with the latest scalaz-deriving and bloop. Under my multi-project mono-repo I'm using the following libs:

The issue I'm facing is that using those libs together will cause persistent errors to show up, despite not showing up when compiling within SBT. Here a code snippet as an example...

import pureconfig.ConfigReader
import scalaz.annotation.deriving

@deriving(ConfigReader)
final case class Foo(
    name: String,
    phone: String)

This will result in...

could not find implicit value for parameter F: scalaz.DerivingProducts[pureconfig.ConfigReader]

This issue seems to prevent Metals and Bloop from properly compiling dependent files, and breaks IDE functionality downstream.

Thanks for the help!

tgodzik commented 3 years ago

Thanks for reporting! Were you able to run with SBT BSP as suggested on Discord? I am not too familiar with pureconfig or scalaz-deriving. Might this be indeed an issue that macro annotation reads configuration from the classpath at compile-time?

pjrt commented 3 years ago

I found the underlying issue to be a bug around sbt bloopInstall.

https://github.com/scalacenter/bloop/issues/1504

That specific scalaz-deriving functionality depends on resource files and they aren't being shared properly between projects.

tgodzik commented 3 years ago

Do you have maybe some sample project I can take a look at ?