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.

Sangria derive macros seem to interfere with incremental compilation

See original GitHub issue

Quite often when compiling via sbt without a clean myself as well as colleagues run into this error:

[error] Unknown type: (marginChar: Char)String <and> ()String, (marginChar: Char)String <and> ()String [class scala.reflect.internal.Types$OverloadedType, class scala.reflect.internal.Types$OverloadedType] TypeRef? false
scala.reflect.internal.FatalError: Unknown type: (marginChar: Char)String <and> ()String, (marginChar: Char)String <and> ()String [class scala.reflect.internal.Types$OverloadedType, class scala.reflect.internal.Types$OverloadedType] TypeRef? false

This only happens after modifying files containing containing a large number of sangria.macros.derive.* macro usages. Even adding a single new line to the file causes the failure and rerunning the compile after a clean always succeeds. I’m not familiar enough with Scala macros’ implementation to be sure if this might be due to sbt/scalac bugs/limitations w.r.t. macros or if this might possibly be a bug in Sangria’s derive* macros that triggers this.

I haven’t been able to produce the same problem yet in a cut down test project, but I’ve attached most of the sbt output in hopes something might be evident from that.

Sangria_Macro_Inc_Compile_Stacktrace.txt

Versions: Scala: 2.11.8 SBT: 0.13.9 Java: 1.8.0_91

Sangria Imports in a problem file: import sangria.macros.derive._ import sangria.schema._ import sangria.marshalling.playJson._ import sangria.marshalling._

Thanks for any help!

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
JohnCohorncommented, Aug 1, 2016

Awesome, THANK YOU! We love using Sangria so far and are starting to use it more and more so these little fixes add up to make a big difference 😃

0reactions
OlegIlyenkocommented, Nov 25, 2016

After implementing a cross-compilation to scala 2.12, I noticed that macro compilation became more stable and predictable.

Since some of the issues, described here, are addressed, I will close close the issue for now, but if this strange compiler behavior will occur again, I would suggest to repoen it, or (even better) create a new issue and reference this one (so that we can keep track of them)

Read more comments on GitHub >

github_iconTop Results From Across the Web

Learn Sangria
For this, sangria provides a set of macros that are able to derive GraphQL types from normal Scala classes, case classes and enums:...
Read more >
2015-2020 Dietary Guidelines for Americans
[1] Definitions for each food group and subgroup are provided throughout Chapter 1: Key Elements of Healthy Eating Patterns and are compiled in...
Read more >
Your Python Trinket
... COMPETITORY COMPILATION COMPILATIONS COMPILE COMPILED COMPILER COMPILERS ... DERIVATIVES DERIVE DERIVED DERIVER DERIVERS DERIVES DERIVING DERM DERMA ...
Read more >
Search Results for sfgix | Mutual Fund Observer - Page 2
Unlike the case of mutual funds, size seems no guardian against liquidation. Fortress Investment Group is closing its flagship macro fund by ...
Read more >
Untitled
Ghid marimi haine copii, 29965 trail creek drive, Action aviation hamish ... Nasal hair removal laser, Cara setting macro g300, Psg transfermarkt rumors....
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