Re: javac --module-source-path and --patch-module do not work together

2016-11-02 Thread Jonathan Gibbons
A variant of this problem is under consideration, which may address your 
use case.


In the meantime, the workaround is to make sure there is no evidence of 
java.base on the module source path.


-- Jon

On 11/02/2016 10:11 AM, Remi Forax wrote:

I agree with that, but that's not my use case.
I want to add/override files to java.base (an existing module) with 
--patch-module when i compile several other modules with --module-source-path, 
i think this should be allowed, otherwise it will be hard to patch the JDK and 
see the effect on several modules.

Rémi

- Mail original -

Envoyé: Mercredi 2 Novembre 2016 17:57:58
Objet: Re: javac --module-source-path and --patch-module do not work together
On 11/02/2016 09:49 AM, Remi Forax wrote:

I agree that if there is a folder java.base in the module-source-path, it should
be used but this is not the case.
Here, i want to add files to an existing modules (java.base) and those files are
in output/classes not in src.

You currently can't add files with --patch-module to a module found with
--module-source-path.

-- Jon




Re: javac --module-source-path and --patch-module do not work together

2016-11-02 Thread Remi Forax
I agree with that, but that's not my use case.
I want to add/override files to java.base (an existing module) with 
--patch-module when i compile several other modules with --module-source-path, 
i think this should be allowed, otherwise it will be hard to patch the JDK and 
see the effect on several modules.

Rémi

- Mail original -
> Envoyé: Mercredi 2 Novembre 2016 17:57:58
> Objet: Re: javac --module-source-path and --patch-module do not work together

> On 11/02/2016 09:49 AM, Remi Forax wrote:
>> I agree that if there is a folder java.base in the module-source-path, it 
>> should
>> be used but this is not the case.
>> Here, i want to add files to an existing modules (java.base) and those files 
>> are
>> in output/classes not in src.
> 
> You currently can't add files with --patch-module to a module found with
> --module-source-path.
> 
> -- Jon


Re: javac --module-source-path and --patch-module do not work together

2016-11-02 Thread Jonathan Gibbons



On 11/02/2016 09:49 AM, Remi Forax wrote:

I agree that if there is a folder java.base in the module-source-path, it 
should be used but this is not the case.
Here, i want to add files to an existing modules (java.base) and those files 
are in output/classes not in src.


You currently can't add files with --patch-module to a module found with 
--module-source-path.


-- Jon


Re: javac --module-source-path and --patch-module do not work together

2016-11-02 Thread Remi Forax
- Mail original -
> De: "Jonathan Gibbons" 
> À: jigsaw-dev@openjdk.java.net
> Envoyé: Mercredi 2 Novembre 2016 16:15:38
> Objet: Re: javac --module-source-path and --patch-module do not work together

> Remi,
> 
> Your command line is questionable for putting output/modules on both -d
> and --module-path.   You don't need it on --module-path. When compiling
> modules, javac will automatically look in the output directory for
> classes for the module(s) being compiled.

You're right i would not have to use --module-path if i was able to compile 
several modules at once (using --module-source-path).
I use it here, because i compile the different modules with different calls to 
javac (in the right order because luckily there is no cycle in my example).

> 
> Does your module source path contain source code for java.base? If so,
> it will only use that definition of java.base, and not anything in the
> paths given with --patch-module.

I agree that if there is a folder java.base in the module-source-path, it 
should be used but this is not the case.
Here, i want to add files to an existing modules (java.base) and those files 
are in output/classes not in src. 

> 
> -- Jon

Rémi

> 
> 
> On 11/2/16 7:14 AM, Remi Forax wrote:
>> Hi Jon, hi all,
>>
>> When i try to compile a module with --module-source-path that uses a patched
>> class (with --patch-module),
>> it fails.
>>
>> With:
>> javac --module-source-path src \
>>-d output/modules/ \
>>--patch-module java.base=output/classes \
>>--module-path output/modules \
>>$(find src/org.hibernate.jpa/ -name "*.java")
>>
>> it seems that javac tries to find the source of the patched module (here
>> java.base) in the module-source-path,
>> so it get this error
>>
>> error: cannot find module: java.base
>> 1 error
>>
>> I believe this is a bug.
>>
>> Step to reproduce it:
>> git clone g...@github.com:forax/access-broker.git
>> and uncomment the lines that uses --module-source-path and --patch-module
>> java.base=output/classes in the build.sh.
>>
>> regards,
> > Rémi


Re: javac --module-source-path and --patch-module do not work together

2016-11-02 Thread Jonathan Gibbons

Remi,

Your command line is questionable for putting output/modules on both -d 
and --module-path.   You don't need it on --module-path. When compiling 
modules, javac will automatically look in the output directory for 
classes for the module(s) being compiled.


Does your module source path contain source code for java.base? If so, 
it will only use that definition of java.base, and not anything in the 
paths given with --patch-module.


-- Jon


On 11/2/16 7:14 AM, Remi Forax wrote:

Hi Jon, hi all,

When i try to compile a module with --module-source-path that uses a patched 
class (with --patch-module),
it fails.

With:
javac --module-source-path src \
   -d output/modules/ \
   --patch-module java.base=output/classes \
   --module-path output/modules \
   $(find src/org.hibernate.jpa/ -name "*.java")

it seems that javac tries to find the source of the patched module (here 
java.base) in the module-source-path,
so it get this error

error: cannot find module: java.base
1 error

I believe this is a bug.

Step to reproduce it:
git clone g...@github.com:forax/access-broker.git
and uncomment the lines that uses --module-source-path and --patch-module 
java.base=output/classes in the build.sh.

regards,
Rémi




javac --module-source-path and --patch-module do not work together

2016-11-02 Thread Remi Forax
Hi Jon, hi all,

When i try to compile a module with --module-source-path that uses a patched 
class (with --patch-module),
it fails.

With:
javac --module-source-path src \
  -d output/modules/ \
  --patch-module java.base=output/classes \
  --module-path output/modules \
  $(find src/org.hibernate.jpa/ -name "*.java")

it seems that javac tries to find the source of the patched module (here 
java.base) in the module-source-path,
so it get this error

error: cannot find module: java.base
1 error

I believe this is a bug.

Step to reproduce it:
git clone g...@github.com:forax/access-broker.git
and uncomment the lines that uses --module-source-path and --patch-module 
java.base=output/classes in the build.sh.

regards,
Rémi