You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@harmony.apache.org by Alex Blewitt <al...@gmail.com> on 2006/06/11 23:54:59 UTC

Pack200 -- can now read constant pool header

Well, I'm about half way through being able to read my HelloWorld.jar
file; I've got the basic codec working, as well as decoding the
constant pools that come at the front of an archive. There's still
some missing bits -- for example, I don't handle the s=2 set of
encodings (largely because I'm not quite sure I understand from the
spec how I'm supposed to treat them) and there's a really interesting
feature of band encodings which says that they can be encoded
arbitrarily by sending an effective escape character ... but
fortunately, I don't have any of those in the simple case.

Whilst it's no-where near ready (and may be ripe for several
refactorings yet) is it worth taking what I've done and putting it in
SVN so that others can see/play around with it? Unfortunately, it's a
bit of a linear process since they're all variable length encodings;
so you have do decode part N before you can decode part N+1. On the
other hand, if anyone wanted to work on a compressor then that's a
parallel activity ...

Anyway, I'm assuming that it might need a new directory under
/classlib/ for storing the pack200 stuff (hopefully so that it can be
used as a standalone module e.g. for providing the command line tool)
so there's a bit of administrivia to sort out; hopefully, someone here
can help me with that :-) I should also point out that I've not tried
compiling/running it with the harmony VM -- largely because there
isn't one on a Mac (yet) so I'm working with the standard
Eclipse+Apple VM. There's a danger that my code might inadvertently
break the build, therefore :-/

I've also got to format the code and put the Apache copyright headers
on -- I don't mind doing that prior to making a zip and attaching it
in JIRA (which I'm assuming is the right process for initial uploads).
If someone could point me in the right direction for where those are,
that would be helpful.

Alex.

---------------------------------------------------------------------
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
For additional commands, e-mail: harmony-dev-help@incubator.apache.org


Re: Pack200 -- can now read constant pool header

Posted by Geir Magnusson Jr <ge...@pobox.com>.
1) Please put [classlib] or whatever sort token is appropriate.

2) To answer your question, yes, it would be very cool to post as  JIRA
so people can see it and comment, and maybe get someone to help you.
I'd be happy to drop into svn somewhere so you and others can start
submitting patches against it.

3) The header :

Copyright 2006 The Apache Software Foundation or its licensors, as
applicable.

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.

Commented out as appropos.  TO make it easy, just lift from any of the
java code that's already in SVN.

BTW... very cool.. well done.

geir


