Howto re-compile ony parts?

Jonathan Gibbons Jonathan.Gibbons at Sun.COM
Sat May 10 21:17:12 UTC 2008


Kelly,

As well as looking into parallelizing (parts of) javac, javac can also  
provide
all the dependency info you need if you know how to get it. (Hint:  
this means writing
code.)  I'm hoping to write up a description of how to do this sooner  
rather than later.

With the right code, you could make a very simple wrapper for javac  
that would
accurately compile the correct subset of files that needed to be  
compiled.

-- Jon


On May 10, 2008, at 11:43 AM, Kelly O'Hair wrote:

> We already use 'make -j' when building the .o files, and the  
> dependencies
> should be ok for the .o files. So for native compilations I don't
> think we have a problem.
>
> But with Java building, it's not clear 'make -j' is the answer or will
> even work.
> First, a .java can create multiple .class files, and second all the
> javac builds read and write to the classes directory.
> If a bunch of javac compilations were done in parallel I don't think
> it would be a pretty sight. In general, make and java compilation
> has always been complicated or non-robust to say the least.
>
> Most people don't realize that compiling an explicit list of sources
> can sometimes compile more than that, and that often the output  
> directory
> is also used in the classpath as an input directory.
> You might think this is a bad idea, but it's done, has been for some  
> time.
>
> There are multiple possibilities for improving the javac compile time,
> but doing it via make is not on my list.
> We would like to look into javamake (soon to be open sourced)
>   http://www.experimentalstuff.com/Technologies/JavaMake/index.html
> which does the right thing in terms of incremental builds.
> It could be used with ant, or run directly from the makefiles.
>
> And the javac team may be looking into actually paralizing the  
> internals
> of javac soon, which would help without changing any build procedures.
>
> -kto
>
> Andrew Haley wrote:
>> Martin Buchholz wrote:
>>> Unfortunately, incremental builds by running make in subdirectories
>>> have historically been quite unreliable, and it has never been  
>>> highest priority
>>> to fix them.  Developers often do (at least in the jdk repository)
>>> - try incremental build; it might work...
>>> - else back off to rebuilding everything;
>>>  cd jdk/make; make clobber all
>>>
>>> You could try to fix all of the subdirectory makefiles, but that's  
>>> an
>>> enormous job.
>>> For bonus points, you could try to fix the architecture of the
>>> recursive makes themselves
>>> using the ideas in "Recursive Make Considered Harmful"
>>> http://miller.emu.id.au/pmiller/books/rmch/
>> Mmm.  Surely if anyone is going to hack on the makefiles the first  
>> thing
>> to do is to fix the dependencies so that "make -j" works properly.
>> Andrew.




More information about the build-dev mailing list