RFR: Module constraints on targets
Chris Hegarty
chris.hegarty at oracle.com
Tue Oct 16 10:08:25 PDT 2012
On 10/16/2012 05:38 PM, mark.reinhold at oracle.com wrote:
> 2012/10/11 9:37 -0700, chris.hegarty at oracle.com:
>> 1) Extend the Jigsaw module-file format [2] (jmod) to accommodate Operating
>> System and Architecture values in the module header.
>>
>> ModuleFileHeader {
>> ...
>> u2 osLength; // Length of following Operating System, in bytes <<< ADDED
>> b* os; // Operating System, in Java-modified UTF-8 <<< ADDED
>> u2 archLength; // Length of following Architecture, in bytes <<< ADDED
>> b* arch; // Architecture, in Java-modified UTF-8 <<< ADDED
>> }
>>
>> The os and arch values are Java-modified UTF-8 strings, representing the
>> Operating System and Architecture where the module-file/library is intended to
>> be deployed.
>>
>> A value of 0 is a valid value for both osLength and archLength. This
>> effectively means that these values are unset, and the module-file/library is
>> agnostic of Operating System and Architecture. It should be considered a
>> candidate for any module library.
>
> Is it valid to specify an OS but not an architecture, or the other way
> around?
The current implementation/webrev supports optionally specifying an OS
or Architecture.
> You can write OS-dependent code in otherwise pure Java, so we should
> allow osLength > 0 && archLength == 0.
>
> If you specify an architecture, however, then you must specify an OS,
> so archLength > 0 implies osLength > 0.
Makes sense, I'll update the tools to enforce this restriction.
>
>> 2) Update CLIs
>>
>> Both jmod and jpkg need to be updated to support passing of os and arch values
>> during creation.
>>
>> Define two new arguments -os, -arch for both jmod and jpkg. These arguments are
>> optional. If specified, can only be specified once. For example:
>>
>> ./bin/jmod create -L m.lib -os linux -arch x64
>
> Please stick to the existing GNU-style option syntax: These should be
> --os and --arch.
Yes, will do.
>
>> ./bin/jmod id -L m.lib
>> path /export/chris/repos/jigsaw/constraints/test/m.lib
>> version 0.1
>> os: linux
>> arch: x64
>
> s/os:/os/
> s/arch:/arch/
Got it.
>
>> ...
>>
>> Webrev:
>> http://cr.openjdk.java.net/~chegar/jigsaw/constraints.00/webrev/
>
> I'll have a closer look at this shortly.
Thanks, I won't update the webrev yet, with the above comments, until
you get back on this.
-Chris.
>
> - Mark
>
More information about the jigsaw-dev
mailing list