On Mon, 2 Jun 2025 17:21:21 GMT, Joe Darcy <da...@openjdk.org> wrote:

>> I don't think this is a good way. We should not call to shell to make 
>> calculations in the makefiles; if that were needed, it should be done in 
>> configure. However, we are already doing this, or at least something very 
>> similar. Have a look at line 398 in boot-jdk.m4. We set up `OLDEST_BOOT_JDK` 
>> as the oldest JDK from the list in version-numbers.conf. 
>> 
>> That should, I think, match your expectation of N-1. There is always a bit 
>> uncertainty how you want these things to be handled around the version 
>> rollover, and I'm not sure about your use case in those situations. But in 
>> general, the oldest boot JDK will match the version number actually used in 
>> the build as the boot JDK, that is, N-1.
>> 
>> Now, OLDEST_BOOT_JDK is not exported to make. But that is however:
>> 
>> BOOT_JDK_SOURCETARGET="-source $OLDEST_BOOT_JDK -target $OLDEST_BOOT_JDK 
>> -Xlint:-options"
>> 
>> which is almost, but not exactly, what you were planning to add. The added 
>> `-Xlint:-options` is harmless afaict, and I think was likely added at some 
>> point due to option mismatch between N and N-1 javac lint support, so I 
>> think it would make sense for you to use it as well.
>> 
>> So, in essense, my suggestion boils down to that you should only add 
>> `$(BOOT_JDK_SOURCETARGET)` to your command line.
>
>> I don't think this is a good way. We should not call to shell to make 
>> calculations in the makefiles; if that were needed, it should be done in 
>> configure. However, we are already doing this, or at least something very 
>> similar. Have a look at line 398 in boot-jdk.m4. We set up `OLDEST_BOOT_JDK` 
>> as the oldest JDK from the list in version-numbers.conf.
>> 
>> That should, I think, match your expectation of N-1. There is always a bit 
>> uncertainty how you want these things to be handled around the version 
>> rollover, and I'm not sure about your use case in those situations. But in 
>> general, the oldest boot JDK will match the version number actually used in 
>> the build as the boot JDK, that is, N-1.
>> 
>> Now, OLDEST_BOOT_JDK is not exported to make. But that is however:
>> 
>> ```
>> BOOT_JDK_SOURCETARGET="-source $OLDEST_BOOT_JDK -target $OLDEST_BOOT_JDK 
>> -Xlint:-options"
>> ```
>> 
>> which is almost, but not exactly, what you were planning to add. The added 
>> `-Xlint:-options` is harmless afaict, and I think was likely added at some 
>> point due to option mismatch between N and N-1 javac lint support, so I 
>> think it would make sense for you to use it as well.
>> 
>> So, in essense, my suggestion boils down to that you should only add 
>> `$(BOOT_JDK_SOURCETARGET)` to your command line.
> 
> I don't know the particulars here, but using
> 
> `javac -source $OLD -target $OLD ..."
> 
> is _almost_ never more appropriate than using
> 
> `javac --release $OLD ..."
> 
> The `options` warning would be noting the possible use of `--release`.

@jddarcy I tried replacing the `-source/-target` with `--release` for the Boot 
JDK overall. However, I get this kind of errors:


error: exporting a package from system module java.base is not allowed with 
--release


I assume this is why we have still been using  `-source/-target`. But maybe we 
should move to use `--release` instead, and figure out and fix this issue in a 
different way?

-------------

PR Comment: https://git.openjdk.org/jdk/pull/25494#issuecomment-3024001740

Reply via email to