Skip to content

Conversation

graalvmbot
Copy link
Collaborator

@graalvmbot graalvmbot commented Sep 8, 2025

HijrahChronology is configured via 1) a default resource shipped with the JDK and 2) via user-supplied properties files dropped into $JAVA_HOME/conf/chronology. This is a challenge for the native image initialization strategy. Currently, we initialize HijrahChronology at run time, which requires the default resource to be registered at build time and -Djava.home= to be set at run time (even if no extra configuration is needed, see #11410). This is not really practical. Instead, this PR makes HijrahChronology build-time initialized and ensures that all required configuration (resources and extra properties files) are read during the build and are no longer needed at run time.

This comes at the cost that HijrahChronology can no longer be configured at run time. On the other hand, dropping properties files into $JAVA_HOME is something that many users cannot do anyways (e.g., because it is read-only), so requiring this to be done at image build time seems like a viable compromise.

@oracle-contributor-agreement oracle-contributor-agreement bot added the OCA Verified All contributors have signed the Oracle Contributor Agreement. label Sep 8, 2025
@zapster zapster self-assigned this Sep 8, 2025
@zapster
Copy link
Member

zapster commented Sep 8, 2025

cc @Eng-Fouad

@graalvmbot graalvmbot force-pushed the je/svm-hijrah-build-time-init branch from 7beddf7 to 3e73b1e Compare September 8, 2025 12:27
@Eng-Fouad
Copy link
Contributor

Eng-Fouad commented Sep 8, 2025

cc @Eng-Fouad

Thanks for submitting this PR. So, after applying this PR, will users be able to set custom configurations for HijrahChronology (custom hijrah-config-Hijrah-umalqura_islamic-umalqura.properties) at build time?

  1. via user-supplied properties files dropped into $JAVA_HOME/conf/chronology

This feature was requested by me to OpenJDK project few years ago and they add it to JDK since JDK15 :)

@zapster
Copy link
Member

zapster commented Sep 9, 2025

So, after applying this PR, will users be able to set custom configurations for HijrahChronology (custom hijrah-config-Hijrah-umalqura_islamic-umalqura.properties) at build time?

Exactly. You just need to configure the JVM native image runs on as you would for normal Java execution. So assuming you have a standard GraalVM distribution and the native image command lives in $GRAALVM_HOME/bin/native-image, you would drop the extra config files into $GRAALVM_HOME/conf/chronology.

This feature was requested by me to OpenJDK project few years ago and they add it to JDK since JDK15 :)

😎

@graalvmbot graalvmbot force-pushed the je/svm-hijrah-build-time-init branch from 3e73b1e to fcd4a66 Compare September 9, 2025 06:26
@graalvmbot graalvmbot merged commit 53696fb into master Sep 9, 2025
13 checks passed
@graalvmbot graalvmbot deleted the je/svm-hijrah-build-time-init branch September 9, 2025 08:17
@Eng-Fouad
Copy link
Contributor

@zapster Will this be part of GraalVM 25? or 26?

@zapster
Copy link
Member

zapster commented Sep 9, 2025

Currently it is only on master, i.e., what potentially becomes GraalVM 26. We might consider backporting to 25, but it won't make it into the initial 25.0.0 release since that is released next week and it is simply to late in the release cycle. But it can be available in a future 25 update release if we decide to backport it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OCA Verified All contributors have signed the Oracle Contributor Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Native Image] HijrahChronology is broken in native mode
3 participants