Compile time vs. runtime deps

David Holmes david.holmes at oracle.com
Fri Jul 13 02:38:14 PDT 2012


On 13/07/2012 6:23 PM, Paul Sandoz wrote:
> On Jul 13, 2012, at 6:12 AM, David Holmes wrote:
>
>> On 12/07/2012 11:26 PM, Jaroslav Tulach wrote:
>>> Dne Čt 12. července 2012 10:54:27, David Holmes napsal(a):
>>>>>> I don't see why I need to make the distinction to the compiler. I
>>>>>> declare an optional dependency and at compile-time it is, or isn't
>>>>>> found.
>>>>>
>>>>> That could produce different result during the compilation. The
>>>>> compilation
>>>>> could either succeed or fail. Javac and IDEs need to know whether the
>>>>> optional (in runtime) library should or should not be on the compilation
>>>>> "classpath".
>>>> You mean the tools are going to dynamically examine my
>>>> module-info.java/class and use it to determine what they should set
>>>> modulepath/classpath to ???
>>>
>>> Hello David,
>>> yes, that is the jigsaw plan. module-info.java is going to be the source of
>>> compilation classpath for javac. It is supposed to save us for "classpath
>>> hell". However, unlike other tools that shield us from such "hell", the
>>> current design addresses just a half (at most) of the problem. Should it stay
>>> this way, we are going to be faced to "classpath nightmare"...
>>>
>>>> That is not something I would have expected at all.
>>>
>>> I guess you are looking at Jigsaw from VM perspective, then! That is OK, but
>>> the Jigsaw tries to define (a bit of) tooling story too.
>>
>> Nothing to do with VM perspective. I just don't expect my compiler or IDE to go and find a missing module for me. If the module is needed and missing then I get an error at compilation time. If the dependency is listed in module-info.java I still get an error at compilation time. Unless you expect the tool to try and resolve the problem (which I don't) then I don't see how adding something in module-info.java makes a difference.
>>
>
> Do you expect that every developer, when checking out and building a project with such dependencies, deal with compile time errors?

In general I don't expect users of a module to have to build it in the 
first place. I don't see why a developer of a module shouldn't have to 
deal with their own issues - they presumably understood that to use 
foo.bar they need to download and install foo.

> With the right information in the module-info.java compile-time dependencies can be downloaded automatically from repositories i.e. just like Maven does.

I have no doubt they could. What I question is whether it is really 
necessary.

David
-----

> Paul.



More information about the jigsaw-dev mailing list