19de5d97ef
...where ExternalProject_hsqldb failed with
> [java] java.lang.UnsupportedOperationException: The Security Manager is deprecated and will be removed in a future release
> [java] at org.apache.tools.ant.taskdefs.ExecuteJava.execute(ExecuteJava.java:194)
> [java] at org.apache.tools.ant.taskdefs.Java.run(Java.java:891)
> [java] at org.apache.tools.ant.taskdefs.Java.executeJava(Java.java:231)
> [java] at org.apache.tools.ant.taskdefs.Java.executeJava(Java.java:135)
> [java] at org.apache.tools.ant.taskdefs.Java.execute(Java.java:108)
> [java] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:299)
> [java] at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
> [java] at java.base/java.lang.reflect.Method.invoke(Method.java:577)
> [java] at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:99)
> [java] at org.apache.tools.ant.Task.perform(Task.java:350)
> [java] at org.apache.tools.ant.Target.execute(Target.java:449)
> [java] at org.apache.tools.ant.Target.performTasks(Target.java:470)
> [java] at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1401)
> [java] at org.apache.tools.ant.Project.executeTarget(Project.java:1374)
> [java] at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
> [java] at org.apache.tools.ant.Project.executeTargets(Project.java:1264)
> [java] at org.apache.tools.ant.Main.runBuild(Main.java:818)
> [java] at org.apache.tools.ant.Main.startAnt(Main.java:223)
> [java] at org.apache.tools.ant.launch.Launcher.run(Launcher.java:284)
> [java] at org.apache.tools.ant.launch.Launcher.main(Launcher.java:101)
> [java] Caused by: java.lang.UnsupportedOperationException: The Security Manager is deprecated and will be removed in a future release
> [java] at java.base/java.lang.System.setSecurityManager(System.java:416)
> [java] at org.apache.tools.ant.types.Permissions.setSecurityManager(Permissions.java:103)
> [java] at org.apache.tools.ant.taskdefs.ExecuteJava.run(ExecuteJava.java:216)
> [java] at org.apache.tools.ant.taskdefs.ExecuteJava.execute(ExecuteJava.java:155)
> [java] ... 19 more
while building target switchtojdk17 (but then unfortunately carried on, without
the source modifications that should have been done by that target, leading to
confusing errors like
> [javac] workdir/UnpackedTarball/hsqldb/src/org/hsqldb/jdbc/jdbcConnection.java:426: error: jdbcConnection is not abstract and does not override abstract method createStruct(String,Object[]) in Connection
that should have been under control at least ever since
7dbfc0012c
"make hsqldb build with java 1.7".)
Unconditionally passing ANT_OPTS -Djava.security.manager=allow would cause older
JDK versions (like Java 11) to fail with a java.lang.Error "Could not create
SecurityManager" caused by a java.lang.ClassNotFoundException "allow", so
introduce JDK_SECURITYMANAGER_DISALLOWED_FOR_BUILD.
This should allow us to keep building against at least JDK 18, even though later
versions of Java may remove the Security Manager completely, but in which case
hopefully an updated version of Apache Ant will become available.
Change-Id: I9d143d8bcfff67870017bb1c874eec53e0ff9672
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132558
Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Tested-by: Jenkins
38 lines
1.5 KiB
Makefile
38 lines
1.5 KiB
Makefile
# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
|
|
#
|
|
# This file is part of the LibreOffice project.
|
|
#
|
|
# This Source Code Form is subject to the terms of the Mozilla Public
|
|
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
#
|
|
|
|
$(eval $(call gb_ExternalProject_ExternalProject,hsqldb))
|
|
|
|
$(eval $(call gb_ExternalProject_register_targets,hsqldb,\
|
|
build \
|
|
))
|
|
|
|
# ANT_OPTS -Djava.security.manager=allow allows latest Apache Ant 1.10.12 to still run under
|
|
# Java 18, where java.lang.System.setSecurityManager (as called from
|
|
# org.apache.tools.ant.types.Permissions.setSecurityManager) would otherwise throw an
|
|
# UnsupportedOperationException (see <https://openjdk.java.net/jeps/411> "Deprecate the Security
|
|
# Manager for Removal"):
|
|
$(call gb_ExternalProject_get_state_target,hsqldb,build) :
|
|
$(call gb_Trace_StartRange,hsqldb,EXTERNAL)
|
|
$(call gb_ExternalProject_run,build,\
|
|
JAVA_HOME=$(JAVA_HOME_FOR_BUILD) \
|
|
$(if $(JDK_SECURITYMANAGER_DISALLOWED_FOR_BUILD), \
|
|
ANT_OPTS="$$ANT_OPTS -Djava.security.manager=allow") \
|
|
$(ICECREAM_RUN) "$(ANT)" \
|
|
$(if $(verbose),-v,-q) \
|
|
-f build/build.xml \
|
|
-Dbuild.label="build-$(LIBO_VERSION_MAJOR).$(LIBO_VERSION_MINOR).$(LIBO_VERSION_MICRO).$(LIBO_VERSION_PATCH)" \
|
|
-Dant.build.javac.source=$(JAVA_SOURCE_VER) \
|
|
-Dant.build.javac.target=$(JAVA_TARGET_VER) \
|
|
$(if $(debug),-Dbuild.debug="on") \
|
|
jar \
|
|
)
|
|
$(call gb_Trace_EndRange,hsqldb,EXTERNAL)
|
|
|
|
# vim: set noet sw=4 ts=4:
|