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

scala files can contain ... after generation #90

Open
Khrol opened this issue Aug 25, 2022 · 2 comments
Open

scala files can contain ... after generation #90

Khrol opened this issue Aug 25, 2022 · 2 comments

Comments

@Khrol
Copy link

Khrol commented Aug 25, 2022

This problem is flacky and occurs in random places in our codebase. We have a couple of dozens avdl files and they are converted to scala.

From time to time the following scala code is generated (pieces of the generated files):
def put(field$: Int, value: ...): Unit = {
(field$: @...) match {
final case class ExperimentSegments(var experiment_segment_id: ..., var name: ..., var type: String) extends ... {

The problem after the retry. Looks like the parser misses types from time to time (sync issues?) and leaves ... instead.
My feeling is that the issue goes down to treehugger but I'm not sure.

Any hints/ideas?

@Khrol
Copy link
Author

Khrol commented Aug 26, 2022

We have multiple tasks that compile different avdl files separately. The problem goes away when we limit the concurrency in sbt for such tasks so only one avdl file is compiled at any given moment of time:

val Avdl = Tags.Tag("avdl")

concurrentRestrictions in Global := {
  ...
  Seq(..., Tags.limit(Avdl, 1), ...)
}

...
  Compile / sourceGenerators += (Compile / avroScalaGenerateSpecific).tag(Avdl).taskValue,
...

@julianpeeters
Copy link
Owner

Thanks for reporting. Glad you found a solution, unfortunately it'll probably be quite a while before there's a fix in avrohugger itself.

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

No branches or pull requests

2 participants