RFR: JDK-8244021 Hide warning from jlink about incubating modules

Erik Joelsson erik.joelsson at oracle.com
Tue Apr 28 14:32:03 UTC 2020


Looks good.

/Erik

On 2020-04-28 07:19, Magnus Ihse Bursie wrote:
> The last remaining "WARNING" that is printed while building the JDK 
> stems from jlink. This is due to the fact that jmod is run with the 
> flag --warn-if-resolved=incubating, which will cause future processing 
> of the jmod to print a warning.
>
> This is by design to get the warning to display for the end users.
>
> However, this also has the side-effect that our call to jlink will 
> display this warning, unconditionally. This warning from jlink cannot 
> be disabled, per design.
>
> Since we know that we have incubating modules from time to time, and 
> it is not a warning for us, and the message cannot be removed using 
> flags to jlink, I propose to just filter it out, so we can achieve a 
> fully warning-free build.
>
> The filtering can always be disabled by running like this "make images 
> JLINK_DISABLE_WARNINGS="
>
> Bug: https://bugs.openjdk.java.net/browse/JDK-8244021
> Patch inline:
> diff --git a/make/Images.gmk b/make/Images.gmk
> --- a/make/Images.gmk
> +++ b/make/Images.gmk
> @@ -85,6 +85,8 @@
>    JLINK_JDK_EXTRA_OPTS := --keep-packaged-modules $(JDK_IMAGE_DIR)/jmods
>  endif
>
> +JLINK_DISABLE_WARNINGS := | ( $(GREP) -v -e "WARNING: Using incubator 
> module" || test "$$?" = "1" )
> +
>  $(eval $(call SetupExecute, jlink_jdk, \
>      WARN := Creating jdk image, \
>      DEPS := $(JMODS) $(BASE_RELEASE_FILE) \
> @@ -93,7 +95,8 @@
>      SUPPORT_DIR := $(SUPPORT_OUTPUTDIR)/images/jdk, \
>      PRE_COMMAND := $(RM) -r $(JDK_IMAGE_DIR), \
>      COMMAND := $(JLINK_TOOL) --add-modules $(JDK_MODULES_LIST) \
> -        $(JLINK_JDK_EXTRA_OPTS) --output $(JDK_IMAGE_DIR), \
> +        $(JLINK_JDK_EXTRA_OPTS) --output $(JDK_IMAGE_DIR) \
> +        $(JLINK_DISABLE_WARNINGS), \
>  ))
>
>



More information about the build-dev mailing list