question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Source generation fails with a package declaration

See original GitHub issue

I have this error when I add a package declaration on a scala protocol and try to generate avro or proto from it.

[error] scala.tools.reflect.ToolBoxError: reflective compilation has failed:
[error] 
[error] '{' expected.
[error]         at scala.tools.reflect.ToolBoxFactory$ToolBoxImpl$ToolBoxGlobal.throwIfErrors(ToolBoxFactory.scala:320)
[error]         at scala.tools.reflect.ToolBoxFactory$ToolBoxImpl$ToolBoxGlobal.parse(ToolBoxFactory.scala:295)
[error]         at scala.tools.reflect.ToolBoxFactory$ToolBoxImpl.$anonfun$parse$1(ToolBoxFactory.scala:421)
[error]         at scala.tools.reflect.ToolBoxFactory$ToolBoxImpl$withCompilerApi$.apply(ToolBoxFactory.scala:359)
[error]         at scala.tools.reflect.ToolBoxFactory$ToolBoxImpl.parse(ToolBoxFactory.scala:418)
[error]         at higherkindness.mu.rpc.idlgen.IdlGenerator.generateFrom(IdlGenerator.scala:44)
[error]         at higherkindness.mu.rpc.idlgen.IdlGenerator.generateFrom$(IdlGenerator.scala:37)
[error]         at higherkindness.mu.rpc.idlgen.avro.AvroIdlGenerator$.generateFrom(AvroIdlGenerator.scala:27)
[error]         at higherkindness.mu.rpc.idlgen.Generator.$anonfun$generateFrom$1(Generator.scala:30)
[error]         at scala.collection.TraversableLike.$anonfun$flatMap$1(TraversableLike.scala:240)
[error]         at scala.collection.Iterator.foreach(Iterator.scala:937)
[error]         at scala.collection.Iterator.foreach$(Iterator.scala:937)
[error]         at scala.collection.AbstractIterator.foreach(Iterator.scala:1425)
[error]         at scala.collection.IterableLike.foreach(IterableLike.scala:70)
[error]         at scala.collection.IterableLike.foreach$(IterableLike.scala:69)
[error]         at scala.collection.AbstractIterable.foreach(Iterable.scala:54)
[error]         at scala.collection.TraversableLike.flatMap(TraversableLike.scala:240)
[error]         at scala.collection.TraversableLike.flatMap$(TraversableLike.scala:237)
[error]         at scala.collection.AbstractTraversable.flatMap(Traversable.scala:104)
[error]         at higherkindness.mu.rpc.idlgen.Generator.generateFrom(Generator.scala:29)
[error]         at higherkindness.mu.rpc.idlgen.Generator.generateFrom$(Generator.scala:25)
[error]         at higherkindness.mu.rpc.idlgen.avro.AvroIdlGenerator$.generateFrom(AvroIdlGenerator.scala:27)
[error]         at higherkindness.mu.rpc.idlgen.GeneratorApplication.generateFrom(GeneratorApplication.scala:63)
[error]         at higherkindness.mu.rpc.idlgen.IdlGenPlugin$.$anonfun$idlGenTask$1(IdlGenPlugin.scala:186)
[error]         at sbt.util.FileFunction$.$anonfun$cached$1(FileFunction.scala:73)
[error]         at sbt.util.FileFunction$.$anonfun$cached$4(FileFunction.scala:147)
[error]         at sbt.util.Difference.apply(Tracked.scala:313)
[error]         at sbt.util.Difference.apply(Tracked.scala:293)
[error]         at sbt.util.FileFunction$.$anonfun$cached$3(FileFunction.scala:143)
[error]         at sbt.util.Difference.apply(Tracked.scala:313)
[error]         at sbt.util.Difference.apply(Tracked.scala:288)
[error]         at sbt.util.FileFunction$.$anonfun$cached$2(FileFunction.scala:142)
[error]         at higherkindness.mu.rpc.idlgen.IdlGenPlugin$.$anonfun$taskSettings$1(IdlGenPlugin.scala:127)
[error]         at scala.Function1.$anonfun$compose$1(Function1.scala:44)
[error]         at sbt.internal.util.$tilde$greater.$anonfun$$u2219$1(TypeFunctions.scala:40)
[error]         at sbt.std.Transform$$anon$4.work(System.scala:67)
[error]         at sbt.Execute.$anonfun$submit$2(Execute.scala:269)
[error]         at sbt.internal.util.ErrorHandling$.wideConvert(ErrorHandling.scala:16)
[error]         at sbt.Execute.work(Execute.scala:278)
[error]         at sbt.Execute.$anonfun$submit$1(Execute.scala:269)
[error]         at sbt.ConcurrentRestrictions$$anon$4.$anonfun$submitValid$1(ConcurrentRestrictions.scala:178)
[error]         at sbt.CompletionService$$anon$2.call(CompletionService.scala:37)
[error]         at java.util.concurrent.FutureTask.run(FutureTask.java:266)
[error]         at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
[error]         at java.util.concurrent.FutureTask.run(FutureTask.java:266)
[error]         at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
[error]         at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
[error]         at java.lang.Thread.run(Thread.java:748)
[error] (server_protocol / idlGen) scala.tools.reflect.ToolBoxError: reflective compilation has failed:
[error] 
[error] '{' expected.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:2
  • Comments:13 (8 by maintainers)

github_iconTop GitHub Comments

2reactions
SemanticBeengcommented, Apr 24, 2019

I think “yes”. 😃 Let me say in different words to make it more clear what I mean by “runtime semantics”.

I expect that any @message and all dependent types (included nested) are interpreted to protobuf at runtime by mu, in a way that is consistent with the semantics of the corresponding IDL, regardless if generated, source or handcrafted.

Is that a “yes” too 😃 Thank you and @AdrianRaFo !

1reaction
fedefernandezcommented, Apr 24, 2019

Yes, you’re right, edited 😊

Read more comments on GitHub >

github_iconTop Results From Across the Web

Fixing the “Declared package does not match the expected ...
First, let's make sure that the package declaration and relative source file path match. If that's already the case, we can try to...
Read more >
Error using source generator from a source generator package
Current workaround · Try deleting the cache manually. · @mezoni tried that too, issue still persist. · What does this mean import: "package:map_gen ......
Read more >
Fixing declared package does not match the expected package
Fixing these error messages in an imported Android project: Errors occurred during the build.Errors running builder 'Android Resource ...
Read more >
377850 – Error "type X collides with a package" should ... - Bugs
When working with Hudson/Jenkins plug-ins, where it is a convention to have UI resources in a package with the same name as the...
Read more >
Code generation does not work when adding Flutter ... - GitHub
I am working on a Locale management tool. It uses annotations to facilitate language management. I have setup of three projects, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found