Alex Blewitt wrote:
> Well, I'm about half way through being able to read my HelloWorld.jar
> file; I've got the basic codec working, as well as decoding the
> constant pools that come at the front of an archive. There's still
> some missing bits -- for example, I don't handle the s=2 set of
> encodings (largely because I'm not quite sure I understand from the
> spec how I'm supposed to treat them) and there's a really interesting
> feature of band encodings which says that they can be encoded
> arbitrarily by sending an effective escape character ... but
> fortunately, I don't have any of those in the simple case.
> 
> Whilst it's no-where near ready (and may be ripe for several
> refactorings yet) is it worth taking what I've done and putting it in
> SVN so that others can see/play around with it? Unfortunately, it's a
> bit of a linear process since they're all variable length encodings;
> so you have do decode part N before you can decode part N+1. On the
> other hand, if anyone wanted to work on a compressor then that's a
> parallel activity ...
> 
> Anyway, I'm assuming that it might need a new directory under
> /classlib/ for storing the pack200 stuff (hopefully so that it can be
> used as a standalone module e.g. for providing the command line tool)
> so there's a bit of administrivia to sort out; hopefully, someone here
> can help me with that :-) I should also point out that I've not tried
> compiling/running it with the harmony VM -- largely because there
> isn't one on a Mac (yet) so I'm working with the standard
> Eclipse+Apple VM. There's a danger that my code might inadvertently
> break the build, therefore :-/
> 
> I've also got to format the code and put the Apache copyright headers
> on -- I don't mind doing that prior to making a zip and attaching it
> in JIRA (which I'm assuming is the right process for initial uploads).
> If someone could point me in the right direction for where those are,
> that would be helpful.
> 
> Alex.
> 
> ---------------------------------------------------------------------
> Terms of use : http://incubator.apache.org/harmony/mailing.html
> To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
> For additional commands, e-mail: harmony-dev-help@incubator.apache.org
> 
> 

---------------------------------------------------------------------
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
For additional commands, e-mail: harmony-dev-help@incubator.apache.org


Re: Pack200 -- can now read constant pool header

Posted by Thorbjørn Ravn Andersen <th...@gmail.com>.
Geir Magnusson Jr skrev  den 12-06-2006 20:10:
>
> Would be a nifty feature - to tell your IDE to ignore a file...
>   
Eclipse can do that.  Right click on given Java file, and locate the 
"Remove from Build Path" menu item.

Very handy in a pinch.


-- 
  Thorbjørn


Re: Pack200 -- can now read constant pool header

Posted by Geir Magnusson Jr <ge...@pobox.com>.

Tim Ellison wrote:
> Geir Magnusson Jr wrote:
>> Tim Ellison wrote:
>>> Geir Magnusson Jr wrote:
>>>> Tim Ellison wrote:
>>>>> Since we want to keep ARCHIVE working throughout we can create a branch
>>>>> if you think the pack200 dev will be dangerous (I think we can handle it
>>>>> in-place, but whatever).
>>>> Why a branch?  can it just be out of the mainline build?  IOW, excluded
>>>> for everyone else in the build?
>>> ARCHIVE is already in the mainline build and contains jar/zip support,
>>> we don't want to exclude that.
>> That wasn't what I meant.  I meant excluding the single file(s) that
>> cause the problem.
> 
> Well you /could/ but I would claim that is not very desirable, since we
> would have to back out some changes in the existing built code for
> pack200, convince each IDE that not all files in the src/main were to be
> compiled, remember that there is an out-of-line set of files for archive
> etc.  Sounds like a form of branching without really doing it.
> 
> ...but I expect that we won't need any of this, I'm sure Alex can cope ;-)

Would be a nifty feature - to tell your IDE to ignore a file...

> 
> Alex: can you send what you have done so far?
> 
>>>> (Or just make Alex keep it working :)
>>> That would be my preference -- the committer that applies the patch and
>>> the continuous build can check win/linux compilation.  If 'keeping it
>>> working' is too onerous, then branch.
>> Or get help :)
> 
> Of course!
> 
> Regards,
> Tim
> 

---------------------------------------------------------------------
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
For additional commands, e-mail: harmony-dev-help@incubator.apache.org


Re: Pack200 -- can now read constant pool header

Posted by Tim Ellison <t....@gmail.com>.
Alex Blewitt wrote:
<snip>
> I've created Harmony 599
> (http://issues.apache.org/jira/browse/HARMONY-599) with a zip of what
> I've done so far. I don't believe that it has compile errors, and the
> tests run OK -- it's just if I depend on a method/class that's not yet
> available in the classpath build. Hopefully it should be relatively
> easy to fix, and if I do contribute a breaking patch via JIRA then
> whoever applies it should be able to tell me before it goes live.

It is now in our mainline build and test cycle and looks good, thanks Alex!

I tweaked the package names to fit in with the project conventions, and
renamed the test types from TestFoo to FooTest because that is the
pattern our test scripts will look for.

You may want to now get the latest code from the ARCHIVE module and
check what I did, and apply patches from there.

>> >>> (Or just make Alex keep it working :)
>> >> That would be my preference -- the committer that applies the patch
>> and
>> >> the continuous build can check win/linux compilation.  If 'keeping it
>> >> working' is too onerous, then branch.
> 
> I guess that if it doesn't work at first, drop me a line and let me
> know so that I can try to work around it. For example, I link in the
> JavaDoc to java.io.GZipInputStream#MAGIC_BYTES or something, which
> might cause an issue if that's not there or been implemented yet. Most
> of it is byte-munging anyway; a bit of StringBuffer here and there,
> and io.read(). Not really that much.

Works like a charm -- thanks.

Regards,
Tim

-- 

Tim Ellison (t.p.ellison@gmail.com)
IBM Java technology centre, UK.

---------------------------------------------------------------------
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
For additional commands, e-mail: harmony-dev-help@incubator.apache.org


Re: Pack200 -- can now read constant pool header

Posted by Alex Blewitt <al...@gmail.com>.
> > That wasn't what I meant.  I meant excluding the single file(s) that
> > cause the problem.
>
> Well you /could/ but I would claim that is not very desirable, since we
> would have to back out some changes in the existing built code for
> pack200, convince each IDE that not all files in the src/main were to be
> compiled, remember that there is an out-of-line set of files for archive
> etc.  Sounds like a form of branching without really doing it.
>
> ...but I expect that we won't need any of this, I'm sure Alex can cope ;-)

