Re: Review Request JDK-8169925: Organize licenses by module in source, JMOD file, and run-time image

2016-12-11 Thread Philip Race

The parts of this which I know about (the client licenses) look fine to me.
Some day we should look at whether we still have vestiges of X11
in the Mac code from the BSD port but for now its safer to assume there 
are ..
By this I mean "unix" includes Mac. as a core OS, but not as a desktop 
technology

for our port.

-phil.

On 12/7/16, 1:28 PM, Mandy Chung wrote:

This proposes to organize license files by module in source, JMOD,
and run-time image.

A summary of the proposal:
1. Organize third party notices by module in the source as follows:
 src/$MODULE/{share,$OS}/legal/*

The `legal` directory contains one file for each third party
library in the module, for example,
 src/java.base/share/legal/asm.md
   unicode.md
   zlib.md

The proposed template for this file is described in [1] and JEP 201
will be updated to reflect this proposed source layout.

2. Introduce a new LEGAL_NOTICES section in JMOD format. A new jmod
option `—-legal-notices` is added to package legal notices in
a JMOD file.

3. At jlink time, jlink will copy all legal notices from JMOD files
to the `legal` directory in the run-time image.  A plugin is
added to de-duplicate the legal notices if the filename and the
content matches that may reduce the image footprint.

4. THIRD_PARTY_README in the top-level directory of each repo is removed.
Manual edit to this file, multiple copies is no longer needed.

Webrev at:
http://cr.openjdk.java.net/~mchung/jdk9/webrevs/8169925/webrev.00/

Mandy
[1] https://bugs.openjdk.java.net/browse/JDK-8169925


Re: Review Request JDK-8169925: Organize licenses by module in source, JMOD file, and run-time image

2016-12-10 Thread Erik Joelsson

Looks good, thanks!

/Erik


On 2016-12-10 08:54, Mandy Chung wrote:

On Dec 9, 2016, at 11:51 PM, Erik Joelsson  wrote:

Hello Mandy,

In Copy-java.base.gmk. Modules.gmk is no longer needed. JMOD_* varaibles are no 
longer used.


Good catch.


In Main.gmk, it would be good with a comment explaining why the jmods need 
java.base-copy. Something like:

# All modules include the main license files from java.base.

Otherwise I'm ok with the build changes now.

Updated per your comment:

$ hg diff make/copy/Copy-java.base.gmk
diff --git a/make/copy/Copy-java.base.gmk b/make/copy/Copy-java.base.gmk
--- a/make/copy/Copy-java.base.gmk
+++ b/make/copy/Copy-java.base.gmk
@@ -233,3 +233,17 @@
  endif
  
  

+
+# JDK license and assembly exception files to be packaged in JMOD
+
+JDK_LICENSE ?= $(JDK_TOPDIR)/LICENSE
+JDK_NOTICE  ?= $(JDK_TOPDIR)/ASSEMBLY_EXCEPTION
+
+$(eval $(call SetupCopyFiles, COPY_JDK_NOTICES, \
+FILES := $(JDK_LICENSE) $(JDK_NOTICE), \
+DEST := $(LEGAL_DST_DIR), \
+FLATTEN := true, \
+))
+
+TARGETS += $(COPY_JDK_NOTICES)
+


$ hg diff make/Main.gmk
diff --git a/make/Main.gmk b/make/Main.gmk
--- a/make/Main.gmk
+++ b/make/Main.gmk
@@ -659,6 +659,9 @@
  exploded-image-optimize
endif
  
+  # All modules include the main license files from java.base.

+  $(JMOD_TARGETS): java.base-copy
+
zip-security: java.base-java java.security.jgss-java 
java.security.jgss-libs \
$(filter jdk.crypto%, $(JAVA_TARGETS))
  





Re: Review Request JDK-8169925: Organize licenses by module in source, JMOD file, and run-time image

2016-12-09 Thread Mandy Chung
> On Dec 9, 2016, at 11:51 PM, Erik Joelsson  wrote:
> 
> Hello Mandy,
> 
> In Copy-java.base.gmk. Modules.gmk is no longer needed. JMOD_* varaibles are 
> no longer used.
> 

Good catch.

> In Main.gmk, it would be good with a comment explaining why the jmods need 
> java.base-copy. Something like:
> 
> # All modules include the main license files from java.base.
> 
> Otherwise I'm ok with the build changes now.

Updated per your comment:

$ hg diff make/copy/Copy-java.base.gmk 
diff --git a/make/copy/Copy-java.base.gmk b/make/copy/Copy-java.base.gmk
--- a/make/copy/Copy-java.base.gmk
+++ b/make/copy/Copy-java.base.gmk
@@ -233,3 +233,17 @@
 endif
 
 

+
+# JDK license and assembly exception files to be packaged in JMOD
+
+JDK_LICENSE ?= $(JDK_TOPDIR)/LICENSE
+JDK_NOTICE  ?= $(JDK_TOPDIR)/ASSEMBLY_EXCEPTION
+
+$(eval $(call SetupCopyFiles, COPY_JDK_NOTICES, \
+FILES := $(JDK_LICENSE) $(JDK_NOTICE), \
+DEST := $(LEGAL_DST_DIR), \
+FLATTEN := true, \
+))
+
+TARGETS += $(COPY_JDK_NOTICES)
+


$ hg diff make/Main.gmk 
diff --git a/make/Main.gmk b/make/Main.gmk
--- a/make/Main.gmk
+++ b/make/Main.gmk
@@ -659,6 +659,9 @@
 exploded-image-optimize
   endif
 
+  # All modules include the main license files from java.base.
+  $(JMOD_TARGETS): java.base-copy
+
   zip-security: java.base-java java.security.jgss-java java.security.jgss-libs 
\
   $(filter jdk.crypto%, $(JAVA_TARGETS))
 



Re: Review Request JDK-8169925: Organize licenses by module in source, JMOD file, and run-time image

2016-12-09 Thread Erik Joelsson

Hello Mandy,

In Copy-java.base.gmk. Modules.gmk is no longer needed. JMOD_* varaibles 
are no longer used.


In Main.gmk, it would be good with a comment explaining why the jmods 
need java.base-copy. Something like:


# All modules include the main license files from java.base.

Otherwise I'm ok with the build changes now.

/Erik

On 2016-12-10 00:19, Mandy Chung wrote:

Erik, Magnus,

I have made the change per your suggestion:
http://cr.openjdk.java.net/~mchung/jdk9/webrevs/8169925/webrev.01/

Jeannette, Jeff, and I went through all .md files and I think asm.md is the 
only one got the characters messed up.  These files are contributed by 
Jeannette.

Also, per Naoto, cldr.md are now in both java.base and jdk.localedata.

thanks
Mandy




Re: Review Request JDK-8169925: Organize licenses by module in source, JMOD file, and run-time image

2016-12-09 Thread Mandy Chung
Erik, Magnus,

I have made the change per your suggestion:
   http://cr.openjdk.java.net/~mchung/jdk9/webrevs/8169925/webrev.01/

Jeannette, Jeff, and I went through all .md files and I think asm.md is the 
only one got the characters messed up.  These files are contributed by 
Jeannette.

Also, per Naoto, cldr.md are now in both java.base and jdk.localedata.

thanks
Mandy

Re: Review Request JDK-8169925: Organize licenses by module in source, JMOD file, and run-time image

2016-12-08 Thread Mandy Chung

> On Dec 8, 2016, at 9:43 AM, Alan Bateman  wrote:
> 
> On 07/12/2016 21:28, Mandy Chung wrote:
> 
>> :
>> 
>> Webrev at:
>>http://cr.openjdk.java.net/~mchung/jdk9/webrevs/8169925/webrev.00/
>> 
>> 
> I went over the changes to the jmod tool, jlink, and the new plugin to dedup 
> legal notices.
> 
> It looks straight-forward, I just wondering about the sym links hat 
> DefaultImageBuilder creates. I think this is the first sym link that a jlink 
> created image will have and just wondering if this could be problematic when 
> run time images are packaged up and transported to different platforms. I 
> guess time will tell.

It creates sym link only when the target platform is not Windows
and the host platform supports it.  We will find out if it turns
out to be problematic.

Mandy



Re: Review Request JDK-8169925: Organize licenses by module in source, JMOD file, and run-time image

2016-12-08 Thread Alan Bateman

On 07/12/2016 21:28, Mandy Chung wrote:


:

Webrev at:
http://cr.openjdk.java.net/~mchung/jdk9/webrevs/8169925/webrev.00/


I went over the changes to the jmod tool, jlink, and the new plugin to 
dedup legal notices.


It looks straight-forward, I just wondering about the sym links hat 
DefaultImageBuilder creates. I think this is the first sym link that a 
jlink created image will have and just wondering if this could be 
problematic when run time images are packaged up and transported to 
different platforms. I guess time will tell.


-Alan


Re: Review Request JDK-8169925: Organize licenses by module in source, JMOD file, and run-time image

2016-12-08 Thread Mandy Chung

> On Dec 8, 2016, at 2:58 AM, Magnus Ihse Bursie 
>  wrote:
> 
> Hi Mandy,
> 
> Some comments.
> 
> * In CreateJmods.gmk, you remove the TODO about headers, but I don't see a 
> resolution to that issue here. If you have opened a bug report for that 
> instead, please let me know the bug ID.
> 

A new JMOD section was introduced to handle header files and man pages in 
JDK-8167558.
See http://mail.openjdk.java.net/pipermail/jigsaw-dev/2016-October/009654.html

I realized now that it was sent to jigsaw-dev only (sorry for missing 
build-dev).

> * The definitions of JDK/JMOD_COPYRIGHT/LICENSE in Modules.gmk seems to be 
> only used in Copy-java.base.gmk. Please move them there.
> 

Will fix.

> *  jdk/src/java.base/share/legal/asm.md seems to have messed up the character 
> set, it's copyright by "France Télécom". Possibly this is a webrev issue, 
> but please make sure it's correct before pushing. (I have just looked at a 
> few license files at random, so maybe you should double-check all of them to 
> make sure there are no other character encoding issues.)
> 

Good catch.  Will double check all of them.

> * Overall, I'm a bit confused about the ".md" suffix on the license files. 
> This seem to indicate that the files are in markdown format. But from what I 
> can tell, they are just the same plain text licenses as before. Several of 
> them, contains text that will be interpreted as markdown markup codes, but 
> will probably result in hideous looks since it's not intentionally markdown 
> formatted.
> 
> It seems that the licenses have a header with properly formatted markdown 
> prepended to them. I strongly suggest that you at the very least put the 
> original license text in code blocks (```  ```).
> 

We will take another pass on these files.  I agree that the original license 
text should be code blocks.  

> Also, is this markdown supposed to be processed into another format? I could 
> find no trace of such processing in the code.

Not in the images build.

This enables a user to run tools like pandoc to aggregate these files and 
generate  a separate document for example one single HTML file seeing all third 
party licenses or other format.

Mandy



Re: Review Request JDK-8169925: Organize licenses by module in source, JMOD file, and run-time image

2016-12-08 Thread Mandy Chung

> On Dec 8, 2016, at 1:44 AM, Erik Joelsson  wrote:
> 
> Hello Mandy,
> 
> In autoconf you are also adding a "man" dir, is this intended with this 
> change?
> 

Strictly speaking this is a separate issue but piggyback it here. This may be 
used when building JDK with JavaFX to import a man page from JavaFX module.  

> In make/InterimImage.gmk, -J-Djlink.debug=true looks like left over debug 
> code.

This is very useful for troubleshooting (that was missed in the changeset of 
JDK-8160359) until my other suggestion to jlink is implemented (always to print 
the stack trace for PluginException).

> 
> make/CreateJmods.gmk: 83-84, please indent 4 spaces for continuation.
> 
> make/Main.gmk: You should not add the dependency there. Instead, add 
> "$(JMOD_TARGETS): java.base-copy" around line 661.
> 
> Copy-java.base.gmk: 246, please finish these kinds of lists with a # indented 
> to the same level as the list of values.
> 

Will fix the above.

Thanks
Mandy

> /Erik
> 
> 
> On 2016-12-07 22:28, Mandy Chung wrote:
>> This proposes to organize license files by module in source, JMOD,
>> and run-time image.
>> 
>> A summary of the proposal:
>> 1. Organize third party notices by module in the source as follows:
>> src/$MODULE/{share,$OS}/legal/*
>>  The `legal` directory contains one file for each third party
>> library in the module, for example,
>> src/java.base/share/legal/asm.md
>>   unicode.md
>>   zlib.md
>> 
>> The proposed template for this file is described in [1] and JEP 201
>> will be updated to reflect this proposed source layout.
>> 
>> 2. Introduce a new LEGAL_NOTICES section in JMOD format. A new jmod
>>option `—-legal-notices` is added to package legal notices in
>>a JMOD file.
>> 
>> 3. At jlink time, jlink will copy all legal notices from JMOD files
>>to the `legal` directory in the run-time image.  A plugin is
>>added to de-duplicate the legal notices if the filename and the
>>content matches that may reduce the image footprint.
>> 
>> 4. THIRD_PARTY_README in the top-level directory of each repo is removed.
>>Manual edit to this file, multiple copies is no longer needed.
>> 
>> Webrev at:
>>http://cr.openjdk.java.net/~mchung/jdk9/webrevs/8169925/webrev.00/
>> 
>> Mandy
>> [1] https://bugs.openjdk.java.net/browse/JDK-8169925
> 



Re: Review Request JDK-8169925: Organize licenses by module in source, JMOD file, and run-time image

2016-12-08 Thread Magnus Ihse Bursie

Hi Mandy,

Some comments.

* In CreateJmods.gmk, you remove the TODO about headers, but I don't see 
a resolution to that issue here. If you have opened a bug report for 
that instead, please let me know the bug ID.


* The definitions of JDK/JMOD_COPYRIGHT/LICENSE in Modules.gmk seems to 
be only used in Copy-java.base.gmk. Please move them there.


*  jdk/src/java.base/share/legal/asm.md seems to have messed up the 
character set, it's copyright by "France Télécom". Possibly this is a 
webrev issue, but please make sure it's correct before pushing. (I have 
just looked at a few license files at random, so maybe you should 
double-check all of them to make sure there are no other character 
encoding issues.)


* Overall, I'm a bit confused about the ".md" suffix on the license 
files. This seem to indicate that the files are in markdown format. But 
from what I can tell, they are just the same plain text licenses as 
before. Several of them, contains text that will be interpreted as 
markdown markup codes, but will probably result in hideous looks since 
it's not intentionally markdown formatted.


It seems that the licenses have a header with properly formatted 
markdown prepended to them. I strongly suggest that you at the very 
least put the original license text in code blocks (```  ```).


Also, is this markdown supposed to be processed into another format? I 
could find no trace of such processing in the code.


/Magnus




On 2016-12-07 22:28, Mandy Chung wrote:

This proposes to organize license files by module in source, JMOD,
and run-time image.

A summary of the proposal:
1. Organize third party notices by module in the source as follows:
 src/$MODULE/{share,$OS}/legal/*
  
The `legal` directory contains one file for each third party

library in the module, for example,
 src/java.base/share/legal/asm.md
   unicode.md
   zlib.md

The proposed template for this file is described in [1] and JEP 201
will be updated to reflect this proposed source layout.

2. Introduce a new LEGAL_NOTICES section in JMOD format. A new jmod
option `—-legal-notices` is added to package legal notices in
a JMOD file.

3. At jlink time, jlink will copy all legal notices from JMOD files
to the `legal` directory in the run-time image.  A plugin is
added to de-duplicate the legal notices if the filename and the
content matches that may reduce the image footprint.

4. THIRD_PARTY_README in the top-level directory of each repo is removed.
Manual edit to this file, multiple copies is no longer needed.

Webrev at:
http://cr.openjdk.java.net/~mchung/jdk9/webrevs/8169925/webrev.00/

Mandy
[1] https://bugs.openjdk.java.net/browse/JDK-8169925




Re: Review Request JDK-8169925: Organize licenses by module in source, JMOD file, and run-time image

2016-12-08 Thread Alan Bateman

On 08/12/2016 09:44, Erik Joelsson wrote:


:

In make/InterimImage.gmk, -J-Djlink.debug=true looks like left over 
debug code.


I'd prefer to keep this as t's really hard to debug issues when jlink 
fails in the build.


-Alan.


Re: Review Request JDK-8169925: Organize licenses by module in source, JMOD file, and run-time image

2016-12-08 Thread Erik Joelsson

Hello Mandy,

In autoconf you are also adding a "man" dir, is this intended with this 
change?


In make/InterimImage.gmk, -J-Djlink.debug=true looks like left over 
debug code.


make/CreateJmods.gmk: 83-84, please indent 4 spaces for continuation.

make/Main.gmk: You should not add the dependency there. Instead, add 
"$(JMOD_TARGETS): java.base-copy" around line 661.


Copy-java.base.gmk: 246, please finish these kinds of lists with a # 
indented to the same level as the list of values.


/Erik


On 2016-12-07 22:28, Mandy Chung wrote:

This proposes to organize license files by module in source, JMOD,
and run-time image.

A summary of the proposal:
1. Organize third party notices by module in the source as follows:
 src/$MODULE/{share,$OS}/legal/*
  
The `legal` directory contains one file for each third party

library in the module, for example,
 src/java.base/share/legal/asm.md
   unicode.md
   zlib.md

The proposed template for this file is described in [1] and JEP 201
will be updated to reflect this proposed source layout.

2. Introduce a new LEGAL_NOTICES section in JMOD format. A new jmod
option `—-legal-notices` is added to package legal notices in
a JMOD file.

3. At jlink time, jlink will copy all legal notices from JMOD files
to the `legal` directory in the run-time image.  A plugin is
added to de-duplicate the legal notices if the filename and the
content matches that may reduce the image footprint.

4. THIRD_PARTY_README in the top-level directory of each repo is removed.
Manual edit to this file, multiple copies is no longer needed.

Webrev at:
http://cr.openjdk.java.net/~mchung/jdk9/webrevs/8169925/webrev.00/

Mandy
[1] https://bugs.openjdk.java.net/browse/JDK-8169925




Re: Review Request JDK-8169925: Organize licenses by module in source, JMOD file, and run-time image

2016-12-07 Thread Naoto Sato

Hi Mandy,

Just noticed that the CLDR license is located under jdk.localedata 
module. That needs to be moved into java.base, as its English resource 
files are derived from CLDR too.


Naoto

On 12/7/16 1:28 PM, Mandy Chung wrote:

This proposes to organize license files by module in source, JMOD,
and run-time image.

A summary of the proposal:
1. Organize third party notices by module in the source as follows:
src/$MODULE/{share,$OS}/legal/*

The `legal` directory contains one file for each third party
library in the module, for example,
src/java.base/share/legal/asm.md
  unicode.md
  zlib.md

The proposed template for this file is described in [1] and JEP 201
will be updated to reflect this proposed source layout.

2. Introduce a new LEGAL_NOTICES section in JMOD format. A new jmod
   option `—-legal-notices` is added to package legal notices in
   a JMOD file.

3. At jlink time, jlink will copy all legal notices from JMOD files
   to the `legal` directory in the run-time image.  A plugin is
   added to de-duplicate the legal notices if the filename and the
   content matches that may reduce the image footprint.

4. THIRD_PARTY_README in the top-level directory of each repo is removed.
   Manual edit to this file, multiple copies is no longer needed.

Webrev at:
   http://cr.openjdk.java.net/~mchung/jdk9/webrevs/8169925/webrev.00/

Mandy
[1] https://bugs.openjdk.java.net/browse/JDK-8169925



Review Request JDK-8169925: Organize licenses by module in source, JMOD file, and run-time image

2016-12-07 Thread Mandy Chung
This proposes to organize license files by module in source, JMOD, 
and run-time image.

A summary of the proposal:
1. Organize third party notices by module in the source as follows:
src/$MODULE/{share,$OS}/legal/*
 
The `legal` directory contains one file for each third party
library in the module, for example,
src/java.base/share/legal/asm.md
  unicode.md
  zlib.md

The proposed template for this file is described in [1] and JEP 201 
will be updated to reflect this proposed source layout.

2. Introduce a new LEGAL_NOTICES section in JMOD format. A new jmod
   option `—-legal-notices` is added to package legal notices in
   a JMOD file.

3. At jlink time, jlink will copy all legal notices from JMOD files
   to the `legal` directory in the run-time image.  A plugin is
   added to de-duplicate the legal notices if the filename and the
   content matches that may reduce the image footprint.

4. THIRD_PARTY_README in the top-level directory of each repo is removed.
   Manual edit to this file, multiple copies is no longer needed.

Webrev at:
   http://cr.openjdk.java.net/~mchung/jdk9/webrevs/8169925/webrev.00/

Mandy
[1] https://bugs.openjdk.java.net/browse/JDK-8169925