Scala Programming Language
  1. Scala Programming Language
  2. SI-4841

Option to specify classpath for compiler plugins

    Details

      Description

      Plugins get their own class loader, but there is not currently a way to put jars in this class loader except by declaring a jar to be a plugin. If the jar doesn't contain a plugin, however, a warning is printed.

      This enhancement requests either removing the warning (not the preferred solution) or adding a new option, such as '-Xpluginscp' that allows specifying additional jars to be available to plugins. A patch is attached to demonstrate this.

        Activity

        Hide
        Adriaan Moors added a comment -

        Feel free to re-assign to reviewer.

        Show
        Adriaan Moors added a comment - Feel free to re-assign to reviewer.
        Hide
        Mark Harrah added a comment -

        I assume this isn't happening: https://groups.google.com/forum/#!topic/scala-internals/x7kBYq6oDkI.

        If not, all I would do is update the patch to compile against master and submit a pull request instead. If that is fine, I'll do that. Otherwise, I'd reassign back to scala-reviewer.

        Show
        Mark Harrah added a comment - I assume this isn't happening: https://groups.google.com/forum/#!topic/scala-internals/x7kBYq6oDkI . If not, all I would do is update the patch to compile against master and submit a pull request instead. If that is fine, I'll do that. Otherwise, I'd reassign back to scala-reviewer.
        Hide
        Adriaan Moors added a comment -

        Unassigning as milestone deadline was reached.

        Show
        Adriaan Moors added a comment - Unassigning as milestone deadline was reached.
        Hide
        A. P. Marki added a comment -

        Adding a manifest Class-Path to the plugin.jar works in the usual way.

        It seems to me that the reason to have an option for a plugin class path is that two plugins have conflicting dependencies and you have to keep them separate; otherwise, using the compiler's class path suffices.

        If a plugin-specific path is deemed a requirement, maybe make -Xplugin a path instead of a location. One of the elements of the path better contain a plugin descriptor. The first lucky location to define a plugin wins. That path is used to load it, of course.

        E.g., `-Xplugin:plugin1.jar:dep1.jar,plugin2.jar:dep2.jar,something.jar:plugin3.jar`

        Show
        A. P. Marki added a comment - Adding a manifest Class-Path to the plugin.jar works in the usual way. It seems to me that the reason to have an option for a plugin class path is that two plugins have conflicting dependencies and you have to keep them separate; otherwise, using the compiler's class path suffices. If a plugin-specific path is deemed a requirement, maybe make -Xplugin a path instead of a location. One of the elements of the path better contain a plugin descriptor. The first lucky location to define a plugin wins. That path is used to load it, of course. E.g., `-Xplugin:plugin1.jar:dep1.jar,plugin2.jar:dep2.jar,something.jar:plugin3.jar`
        Hide
        A. P. Marki added a comment -

        This implements that behavio(u)r:

        https://github.com/scala/scala/pull/3169

        Show
        A. P. Marki added a comment - This implements that behavio(u)r: https://github.com/scala/scala/pull/3169
        Hide
        Mark Harrah added a comment -

        The compiler class loader can't be cached if a plugin's classpath is included on the compiler classpath. The manifest Class-Path isn't reliable when distributing plugins. -Xplugin as a path seems sensible to me.

        Show
        Mark Harrah added a comment - The compiler class loader can't be cached if a plugin's classpath is included on the compiler classpath. The manifest Class-Path isn't reliable when distributing plugins. -Xplugin as a path seems sensible to me.

          People

          • Assignee:
            A. P. Marki
            Reporter:
            Mark Harrah
          • Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development