Hope so. Not necessarily always timely (my day job tends to run into
my night job occasionally) but sooner rather than later.

> Alex: can you send what you have done so far?

I've created Harmony 599
(http://issues.apache.org/jira/browse/HARMONY-599) with a zip of what
I've done so far. I don't believe that it has compile errors, and the
tests run OK -- it's just if I depend on a method/class that's not yet
available in the classpath build. Hopefully it should be relatively
easy to fix, and if I do contribute a breaking patch via JIRA then
whoever applies it should be able to tell me before it goes live.

> >>> (Or just make Alex keep it working :)
> >> That would be my preference -- the committer that applies the patch and
> >> the continuous build can check win/linux compilation.  If 'keeping it
> >> working' is too onerous, then branch.

I guess that if it doesn't work at first, drop me a line and let me
know so that I can try to work around it. For example, I link in the
JavaDoc to java.io.GZipInputStream#MAGIC_BYTES or something, which
might cause an issue if that's not there or been implemented yet. Most
of it is byte-munging anyway; a bit of StringBuffer here and there,
and io.read(). Not really that much.

Alex.

---------------------------------------------------------------------
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
For additional commands, e-mail: harmony-dev-help@incubator.apache.org


Re: Pack200 -- can now read constant pool header

Posted by Tim Ellison <t....@gmail.com>.
Geir Magnusson Jr wrote:
> 
> Tim Ellison wrote:
>> Geir Magnusson Jr wrote:
>>> Tim Ellison wrote:
>>>> Since we want to keep ARCHIVE working throughout we can create a branch
>>>> if you think the pack200 dev will be dangerous (I think we can handle it
>>>> in-place, but whatever).
>>> Why a branch?  can it just be out of the mainline build?  IOW, excluded
>>> for everyone else in the build?
>> ARCHIVE is already in the mainline build and contains jar/zip support,
>> we don't want to exclude that.
> 
> That wasn't what I meant.  I meant excluding the single file(s) that
> cause the problem.

Well you /could/ but I would claim that is not very desirable, since we
would have to back out some changes in the existing built code for
pack200, convince each IDE that not all files in the src/main were to be
compiled, remember that there is an out-of-line set of files for archive
etc.  Sounds like a form of branching without really doing it.

...but I expect that we won't need any of this, I'm sure Alex can cope ;-)

Alex: can you send what you have done so far?

>>> (Or just make Alex keep it working :)
>> That would be my preference -- the committer that applies the patch and
>> the continuous build can check win/linux compilation.  If 'keeping it
>> working' is too onerous, then branch.
> 
> Or get help :)

Of course!

Regards,
Tim

-- 

Tim Ellison (t.p.ellison@gmail.com)
IBM Java technology centre, UK.


---------------------------------------------------------------------
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
For additional commands, e-mail: harmony-dev-help@incubator.apache.org


Re: Pack200 -- can now read constant pool header

Posted by Geir Magnusson Jr <ge...@pobox.com>.

Tim Ellison wrote:
> Geir Magnusson Jr wrote:
>> Tim Ellison wrote:
>>> Since we want to keep ARCHIVE working throughout we can create a branch
>>> if you think the pack200 dev will be dangerous (I think we can handle it
>>> in-place, but whatever).
>> Why a branch?  can it just be out of the mainline build?  IOW, excluded
>> for everyone else in the build?
> 
> ARCHIVE is already in the mainline build and contains jar/zip support,
> we don't want to exclude that.

That wasn't what I meant.  I meant excluding the single file(s) that
cause the problem.

> 
>> (Or just make Alex keep it working :)
> 
> That would be my preference -- the committer that applies the patch and
> the continuous build can check win/linux compilation.  If 'keeping it
> working' is too onerous, then branch.

Or get help :)

