-
Notifications
You must be signed in to change notification settings - Fork 55
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
GenBCode issue with compiling #84
Comments
Interesting, I didn't know the need backend had any fundamental On Thu, 10 Nov 2016 at 18:54 Dan Di Spaltro [email protected]
|
Yeah I was surprised too, I am guessing it's related to this https://github.com/wix/accord/blob/master/core/src/main/scala-2.11/com/wix/accord/transform/MacroHelper.scala#L65
The last one being the addition that resulted in that error. |
I've verified that Accord itself works successfully with this flag; I suspect compiling code with GenBCode doesn't support depending on non-GenBCode'd libraries where macros are concerned, but I'll do some more digging first. |
I just did that, compiled accord with the flag and recompiled the dependent project to no luck. I am honestly not sure what's going on, but considering that |
2.12 is compiled and packaged separately with the default compiler (and its associated backend), so I don't expect any issues with 2.12. That being said, I'll try and reproduce the problem with 2.11 and update here. |
Sorry, I haven't been able to replicate this with the Accord example project with your options. I'm not sure why you're running into this issue, but if you're willing to provide access to your codebase (or have a screen sharing session) I'd love to help you try and figure it out... |
Yeah I was being lazy, Ill work up a small public example, thanks! |
I recently tried to upgrade http://github.com/mesosphere/marathon to 0.6 and we also use GenBCode and ran into the same issue. As soon as I fixed the last compile error (you can see that if you look for #89 in the review). |
I get the same errors, but with no scala options (e.g. GenBCode) |
I've yet to be able to replicate this locally, but I'll keep trying. Thanks for the pointers, and if anything comes to mind (or you managed to reproduce this separately) please post it here! |
OK, managed to find a workaround thanks to @jasongilanfarr's data on Marathon; I'm not clear on why this is required all of a sudden, but At any rate this can be worked around by manually adding a library dependency to the project containing the validators as follows (feedback would be appreciated): // "provided" scope guarantees this will be available when compiling, but won't be transitively
// inherited by downstream projects.
libraryDependencies += "org.scala-lang" % "scala-compiler" % scalaVersion.value % "provided" Sample output:
|
@holograph I think that's yet another situation when missing transitive dependencies may cause spurious compilation failures. I guess that something as subtle as changing a backend may tip the scales. About your question. When expanding macros, the macro engine provides a classloader that, in addition to the compilation classpath, includes scala-reflect.jar and scala-compiler.jar. This is how you can expand macros that have been compiled with scala-compiler.jar even when it is not on the compilation classpath of the project that uses macros. What's going on here is unrelated, I think. While traversing the compilation classpath, the compiler may need to do some processing of the metadata it loads. It looks like the amount of processing required is different between the GenASM and GenBCode backends. @lrytz @adriaanm @retronym Any ideas why the GenBCode backend would be more aggressive wrt transitive dependencies that the GenASM one? |
Might be related to scalamacros/paradise#68, by which use of
Moving the Now I'm not at all sure if this it he issue, or why the choice of backend makes a difference. If someone could prepare instructions on how to reproduce with a minimal client project of this macro, I can take a quick look. |
In general, I wouldn't recommend using the experimental |
I've lodged a compiler bug for this and will fix it shortly: scala/scala-dev#275 |
Thanks @retronym, I'll track it and follow up if it seems resolved. |
Remarking for milestone 0.6.1 (either for verification or to add a "known issues" section to the documentation) |
Documentation updated to mention the workaround; removing milestone assignment and will keep open until a Scala version with the fix is released and confirmed. |
Per the Scala repo this should've been fixed in 2.12.1, however I'm blocked from verifying this due to #103. Will follow up when there's news on that front. |
I believe Scala 2.12.2 solves both issues, though I haven't been able to fully verify. Please reopen if you run into this issue again... |
I am running into an issue when compiling my project with
GenBCode
backend, it appears related to the use of the toolbox in theMacroHelper
class.Any ideas?
The text was updated successfully, but these errors were encountered: