Major breakage: manifests don't work in certain environments

57 views
Skip to first unread message

Eugene Burmako

unread,
Apr 15, 2012, 4:43:29 AM4/15/12
to <scala-internals@googlegroups.com>
Manifests (not ClassManifests, just Manifests) now use scala.reflect.mirror singleton. This singleton is loaded from scala-compiler.jar using reflection. That reflection uses getClass.getClassLoader of scala-library.jar, and tries to load the mirror from scala.reflect.runtime.package. Breakages might happen even when scalac starts up, because: 1) it uses manifests, 2) in some environments classloader that loads scala-library.jar for scalac doesn't contain scala-compiler.jar.

Status will be tracked here:

Eugene Burmako

unread,
Apr 15, 2012, 4:44:49 AM4/15/12
to scala-internals, Iulian Dragos, <luc.bourlier@typesafe.com>
@Iulian & Luc, Josh has figured out that setting <fork>false</fork> in
maven-scala configuration fixes problems with compilation. Could you,
please, adjust your scripts and try to build Scala IDE?

Eugene Burmako

unread,
Apr 15, 2012, 4:49:19 AM4/15/12
to scala-internals, Christopher Vogt
Hey, would use your help with SBT. Got time today?

Luc Bourlier

unread,
Apr 16, 2012, 6:41:35 AM4/16/12
to scala-i...@googlegroups.com, Iulian Dragos, <luc.bourlier@typesafe.com>
Adding '<fork>false</fork>' kind of work but is not usable. It generates the classes, but the compiler is calling System.exit() at some point and kill the maven run.

Luc

Paul Phillips

unread,
Apr 16, 2012, 7:00:28 AM4/16/12
to scala-i...@googlegroups.com, Iulian Dragos, <luc.bourlier@typesafe.com>

Eugene Burmako

unread,
Apr 16, 2012, 10:17:56 PM4/16/12
to scala-internals
I'm glad to announce that manifests don't require a mirror anymore if
you use them solely to create arrays: https://github.com/scala/scala/pull/411.

This means that scala-compiler.jar is now required on the classpath
*of the classloader that loaded scala-library.jar* only if you
explicitly inspect a tpe (or a symbol) of a manifest, or use <:<, >:>
or typeArguments.

Bottom line is that maven should work as it used to, even without
<fork>false</false>.

Alex Cruise

unread,
Apr 17, 2012, 3:05:15 PM4/17/12
to scala-i...@googlegroups.com
On Mon, Apr 16, 2012 at 7:17 PM, Eugene Burmako <eugene....@epfl.ch> wrote:
I'm glad to announce that manifests don't require a mirror anymore if
you use them solely to create arrays: https://github.com/scala/scala/pull/411.

That's good!
 
or use <:<, >:> or typeArguments.

That's bad. :(  

We have eight uses of <:< in our codebase that would be unhappy to have to drag a scala-compiler.jar around with them.  Are there any alternatives?

-0xe1a

Eugene Burmako

unread,
Apr 17, 2012, 3:33:31 PM4/17/12
to scala-i...@googlegroups.com
After having discussed the problem with Paul today, I'm thinking of reverting manifests to their original state, i.e. manifests will remain as they were in 2.9, type tags will remain as they are now, and manifests will become deprecated and subject to being removed in 2.11. I'm not sure of the details (e.g. what if you want to migrate, but you use a 3rd party library, which only accepts manifests), but this looks like the lesser evil.

In the meanwhile, could you please explain your use cases to me? (would be also great if you could post the actual code)
Reply all
Reply to author
Forward
0 new messages