geir

> 
> Regards,
> Tim
> 


---------------------------------------------------------------------
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
For additional commands, e-mail: harmony-dev-help@incubator.apache.org


Re: Pack200 -- can now read constant pool header

Posted by Tim Ellison <t....@gmail.com>.
Geir Magnusson Jr wrote:
> 
> Tim Ellison wrote:
>> Since we want to keep ARCHIVE working throughout we can create a branch
>> if you think the pack200 dev will be dangerous (I think we can handle it
>> in-place, but whatever).
> 
> Why a branch?  can it just be out of the mainline build?  IOW, excluded
> for everyone else in the build?

ARCHIVE is already in the mainline build and contains jar/zip support,
we don't want to exclude that.

> (Or just make Alex keep it working :)

That would be my preference -- the committer that applies the patch and
the continuous build can check win/linux compilation.  If 'keeping it
working' is too onerous, then branch.

Regards,
Tim

-- 

Tim Ellison (t.p.ellison@gmail.com)
IBM Java technology centre, UK.

---------------------------------------------------------------------
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
For additional commands, e-mail: harmony-dev-help@incubator.apache.org


Re: Pack200 -- can now read constant pool header

Posted by Geir Magnusson Jr <ge...@pobox.com>.

Tim Ellison wrote:
> 
> Since we want to keep ARCHIVE working throughout we can create a branch
> if you think the pack200 dev will be dangerous (I think we can handle it
> in-place, but whatever).

Why a branch?  can it just be out of the mainline build?  IOW, excluded
for everyone else in the build?

(Or just make Alex keep it working :)

geir



---------------------------------------------------------------------
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
For additional commands, e-mail: harmony-dev-help@incubator.apache.org


Re: Pack200 -- can now read constant pool header

Posted by Tim Ellison <t....@gmail.com>.
Alex Blewitt wrote:
> Well, I'm about half way through being able to read my HelloWorld.jar
> file; I've got the basic codec working, as well as decoding the
> constant pools that come at the front of an archive. There's still
> some missing bits -- for example, I don't handle the s=2 set of
> encodings (largely because I'm not quite sure I understand from the
> spec how I'm supposed to treat them) and there's a really interesting
> feature of band encodings which says that they can be encoded
> arbitrarily by sending an effective escape character ... but
> fortunately, I don't have any of those in the simple case.
> 
> Whilst it's no-where near ready (and may be ripe for several
> refactorings yet) is it worth taking what I've done and putting it in
> SVN so that others can see/play around with it? Unfortunately, it's a
> bit of a linear process since they're all variable length encodings;
> so you have do decode part N before you can decode part N+1. On the
> other hand, if anyone wanted to work on a compressor then that's a
> parallel activity ...
> 
> Anyway, I'm assuming that it might need a new directory under
> /classlib/ for storing the pack200 stuff (hopefully so that it can be
> used as a standalone module e.g. for providing the command line tool)

Since it is part of the SE API too I suggest that we put it directly
into ARCHIVE and then let the command-line tool use it from there.

Since we want to keep ARCHIVE working throughout we can create a branch
if you think the pack200 dev will be dangerous (I think we can handle it
in-place, but whatever).

Regards,
Tim

> so there's a bit of administrivia to sort out; hopefully, someone here
> can help me with that :-) I should also point out that I've not tried
> compiling/running it with the harmony VM -- largely because there
> isn't one on a Mac (yet) so I'm working with the standard
> Eclipse+Apple VM. There's a danger that my code might inadvertently
> break the build, therefore :-/
> 
> I've also got to format the code and put the Apache copyright headers
> on -- I don't mind doing that prior to making a zip and attaching it
> in JIRA (which I'm assuming is the right process for initial uploads).
> If someone could point me in the right direction for where those are,
> that would be helpful.
> 
> Alex.
> 
> ---------------------------------------------------------------------
> Terms of use : http://incubator.apache.org/harmony/mailing.html
> To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
> For additional commands, e-mail: harmony-dev-help@incubator.apache.org
> 
> 

-- 

Tim Ellison (t.p.ellison@gmail.com)
IBM Java technology centre, UK.

---------------------------------------------------------------------
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
For additional commands, e-mail: harmony-dev-help@incubator.apache.org