RFR: 8293116: Incremental JDK build could be sped up [v5]
Jan Lahoda
jlahoda at openjdk.org
Mon Sep 12 20:37:51 UTC 2022
On Fri, 9 Sep 2022 11:41:08 GMT, Jan Lahoda <jlahoda at openjdk.org> wrote:
>> Currently, when doing a small change inside a module that does not affect the API of the module, the build system will skip rebuild of the dependent modules. If there's a change that affects the module's API, the dependent modules are recompiled. So far, this seems to work reasonably.
>>
>> But, for large modules, like `java.base`, any change to any of the module's sources will cause a full rebuild of that module, which may take tens of seconds. This patch strives to improve that, by:
>> -parsing only sources that were modified first,
>> -computing an "API" hash for them,
>> -if there is not a significant change in the file(s), only recompile the files, if there are significant changes to the files, recompile the whole module, as before
>>
>> There is no attempt made to determine the minimal set of files that needs to be reparsed, all module's files are reparsed when the internal API check fails. This is in line with the existing code to skip the build of dependent modules.
>>
>> Sadly, this is overall a bit more difficult to do, so the implementation uses some javac internals. The existing build-only `Depend` plugin is enhanced so that parsing of the initial files is redirected to go through the plugin, and it decides parses either only the modified files, or all files. This redirection requires a change to `main/JavaCompiler`, which is not in the boot JDK, so reflection is currently used to install the redirection. Once the new classes are in a boot JDK, we could clean up, and avoid the reflection.
>>
>> On my laptop, doing:
>>
>> touch src/java.base/share/classes/java/lang/Object.java ; time make
>>
>> can take well over 30s without this patch. With this patch, it takes <5s for me. Changes to e.g. only method bodies should typically not require rebuild of the whole module.
>>
>> The caveats of this patch include:
>> -it is more involved than the existing plugin
>> -it only speeds up only incremental Java compilation, so the other tasks the build system is doing when running `make`, like timestamp checks or starting the build server, are still happening. This may slow down builds on platforms with slow I/O
>> -for modules that are part of the interim toolchain (like jdk.compiler), the interim build is not using this new approach, and it will likely be slow. We might try to improve once the required hooks are part of the boot JDK
>> -as the check for modified "internal" API cannot use attribution (as it runs too early), it tries to be safe, and will mark some changes as "internal API changes", even if they in fact don't affect the file's API. This may be especially true for some changes to imports.
>> -it is necessary to store an (internal) API hash for every file, in addition to one for every module which is stored currently
>
> Jan Lahoda has updated the pull request incrementally with one additional commit since the last revision:
>
> Regenerating modfiles as necessary.
I ran some tests (in a semi-automated fashion), results seem reasonable:
## Non-API change in java.base:
sed -e 's/^}//* */}/' <src/java.base/share/classes/java/lang/Object.java.orig >src/java.base/share/classes/java/lang/Object.java
time make
result:
Building target 'default (exploded-image)' in configuration 'linux-x86_64-server-release'
Compiling up to 3192 files for java.base
[stderr] compiling module: java.base, all Java inputs: 3192, modified files (Java or non-Java): 1, full recompile: false, non-Java modified files:
Stopping sjavac server
Finished building target 'default (exploded-image)' in configuration 'linux-x86_64-server-release'
real 0m3,414s
user 0m5,188s
sys 0m1,328s
## Non-API change in java.compiler:
sed -e 's/^}//* */}/' <src/java.compiler/share/classes/javax/lang/model/util/ElementFilter.java.orig >src/java.compiler/share/classes/javax/lang/model/util/ElementFilter.java
time make
result:
Building target 'default (exploded-image)' in configuration 'linux-x86_64-server-release'
Compiling up to 127 files for BUILD_java.compiler.interim
Compiling up to 127 files for java.compiler
[stderr] compiling module: java.compiler, all Java inputs: 127, modified files (Java or non-Java): 1, full recompile: false, non-Java modified files:
Stopping sjavac server
Finished building target 'default (exploded-image)' in configuration 'linux-x86_64-server-release'
real 0m15,530s
user 0m22,948s
sys 0m2,337s
## Package-private method added to java.base:
sed -e 's/^}/static void testMethod() {} }/' <src/java.compiler/share/classes/javax/lang/model/util/ElementFilter.java.orig >src/java.compiler/share/classes/javax/lang/model/util/ElementFilter.java
time make
result:
Building target 'default (exploded-image)' in configuration 'linux-x86_64-server-release'
Compiling up to 3192 files for java.base
[stderr] compiling module: java.base, all Java inputs: 3192, modified files (Java or non-Java): 1, full recompile: true, non-Java modified files:
Optimizing the exploded image
Stopping sjavac server
Finished building target 'default (exploded-image)' in configuration 'linux-x86_64-server-release'
real 0m30,190s
user 0m6,852s
sys 0m1,548s
## Package-private method added to java.compiler:
sed -e 's/^}/static void testMethod() {} }/' <src/java.compiler/share/classes/javax/lang/model/util/ElementFilter.java.orig >src/java.compiler/share/classes/javax/lang/model/util/ElementFilter.java
time make | tee -a test-output
result:
Building target 'default (exploded-image)' in configuration 'linux-x86_64-server-release'
Compiling up to 127 files for BUILD_java.compiler.interim
Compiling up to 127 files for java.compiler
[stderr] compiling module: java.compiler, all Java inputs: 127, modified files (Java or non-Java): 1, full recompile: true, non-Java modified files:
Optimizing the exploded image
Stopping sjavac server
Finished building target 'default (exploded-image)' in configuration 'linux-x86_64-server-release'
real 0m17,368s
user 0m23,831s
sys 0m2,328s
## Public method added to java.base:
sed -e 's/^}//** test. */public static void testMethod() {} }/' <src/java.base/share/classes/java/lang/Object.java.orig >src/java.base/share/classes/java/lang/Object.java
time make
result:
Building target 'default (exploded-image)' in configuration 'linux-x86_64-server-release'
Compiling up to 3192 files for java.base
[stderr] compiling module: java.base, all Java inputs: 3192, modified files (Java or non-Java): 1, full recompile: true, non-Java modified files:
[stderr] compiling module: java.datatransfer, all Java inputs: 18, modified files (Java or non-Java): 1, full recompile: true, non-Java modified files: /home/jlahoda/src/jdk/jdk/build/linux-x86_64-server-release/jdk/modules/java.base/_the.java.base_pubapi
[stderr] compiling module: java.instrument, all Java inputs: 10, modified files (Java or non-Java): 1, full recompile: true, non-Java modified files: /home/jlahoda/src/jdk/jdk/build/linux-x86_64-server-release/jdk/modules/java.base/_the.java.base_pubapi
[stderr] compiling module: java.logging, all Java inputs: 35, modified files (Java or non-Java): 1, full recompile: true, non-Java modified files: /home/jlahoda/src/jdk/jdk/build/linux-x86_64-server-release/jdk/modules/java.base/_the.java.base_pubapi
[stderr] compiling module: java.compiler, all Java inputs: 127, modified files (Java or non-Java): 1, full recompile: true, non-Java modified files: /home/jlahoda/src/jdk/jdk/build/linux-x86_64-server-release/jdk/modules/java.base/_the.java.base_pubapi
[stderr] compiling module: java.scripting, all Java inputs: 15, modified files (Java or non-Java): 1, full recompile: true, non-Java modified files: /home/jlahoda/src/jdk/jdk/build/linux-x86_64-server-release/jdk/modules/java.base/_the.java.base_pubapi
[stderr] compiling module: java.net.http, all Java inputs: 142, modified files (Java or non-Java): 1, full recompile: true, non-Java modified files: /home/jlahoda/src/jdk/jdk/build/linux-x86_64-server-release/jdk/modules/java.base/_the.java.base_pubapi
[stderr] compiling module: java.management, all Java inputs: 330, modified files (Java or non-Java): 1, full recompile: true, non-Java modified files: /home/jlahoda/src/jdk/jdk/build/linux-x86_64-server-release/jdk/modules/java.base/_the.java.base_pubapi
[stderr] compiling module: java.transaction.xa, all Java inputs: 5, modified files (Java or non-Java): 1, full recompile: true, non-Java modified files: /home/jlahoda/src/jdk/jdk/build/linux-x86_64-server-release/jdk/modules/java.base/_the.java.base_pubapi
[stderr] compiling module: java.smartcardio, all Java inputs: 22, modified files (Java or non-Java): 1, full recompile: true, non-Java modified files: /home/jlahoda/src/jdk/jdk/build/linux-x86_64-server-release/jdk/modules/java.base/_the.java.base_pubapi
[stderr] compiling module: jdk.internal.jvmstat, all Java inputs: 61, modified files (Java or non-Java): 1, full recompile: true, non-Java modified files: /home/jlahoda/src/jdk/jdk/build/linux-x86_64-server-release/jdk/modules/java.base/_the.java.base_pubapi
[stderr] compiling module: jdk.zipfs, all Java inputs: 14, modified files (Java or non-Java): 1, full recompile: true, non-Java modified files: /home/jlahoda/src/jdk/jdk/build/linux-x86_64-server-release/jdk/modules/java.base/_the.java.base_pubapi
[stderr] compiling module: jdk.charsets, all Java inputs: 120, modified files (Java or non-Java): 1, full recompile: true, non-Java modified files: /home/jlahoda/src/jdk/jdk/build/linux-x86_64-server-release/jdk/modules/java.base/_the.java.base_pubapi
[stderr] compiling module: jdk.crypto.ec, all Java inputs: 35, modified files (Java or non-Java): 1, full recompile: true, non-Java modified files: /home/jlahoda/src/jdk/jdk/build/linux-x86_64-server-release/jdk/modules/java.base/_the.java.base_pubapi
[stderr] compiling module: java.xml, all Java inputs: 1848, modified files (Java or non-Java): 1, full recompile: true, non-Java modified files: /home/jlahoda/src/jdk/jdk/build/linux-x86_64-server-release/jdk/modules/java.base/_the.java.base_pubapi
[stderr] compiling module: jdk.internal.ed, all Java inputs: 3, modified files (Java or non-Java): 1, full recompile: true, non-Java modified files: /home/jlahoda/src/jdk/jdk/build/linux-x86_64-server-release/jdk/modules/java.base/_the.java.base_pubapi
[stderr] compiling module: jdk.dynalink, all Java inputs: 68, modified files (Java or non-Java): 1, full recompile: true, non-Java modified files: /home/jlahoda/src/jdk/jdk/build/linux-x86_64-server-release/jdk/modules/java.base/_the.java.base_pubapi
[stderr] compiling module: jdk.httpserver, all Java inputs: 60, modified files (Java or non-Java): 1, full recompile: true, non-Java modified files: /home/jlahoda/src/jdk/jdk/build/linux-x86_64-server-release/jdk/modules/java.base/_the.java.base_pubapi
[stderr] compiling module: jdk.incubator.concurrent, all Java inputs: 4, modified files (Java or non-Java): 1, full recompile: true, non-Java modified files: /home/jlahoda/src/jdk/jdk/build/linux-x86_64-server-release/jdk/modules/java.base/_the.java.base_pubapi
[stderr] compiling module: jdk.internal.opt, all Java inputs: 51, modified files (Java or non-Java): 1, full recompile: true, non-Java modified files: /home/jlahoda/src/jdk/jdk/build/linux-x86_64-server-release/jdk/modules/java.base/_the.java.base_pubapi
[stderr] compiling module: jdk.incubator.vector, all Java inputs: 50, modified files (Java or non-Java): 1, full recompile: true, non-Java modified files: /home/jlahoda/src/jdk/jdk/build/linux-x86_64-server-release/jdk/modules/java.base/_the.java.base_pubapi
[stderr] compiling module: jdk.internal.le, all Java inputs: 103, modified files (Java or non-Java): 1, full recompile: true, non-Java modified files: /home/jlahoda/src/jdk/jdk/build/linux-x86_64-server-release/jdk/modules/java.base/_the.java.base_pubapi
[stderr] compiling module: jdk.jartool, all Java inputs: 31, modified files (Java or non-Java): 1, full recompile: true, non-Java modified files: /home/jlahoda/src/jdk/jdk/build/linux-x86_64-server-release/jdk/modules/java.base/_the.java.base_pubapi
[stderr] compiling module: jdk.internal.vm.ci, all Java inputs: 203, modified files (Java or non-Java): 1, full recompile: true, non-Java modified files: /home/jlahoda/src/jdk/jdk/build/linux-x86_64-server-release/jdk/modules/java.base/_the.java.base_pubapi
[stderr] compiling module: jdk.management, all Java inputs: 24, modified files (Java or non-Java): 1, full recompile: true, non-Java modified files: /home/jlahoda/src/jdk/jdk/build/linux-x86_64-server-release/jdk/modules/java.base/_the.java.base_pubapi
[stderr] compiling module: jdk.jdwp.agent, all Java inputs: 1, modified files (Java or non-Java): 1, full recompile: true, non-Java modified files: /home/jlahoda/src/jdk/jdk/build/linux-x86_64-server-release/jdk/modules/java.base/_the.java.base_pubapi
[stderr] compiling module: jdk.jfr, all Java inputs: 260, modified files (Java or non-Java): 1, full recompile: true, non-Java modified files: /home/jlahoda/src/jdk/jdk/build/linux-x86_64-server-release/jdk/modules/java.base/_the.java.base_pubapi
[stderr] compiling module: jdk.jsobject, all Java inputs: 4, modified files (Java or non-Java): 1, full recompile: true, non-Java modified files: /home/jlahoda/src/jdk/jdk/build/linux-x86_64-server-release/jdk/modules/java.base/_the.java.base_pubapi
[stderr] compiling module: jdk.net, all Java inputs: 9, modified files (Java or non-Java): 1, full recompile: true, non-Java modified files: /home/jlahoda/src/jdk/jdk/build/linux-x86_64-server-release/jdk/modules/java.base/_the.java.base_pubapi
[stderr] compiling module: jdk.nio.mapmode, all Java inputs: 2, modified files (Java or non-Java): 1, full recompile: true, non-Java modified files: /home/jlahoda/src/jdk/jdk/build/linux-x86_64-server-release/jdk/modules/java.base/_the.java.base_pubapi
[stderr] compiling module: jdk.random, all Java inputs: 11, modified files (Java or non-Java): 1, full recompile: true, non-Java modified files: /home/jlahoda/src/jdk/jdk/build/linux-x86_64-server-release/jdk/modules/java.base/_the.java.base_pubapi
[stderr] compiling module: jdk.sctp, all Java inputs: 33, modified files (Java or non-Java): 1, full recompile: true, non-Java modified files: /home/jlahoda/src/jdk/jdk/build/linux-x86_64-server-release/jdk/modules/java.base/_the.java.base_pubapi
[stderr] compiling module: jdk.unsupported, all Java inputs: 9, modified files (Java or non-Java): 1, full recompile: true, non-Java modified files: /home/jlahoda/src/jdk/jdk/build/linux-x86_64-server-release/jdk/modules/java.base/_the.java.base_pubapi
[stderr] compiling module: java.security.sasl, all Java inputs: 30, modified files (Java or non-Java): 1, full recompile: true, non-Java modified files: /home/jlahoda/src/jdk/jdk/build/linux-x86_64-server-release/jdk/modules/java.base/_the.java.base_pubapi
[stderr] compiling module: java.rmi, all Java inputs: 106, modified files (Java or non-Java): 1, full recompile: true, non-Java modified files: /home/jlahoda/src/jdk/jdk/build/linux-x86_64-server-release/jdk/modules/java.base/_the.java.base_pubapi
[stderr] compiling module: jdk.attach, all Java inputs: 15, modified files (Java or non-Java): 1, full recompile: true, non-Java modified files: /home/jlahoda/src/jdk/jdk/build/linux-x86_64-server-release/jdk/modules/java.base/_the.java.base_pubapi
[stderr] compiling module: jdk.crypto.cryptoki, all Java inputs: 76, modified files (Java or non-Java): 1, full recompile: true, non-Java modified files: /home/jlahoda/src/jdk/jdk/build/linux-x86_64-server-release/jdk/modules/java.base/_the.java.base_pubapi
[stderr] compiling module: jdk.internal.vm.compiler, all Java inputs: 1, modified files (Java or non-Java): 1, full recompile: true, non-Java modified files: /home/jlahoda/src/jdk/jdk/build/linux-x86_64-server-release/jdk/modules/java.base/_the.java.base_pubapi
[stderr] compiling module: jdk.localedata, all Java inputs: 1838, modified files (Java or non-Java): 1, full recompile: true, non-Java modified files: /home/jlahoda/src/jdk/jdk/build/linux-x86_64-server-release/jdk/modules/java.base/_the.java.base_pubapi
[stderr] compiling module: jdk.internal.vm.compiler.management, all Java inputs: 1, modified files (Java or non-Java): 1, full recompile: true, non-Java modified files: /home/jlahoda/src/jdk/jdk/build/linux-x86_64-server-release/jdk/modules/java.base/_the.java.base_pubapi
[stderr] compiling module: jdk.jcmd, all Java inputs: 40, modified files (Java or non-Java): 1, full recompile: true, non-Java modified files: /home/jlahoda/src/jdk/jdk/build/linux-x86_64-server-release/jdk/modules/java.base/_the.java.base_pubapi
[stderr] compiling module: jdk.compiler, all Java inputs: 413, modified files (Java or non-Java): 1, full recompile: true, non-Java modified files: /home/jlahoda/src/jdk/jdk/build/linux-x86_64-server-release/jdk/modules/java.base/_the.java.base_pubapi
[stderr] compiling module: jdk.jstatd, all Java inputs: 11, modified files (Java or non-Java): 1, full recompile: true, non-Java modified files: /home/jlahoda/src/jdk/jdk/build/linux-x86_64-server-release/jdk/modules/java.base/_the.java.base_pubapi
[stderr] compiling module: jdk.jdi, all Java inputs: 254, modified files (Java or non-Java): 1, full recompile: true, non-Java modified files: /home/jlahoda/src/jdk/jdk/build/linux-x86_64-server-release/jdk/modules/java.base/_the.java.base_pubapi
[stderr] compiling module: jdk.management.jfr, all Java inputs: 15, modified files (Java or non-Java): 1, full recompile: true, non-Java modified files: /home/jlahoda/src/jdk/jdk/build/linux-x86_64-server-release/jdk/modules/java.base/_the.java.base_pubapi
[stderr] compiling module: java.naming, all Java inputs: 198, modified files (Java or non-Java): 1, full recompile: true, non-Java modified files: /home/jlahoda/src/jdk/jdk/build/linux-x86_64-server-release/jdk/modules/java.base/_the.java.base_pubapi
[stderr] compiling module: jdk.naming.dns, all Java inputs: 16, modified files (Java or non-Java): 1, full recompile: true, non-Java modified files: /home/jlahoda/src/jdk/jdk/build/linux-x86_64-server-release/jdk/modules/java.base/_the.java.base_pubapi
[stderr] compiling module: jdk.naming.rmi, all Java inputs: 8, modified files (Java or non-Java): 1, full recompile: true, non-Java modified files: /home/jlahoda/src/jdk/jdk/build/linux-x86_64-server-release/jdk/modules/java.base/_the.java.base_pubapi
[stderr] compiling module: java.management.rmi, all Java inputs: 16, modified files (Java or non-Java): 1, full recompile: true, non-Java modified files: /home/jlahoda/src/jdk/jdk/build/linux-x86_64-server-release/jdk/modules/java.base/_the.java.base_pubapi
[stderr] compiling module: java.security.jgss, all Java inputs: 212, modified files (Java or non-Java): 1, full recompile: true, non-Java modified files: /home/jlahoda/src/jdk/jdk/build/linux-x86_64-server-release/jdk/modules/java.base/_the.java.base_pubapi
[stderr] compiling module: java.sql, all Java inputs: 77, modified files (Java or non-Java): 1, full recompile: true, non-Java modified files: /home/jlahoda/src/jdk/jdk/build/linux-x86_64-server-release/jdk/modules/java.base/_the.java.base_pubapi
[stderr] compiling module: java.prefs, all Java inputs: 15, modified files (Java or non-Java): 1, full recompile: true, non-Java modified files: /home/jlahoda/src/jdk/jdk/build/linux-x86_64-server-release/jdk/modules/java.base/_the.java.base_pubapi
[stderr] compiling module: jdk.xml.dom, all Java inputs: 94, modified files (Java or non-Java): 1, full recompile: true, non-Java modified files: /home/jlahoda/src/jdk/jdk/build/linux-x86_64-server-release/jdk/modules/java.base/_the.java.base_pubapi
[stderr] compiling module: java.xml.crypto, all Java inputs: 271, modified files (Java or non-Java): 1, full recompile: true, non-Java modified files: /home/jlahoda/src/jdk/jdk/build/linux-x86_64-server-release/jdk/modules/java.base/_the.java.base_pubapi
[stderr] compiling module: jdk.management.agent, all Java inputs: 30, modified files (Java or non-Java): 1, full recompile: true, non-Java modified files: /home/jlahoda/src/jdk/jdk/build/linux-x86_64-server-release/jdk/modules/java.base/_the.java.base_pubapi
[stderr] compiling module: java.sql.rowset, all Java inputs: 56, modified files (Java or non-Java): 1, full recompile: true, non-Java modified files: /home/jlahoda/src/jdk/jdk/build/linux-x86_64-server-release/jdk/modules/java.base/_the.java.base_pubapi
[stderr] compiling module: jdk.security.jgss, all Java inputs: 16, modified files (Java or non-Java): 1, full recompile: true, non-Java modified files: /home/jlahoda/src/jdk/jdk/build/linux-x86_64-server-release/jdk/modules/java.base/_the.java.base_pubapi
[stderr] compiling module: jdk.security.auth, all Java inputs: 30, modified files (Java or non-Java): 1, full recompile: true, non-Java modified files: /home/jlahoda/src/jdk/jdk/build/linux-x86_64-server-release/jdk/modules/java.base/_the.java.base_pubapi
[stderr] compiling module: jdk.jdeps, all Java inputs: 139, modified files (Java or non-Java): 1, full recompile: true, non-Java modified files: /home/jlahoda/src/jdk/jdk/build/linux-x86_64-server-release/jdk/modules/java.base/_the.java.base_pubapi
[stderr] compiling module: jdk.jshell, all Java inputs: 97, modified files (Java or non-Java): 1, full recompile: true, non-Java modified files: /home/jlahoda/src/jdk/jdk/build/linux-x86_64-server-release/jdk/modules/java.base/_the.java.base_pubapi
[stderr] compiling module: jdk.javadoc, all Java inputs: 243, modified files (Java or non-Java): 1, full recompile: true, non-Java modified files: /home/jlahoda/src/jdk/jdk/build/linux-x86_64-server-release/jdk/modules/java.base/_the.java.base_pubapi
[stderr] compiling module: jdk.jlink, all Java inputs: 90, modified files (Java or non-Java): 1, full recompile: true, non-Java modified files: /home/jlahoda/src/jdk/jdk/build/linux-x86_64-server-release/jdk/modules/java.base/_the.java.base_pubapi
[stderr] compiling module: java.desktop, all Java inputs: 2769, modified files (Java or non-Java): 1, full recompile: true, non-Java modified files: /home/jlahoda/src/jdk/jdk/build/linux-x86_64-server-release/jdk/modules/java.base/_the.java.base_pubapi
[stderr] compiling module: java.se, all Java inputs: 1, modified files (Java or non-Java): 1, full recompile: true, non-Java modified files: /home/jlahoda/src/jdk/jdk/build/linux-x86_64-server-release/jdk/modules/java.base/_the.java.base_pubapi
[stderr] compiling module: jdk.unsupported.desktop, all Java inputs: 8, modified files (Java or non-Java): 1, full recompile: true, non-Java modified files: /home/jlahoda/src/jdk/jdk/build/linux-x86_64-server-release/jdk/modules/java.base/_the.java.base_pubapi
[stderr] compiling module: jdk.editpad, all Java inputs: 3, modified files (Java or non-Java): 1, full recompile: true, non-Java modified files: /home/jlahoda/src/jdk/jdk/build/linux-x86_64-server-release/jdk/modules/java.base/_the.java.base_pubapi
[stderr] compiling module: jdk.accessibility, all Java inputs: 18, modified files (Java or non-Java): 1, full recompile: true, non-Java modified files: /home/jlahoda/src/jdk/jdk/build/linux-x86_64-server-release/jdk/modules/java.base/_the.java.base_pubapi
[stderr] compiling module: jdk.jconsole, all Java inputs: 64, modified files (Java or non-Java): 1, full recompile: true, non-Java modified files: /home/jlahoda/src/jdk/jdk/build/linux-x86_64-server-release/jdk/modules/java.base/_the.java.base_pubapi
[stderr] compiling module: jdk.jpackage, all Java inputs: 57, modified files (Java or non-Java): 1, full recompile: true, non-Java modified files: /home/jlahoda/src/jdk/jdk/build/linux-x86_64-server-release/jdk/modules/java.base/_the.java.base_pubapi
[stderr] compiling module: jdk.hotspot.agent, all Java inputs: 940, modified files (Java or non-Java): 1, full recompile: true, non-Java modified files: /home/jlahoda/src/jdk/jdk/build/linux-x86_64-server-release/jdk/modules/java.base/_the.java.base_pubapi
Optimizing the exploded image
Stopping sjavac server
Finished building target 'default (exploded-image)' in configuration 'linux-x86_64-server-release'
real 1m27,775s
user 0m52,536s
sys 0m7,856s
## Public method added to java.compiler:
sed -e 's/^}//** test. */public static void testMethod() {} }/' <src/java.compiler/share/classes/javax/lang/model/util/ElementFilter.java.orig >src/java.compiler/share/classes/javax/lang/model/util/ElementFilter.java
time make
result:
Building target 'default (exploded-image)' in configuration 'linux-x86_64-server-release'
Compiling up to 127 files for BUILD_java.compiler.interim
Compiling up to 127 files for java.compiler
[stderr] compiling module: java.compiler, all Java inputs: 127, modified files (Java or non-Java): 1, full recompile: true, non-Java modified files:
[stderr] compiling module: java.se, all Java inputs: 1, modified files (Java or non-Java): 1, full recompile: true, non-Java modified files: /home/jlahoda/src/jdk/jdk/build/linux-x86_64-server-release/jdk/modules/java.compiler/_the.java.compiler_pubapi
[stderr] compiling module: jdk.compiler, all Java inputs: 413, modified files (Java or non-Java): 1, full recompile: true, non-Java modified files: /home/jlahoda/src/jdk/jdk/build/linux-x86_64-server-release/jdk/modules/java.compiler/_the.java.compiler_pubapi
[stderr] compiling module: jdk.jdeps, all Java inputs: 139, modified files (Java or non-Java): 1, full recompile: true, non-Java modified files: /home/jlahoda/src/jdk/jdk/build/linux-x86_64-server-release/jdk/modules/java.compiler/_the.java.compiler_pubapi
[stderr] compiling module: jdk.jshell, all Java inputs: 97, modified files (Java or non-Java): 1, full recompile: true, non-Java modified files: /home/jlahoda/src/jdk/jdk/build/linux-x86_64-server-release/jdk/modules/java.compiler/_the.java.compiler_pubapi
[stderr] compiling module: jdk.javadoc, all Java inputs: 243, modified files (Java or non-Java): 1, full recompile: true, non-Java modified files: /home/jlahoda/src/jdk/jdk/build/linux-x86_64-server-release/jdk/modules/java.compiler/_the.java.compiler_pubapi
Optimizing the exploded image
Stopping sjavac server
Finished building target 'default (exploded-image)' in configuration 'linux-x86_64-server-release'
real 0m36,685s
user 0m30,044s
sys 0m3,273s
## Error in a newly added added public method to java.base:
sed -e 's/^}/public static void testMethod() {} }/' <src/java.base/share/classes/java/lang/Object.java.orig >src/java.base/share/classes/java/lang/Object.java
time make
git diff src/java.base/share/classes/java/lang/Object.java | patch -R -p1
sed -e 's/^}//** test. */public static void testMethod() {} }/' <src/java.base/share/classes/java/lang/Object.java.orig >src/java.base/share/classes/java/lang/Object.java
echo Fixed:
time make
result:
Building target 'default (exploded-image)' in configuration 'linux-x86_64-server-release'
Compiling up to 3192 files for java.base
[stderr] compiling module: java.base, all Java inputs: 3192, modified files (Java or non-Java): 1, full recompile: true, non-Java modified files:
-------------
PR: https://git.openjdk.org/jdk/pull/10104
More information about the compiler-dev
mailing list