Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import org.jboss.logging.Logger;

import io.quarkus.builder.item.MultiBuildItem;
import io.quarkus.runtime.graal.GraalVM;

/**
* Used to register a class for reflection in native mode
Expand Down Expand Up @@ -196,15 +195,6 @@ public boolean isQueryConstructors() {
return queryConstructors;
}

/**
* @deprecated As of GraalVM 21.2 finalFieldsWritable is no longer needed when registering fields for reflection. This will
* be removed in a future version of Quarkus.
*/
@Deprecated
public boolean areFinalFieldsWritable() {
return false;
}

public boolean isWeak() {
return weak;
}
Expand Down Expand Up @@ -335,15 +325,6 @@ public Builder classes() {
return classes(true);
}

/**
* @deprecated As of GraalVM 21.2 finalFieldsWritable is no longer needed when registering fields for reflection. This
* will be removed in a future version of Quarkus.
*/
@Deprecated(forRemoval = true)
public Builder finalFieldsWritable(boolean finalFieldsWritable) {
return this;
}

public Builder weak(boolean weak) {
this.weak = weak;
return this;
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -64,62 +64,13 @@ public interface NativeConfig {
@WithDefault("false")
boolean enableHttpsUrlHandler();

/**
* If all security services should be added to the native image
*
* @deprecated {@code --enable-all-security-services} was removed in GraalVM 21.1 https://github.com/oracle/graal/pull/3258
*/
@WithDefault("false")
@Deprecated
boolean enableAllSecurityServices();

/**
* If {@code -H:+InlineBeforeAnalysis} flag will be added to the native-image run
*
* @deprecated inlineBeforeAnalysis is always enabled starting from GraalVM 21.3.
*/
@Deprecated
@WithDefault("true")
boolean inlineBeforeAnalysis();

/**
* @deprecated JNI is always enabled starting from GraalVM 19.3.1.
*/
@Deprecated
@WithDefault("true")
boolean enableJni();

/**
* The default value for java.awt.headless JVM option.
* Switching this option affects linking of awt libraries.
*/
@WithDefault("true")
boolean headless();

/**
* Defines the user language used for building the native executable.
* With GraalVM versions prior to GraalVM for JDK 24 it also serves as the default Locale language for the native executable
* application runtime.
* e.g. en or cs as defined by IETF BCP 47 language tags.
* <p>
*
* @deprecated Use the global quarkus.default-locale.
*/
@Deprecated
Optional<@WithConverter(TrimmedStringConverter.class) String> userLanguage();

/**
* Defines the user country used for building the native executable.
* With GraalVM versions prior to GraalVM for JDK 24 it also serves as the default Locale country for the native executable
* application runtime.
* e.g. US or FR as defined by ISO 3166-1 alpha-2 codes.
* <p>
*
* @deprecated Use the global quarkus.default-locale.
*/
@Deprecated
Optional<@WithConverter(TrimmedStringConverter.class) String> userCountry();

/**
* Defines the file encoding as in {@code -Dfile.encoding=...}.
* <p>
Expand Down Expand Up @@ -173,16 +124,6 @@ public interface NativeConfig {
@WithDefault("true")
boolean publishDebugBuildProcessPort();

/**
* If the native image server should be restarted.
*
* @deprecated Since GraalVM 20.2.0 the native image server has become an experimental feature and is disabled by
* default.
*/
@Deprecated
@WithDefault("false")
boolean cleanupServer();

/**
* If isolates should be enabled
*/
Expand All @@ -196,18 +137,6 @@ public interface NativeConfig {
@WithDefault("false")
boolean enableFallbackImages();

/**
* If the native image server should be used. This can speed up compilation but can result in changes not always
* being picked up due to cache invalidation not working 100%
*
* @deprecated This used to be the default prior to GraalVM 20.2.0 and this configuration item was used to disable
* it as it was not stable. Since GraalVM 20.2.0 the native image server has become an experimental
* feature.
*/
@Deprecated
@WithDefault("false")
boolean enableServer();

/**
* If all META-INF/services entries should be automatically registered
*/
Expand Down Expand Up @@ -339,15 +268,6 @@ default String getEffectiveImage() {
*/
Optional<List<MonitoringOption>> monitoring();

/**
* If full stack traces are enabled in the resulting image
*
* @deprecated GraalVM 23.1+ will always build with full stack traces.
*/
@WithDefault("true")
@Deprecated
boolean fullStackTraces();

/**
* If the reports on call paths and included packages/classes/methods should be generated
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -246,14 +246,6 @@ public NativeImageBuildItem build(NativeConfig nativeConfig, LocalesBuildTimeCon
checkGraalVMVersion(graalVMVersion);

try {
if (nativeConfig.cleanupServer()) {
log.warn(
"Your application is setting the deprecated 'quarkus.native.cleanup-server' configuration key"
+ " to true. Please consider removing this configuration key as it is ignored"
+ " (The Native image build server is always disabled) and it will be removed in a"
+ " future Quarkus version.");
}

NativeImageInvokerInfo commandAndExecutable = new NativeImageInvokerInfo.Builder()
.setNativeConfig(nativeConfig)
.setLocalesBuildTimeConfig(localesBuildTimeConfig)
Expand Down Expand Up @@ -717,7 +709,6 @@ public Builder setNativeMonitoringOptions(List<NativeMonitoringBuildItem> option
public NativeImageInvokerInfo build() {
List<String> nativeImageArgs = new ArrayList<>();
boolean enableSslNative = false;
boolean inlineBeforeAnalysis = nativeConfig.inlineBeforeAnalysis();
boolean addAllCharsets = nativeConfig.addAllCharsets();
boolean enableHttpsUrlHandler = nativeConfig.enableHttpsUrlHandler();
for (NativeImageSystemPropertyBuildItem prop : nativeImageProperties) {
Expand All @@ -735,8 +726,6 @@ public NativeImageInvokerInfo build() {
+ " will be removed in a future Quarkus version.");
} else if (prop.getKey().equals("quarkus.native.enable-all-charsets") && prop.getValue() != null) {
addAllCharsets |= Boolean.parseBoolean(prop.getValue());
} else if (prop.getKey().equals("quarkus.native.inline-before-analysis") && prop.getValue() != null) {
inlineBeforeAnalysis = Boolean.parseBoolean(prop.getValue());
} else {
// todo maybe just -D is better than -J-D in this case
if (prop.getValue() == null) {
Expand Down Expand Up @@ -922,29 +911,13 @@ public NativeImageInvokerInfo build() {
if (!protocols.isEmpty()) {
nativeImageArgs.add("--enable-url-protocols=" + String.join(",", protocols));
}
if (!inlineBeforeAnalysis) {
addExperimentalVMOption(nativeImageArgs, "-H:-InlineBeforeAnalysis");
}
if (!pie.isEmpty()) {
nativeImageArgs.add("-H:NativeLinkerOption=" + pie);
}

if (!nativeConfig.enableIsolates()) {
addExperimentalVMOption(nativeImageArgs, "-H:-SpawnIsolates");
}
if (!nativeConfig.enableJni()) {
log.warn(
"Your application is setting the deprecated 'quarkus.native.enable-jni' configuration key to false."
+ " Please consider removing this configuration key as it is ignored (JNI is always enabled) and it"
+ " will be removed in a future Quarkus version.");
}
if (nativeConfig.enableServer()) {
log.warn(
"Your application is setting the deprecated 'quarkus.native.enable-server' configuration key to true."
+ " Please consider removing this configuration key as it is ignored"
+ " (The Native image build server is always disabled) and it"
+ " will be removed in a future Quarkus version.");
}
if (nativeConfig.enableVmInspection()) {
addExperimentalVMOption(nativeImageArgs, "-H:+AllowVMInspection");
}
Expand Down Expand Up @@ -1000,14 +973,6 @@ public NativeImageInvokerInfo build() {
} else {
addExperimentalVMOption(nativeImageArgs, "-H:-UseServiceLoaderFeature");
}
// This option has no effect on GraalVM 23.1+
if (graalVMVersion.compareTo(GraalVM.Version.VERSION_23_1_0) < 0) {
if (nativeConfig.fullStackTraces()) {
nativeImageArgs.add("-H:+StackTrace");
} else {
nativeImageArgs.add("-H:-StackTrace");
}
}

if (nativeConfig.enableDashboardDump()) {
addExperimentalVMOption(nativeImageArgs,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,6 @@
public class LocaleProcessor {

private static final Logger log = Logger.getLogger(LocaleProcessor.class);
public static final String DEPRECATED_USER_LANGUAGE_WARNING = "Your application is setting the deprecated 'quarkus.native.user-language' configuration property. "
+
"Please, consider using only 'quarkus.default-locale' configuration property instead.";
public static final String DEPRECATED_USER_COUNTRY_WARNING = "Your application is setting the deprecated 'quarkus.native.user-country' configuration property. "
+
"Please, consider using only 'quarkus.default-locale' configuration property instead.";

@BuildStep(onlyIf = { NativeBuild.class, NonDefaultLocale.class })
void nativeResources(BuildProducer<NativeImageResourceBundleBuildItem> resources) {
Expand Down Expand Up @@ -92,14 +86,8 @@ public NonDefaultLocale(NativeConfig nativeConfig, LocalesBuildTimeConfig locale

@Override
public boolean getAsBoolean() {
return (nativeConfig.userLanguage().isPresent()
&& !Locale.getDefault().getLanguage().equals(nativeConfig.userLanguage().get()))
||
(nativeConfig.userCountry().isPresent()
&& !Locale.getDefault().getCountry().equals(nativeConfig.userCountry().get()))
||
(localesBuildTimeConfig.defaultLocale().isPresent() &&
!Locale.getDefault().equals(localesBuildTimeConfig.defaultLocale().get()))
return (localesBuildTimeConfig.defaultLocale().isPresent() &&
!Locale.getDefault().equals(localesBuildTimeConfig.defaultLocale().get()))
||
localesBuildTimeConfig.locales().stream().anyMatch(l -> !Locale.getDefault().equals(l));
}
Expand All @@ -110,8 +98,7 @@ public boolean getAsBoolean() {
*
* @param nativeConfig
* @param localesBuildTimeConfig
* @return User language set by 'quarkus.default-locale' or by deprecated 'quarkus.native.user-language' or
* effectively LocalesBuildTimeConfig.DEFAULT_LANGUAGE if none of the aforementioned is set.
* @return User language set by 'quarkus.default-locale' or effectively LocalesBuildTimeConfig.DEFAULT_LANGUAGE if not set.
* @Deprecated
*/
@Deprecated
Expand All @@ -120,11 +107,6 @@ public static String nativeImageUserLanguage(NativeConfig nativeConfig, LocalesB
if (localesBuildTimeConfig.defaultLocale().isPresent()) {
language = localesBuildTimeConfig.defaultLocale().get().getLanguage();
}
if (nativeConfig.userLanguage().isPresent()) {
log.warn(DEPRECATED_USER_LANGUAGE_WARNING);
// The deprecated option takes precedence for users who are already using it.
language = nativeConfig.userLanguage().get();
}
return language;
}

Expand All @@ -133,9 +115,7 @@ public static String nativeImageUserLanguage(NativeConfig nativeConfig, LocalesB
*
* @param nativeConfig
* @param localesBuildTimeConfig
* @return User country set by 'quarkus.default-locale' or by deprecated 'quarkus.native.user-country' or
* effectively LocalesBuildTimeConfig.DEFAULT_COUNTRY (could be an empty string) if none of the aforementioned is
* set.
* @return User country set by 'quarkus.default-locale' or effectively LocalesBuildTimeConfig.DEFAULT_COUNTRY if not set.
* @Deprecated
*/
@Deprecated
Expand All @@ -144,11 +124,6 @@ public static String nativeImageUserCountry(NativeConfig nativeConfig, LocalesBu
if (localesBuildTimeConfig.defaultLocale().isPresent()) {
country = localesBuildTimeConfig.defaultLocale().get().getCountry();
}
if (nativeConfig.userCountry().isPresent()) {
log.warn(DEPRECATED_USER_COUNTRY_WARNING);
// The deprecated option takes precedence for users who are already using it.
country = nativeConfig.userCountry().get();
}
return country;
}

Expand All @@ -170,12 +145,7 @@ public static String nativeImageIncludeLocales(NativeConfig nativeConfig, Locale

// GraalVM for JDK 24 doesn't include the default locale used at build time. We must explicitly include the
// specified locales - including the build-time locale if set by the user.
// Note the deprecated options still count and take precedence.
if (nativeConfig.userCountry().isPresent() && nativeConfig.userLanguage().isPresent()) {
additionalLocales.add(new Locale(nativeConfig.userLanguage().get(), nativeConfig.userCountry().get()));
} else if (nativeConfig.userLanguage().isPresent()) {
additionalLocales.add(new Locale(nativeConfig.userLanguage().get()));
} else if (localesBuildTimeConfig.defaultLocale().isPresent()) {
if (localesBuildTimeConfig.defaultLocale().isPresent()) {
additionalLocales.add(localesBuildTimeConfig.defaultLocale().get());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,15 +95,7 @@ public void write(String s, byte[] bytes) {
overallCatch.marshalAsArray(String.class, overallCatch.load(""))); // empty string means initialize everything

// Set the user.language and user.country system properties to the default locale
// The deprecated option takes precedence for users who are already using it.
if (nativeConfig.userLanguage().isPresent()) {
overallCatch.invokeStaticMethod(REGISTER_RUNTIME_SYSTEM_PROPERTIES,
overallCatch.load("user.language"), overallCatch.load(nativeConfig.userLanguage().get()));
if (nativeConfig.userCountry().isPresent()) {
overallCatch.invokeStaticMethod(REGISTER_RUNTIME_SYSTEM_PROPERTIES,
overallCatch.load("user.country"), overallCatch.load(nativeConfig.userCountry().get()));
}
} else if (localesBuildTimeConfig.defaultLocale().isPresent()) {
if (localesBuildTimeConfig.defaultLocale().isPresent()) {
overallCatch.invokeStaticMethod(REGISTER_RUNTIME_SYSTEM_PROPERTIES,
overallCatch.load("user.language"),
overallCatch.load(localesBuildTimeConfig.defaultLocale().get().getLanguage()));
Expand Down
Loading
Loading