[jdk8u-dev] Integrated: 8327440: Fix "bad source file" error during beaninfo generation
fitzsim
duke at openjdk.org
Tue Mar 19 10:04:33 UTC 2024
On Mon, 4 Mar 2024 16:36:22 GMT, fitzsim <duke at openjdk.org> wrote:
> The `gensrc_no_srczip/_the.generated_beaninfo` build rule does not use any sources in `gensrc`. Remove `$(JDK_OUTPUTDIR)/gensrc` from the `javadoc` `-sourcepath` argument, because its presence can cause build failures.
>
> Other build targets (for example,
> `gensrc/java/nio/_the.exceptions.dir`), generate source code under that path. When make is invoked with more than one job, sometimes one of those other targets will be in the process of writing a source file when the `_the.generated_beaninfo` build rule invokes `javadoc`. The result is build failures of the form:
>
>
> Generating beaninfo
> [...]\jdk8u-dev\jdk\src\share\classes\java\io\PrintStream.java:32: error: cannot access UnsupportedCharsetException
> import java.nio.charset.UnsupportedCharsetException;
> ^
> bad source file: [...]\jdk8u-dev\build\windows-x64\jdk\gensrc\java\nio\charset\UnsupportedCharsetException.java
>
>
> Background
> ==========
>
> This patch fixes a parallel make race condition during beaninfo generation. I investigated this issue because I was seeing GitHub Actions failures on https://github.com/openjdk/jdk8u-dev/pull/452 and wanted to make sure they were not caused by the ZipFile backport.
>
> This type of failure happens when generated source files are partially written to `$(JDK_OUTPUTDIR)/gensrc`. The failing invocation is `javadoc` (i.e., `com.sun.tools.javadoc.Main`, i.e., the expansion of `$(NEW_JAVADOC)`). `$(JDK_OUTPUTDIR)/gensrc` is listed in the `-sourcepath` javadoc argument. Therefore javadoc tries to parse source files it finds while traversing `gensrc` and its subdirectories.
>
> Other build rules write source files to `$(JDK_OUTPUTDIR)/gensrc`, and if any such source file is partially written, the `javadoc` sourcepath parsing fails with messages like:
>
>
> d:\a\jdk8u-dev\jdk8u-dev\jdk\jdk\src\share\classes\java\nio\channels\spi\AbstractSelectableChannel.java:33: error: cannot access IllegalSelectorException
> import java.nio.channels.IllegalSelectorException;
> ^
> bad source file: d:\a\jdk8u-dev\jdk8u-dev\jdk\build\windows-x64\jdk\gensrc\java\nio\channels\IllegalSelectorException.java
> file does not contain class java.nio.channels.IllegalSelectorException
> Please remove or make sure it appears in the correct subdirectory of the sourcepath.
>
>
> which occurred in
> https://github.com/gnu-andrew/jdk8u-dev/actions/runs/7979614913/job/21787468883.
>
> So far I have seen this type of error happen twice on Windows GitHub Actions runs, with the same ...
This pull request has now been integrated.
Changeset: 147b4188
Author: Thomas Fitzsimmons <fitzsim at redhat.com>
Committer: Andrew John Hughes <andrew at openjdk.org>
URL: https://git.openjdk.org/jdk8u-dev/commit/147b4188bc0d260a401ba383103d20cb428dbb88
Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod
8327440: Fix "bad source file" error during beaninfo generation
Reviewed-by: andrew
-------------
PR: https://git.openjdk.org/jdk8u-dev/pull/465
More information about the jdk8u-dev
mailing list