2.11/2.12 Cross Compile and Piotr's Session-aware futures

19 views
Skip to first unread message

Matt Farmer

unread,
Dec 23, 2016, 3:31:51 PM12/23/16
to Lift
Hey all,

Wanted to let everyone know that the cross compile for the framework has been broken for a
few days. I just pushed a commit that should fix it, but it’s not very elegant.

Net-net, Future gained a few new methods in Scala 2.12. To conform to the Future interface
we have to provide an implementation for them in 2.12. However, they don’t exist in 2.11, so
we can’t actually implement them.

I attempted to use macros to provide a conditional implementation - such that the
implementation would exist when compiling under 2.12, but not when compiling under 2.11.
However, it seems that macros don’t like implicit method arguments - so the fact that the
ExecutionContext gets passed in implicitly means that I can’t shim it away with a macro.

I’m open to other options here. I don’t particularly relish throwing an
UnsupportedOperationException in the framework. But I also have run out of “good”
ideas.

Cheers,


Matt Farmer | Blog | Twitter
GPG: CD57 2E26 F60C 0A61 E6D8  FC72 4493 8917 D667 4D07

Diego Medina

unread,
Dec 23, 2016, 11:27:16 PM12/23/16
to Lift
I can't find it now, but I thought there was a way in sbt that you could have a scala source file to use with one version of Scala, and another file to use with a different version, to address this kind of situation

--
--
Lift, the simply functional web framework: http://liftweb.net
Code: http://github.com/lift
Discussion: http://groups.google.com/group/liftweb
Stuck? Help us help you: https://www.assembla.com/wiki/show/liftweb/Posting_example_code

---
You received this message because you are subscribed to the Google Groups "Lift" group.
To unsubscribe from this group and stop receiving emails from it, send an email to liftweb+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Diego Medina
Lift/Scala Consultant
di...@fmpwizard.com
https://blog.fmpwizard.com/

Antonio Salazar Cardozo

unread,
Dec 27, 2016, 2:43:39 PM12/27/16
to Lift
I believe this blog post mentions it: http://rosslawley.co.uk/how-to-handle-multiple-scala-versions/

In particular, it adds additional source directories based on the Scala version:

unmanagedSourceDirectories in Compile <+= (sourceDirectory in Compile, scalaBinaryVersion){
  (s, v) => s / ("scala_"+v)
}

Then we can put things in src/main/scala_2.12 to implement the right 2.12 pieces,
and src/main/scala_2.11 to implement the 2.11 pieces. src/main/scala will continue
to work as expected.
Thanks,
Antonio
Reply all
Reply to author
Forward
0 new messages