<div dir="ltr"><div dir="ltr"><div><br></div></div><br><div class="gmail_quote gmail_quote_container"><div dir="ltr" class="gmail_attr">On Fri, Mar 28, 2025 at 11:00 AM Severin Gehwolf <<a href="mailto:sgehwolf@redhat.com">sgehwolf@redhat.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Fri, 2025-03-28 at 10:25 +0100, Galder Zamarreno wrote:<br>
> Hi,<br>
> <br>
> I continue experimenting with building mainline on Nix and I've made<br>
> some progress. Capstone, Ant and others are in, but I had to work<br>
> around an issue when trying to run JMH benchmarks [1].<br>
> <br>
> Seems like when `test` make target is run, `jrt-fs` jar file is<br>
> created passing in `--date ...`. In Nix, I was getting this error:<br>
> <br>
> ```<br>
> /nix/store/5y040sypyg0amh0igxs9rnx5fmj0d88i-temurin-bin-23.0.2/bin/jar --create --date 1980-01-01T00:00:00Z --file /Users/galder/1/jdk-avoid-cmov-long-min-max/build/release-darwin-arm64/support/modules_libs/java.base/jrt-fs.jar --manifest /Users/galder/1/jdk-avoid-cmov-long-min-max/build/release-darwin-arm64/support/modules_libs/java.base/_the.jrt-fs.jar_manifest <br>
> ...<br>
> date 1980-01-01T00:00:00Z is not within the valid range 1980-01-01T00:00:02Z to 2099-12-31T23:59:59Z<br>
> ```<br>
> <br>
> @Andrew Leonard found the root of this validation in [2]. It seems<br>
> unlikely this is going to change.<br>
> <br>
> The cause is that on Nix shell envs `$SOURCE_DATE_EPOCH` is set<br>
> to 315532800 which is 1980-01-01T00:00:00Z. This can be easily worked<br>
> around by unsetting SOURCE_DATE_EPOCH and that works fine for my use<br>
> case.<br>
> <br>
> However, @Thomas Fitzsimmons had a very good point to make:<br>
> <br>
> > I also wonder why the test harness is passing --date<br>
> > $SOURCE_DATE_EPOCH, since the test jars are not distributed, not<br>
> > sure why they'd need to be reproducible...<br>
> <br>
> I think his question is valid. Why pass --date for a test jar?<br>
<br>
I might be missing something, but isn't the question about why pass<br>
<br>
--date $SOURCE_DATE_EPOCH<br>
<br>
... when creating jrt-fs.jar? jrt-fs.jar isn't a test jar. It's the JDK<br>
8 compatible FS provider for JDK 9+ to read the JRT files.<br>
<br>
Are you suggesting it's only happening when running "make test"? I'd<br>
assume the same would happen for 'make images' too after JDK-8288396.<br></blockquote><div><br></div><div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small">Before trying to run `make test` I was just simply calling `make` and that didn't cause the jar to be created.</div></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small"><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
Couldn't you just set SOURCE_DATE_EPOCH to a value after 1980-01-<br>
01T00:00:02Z (btw, that looks like a bug to me; valid range should<br>
really be T00:00:00Z).<br></blockquote><div><br></div><div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;font-size:small">Yes that would also work, same as unsetting <span style="font-family:Arial,Helvetica,sans-serif">SOURCE_DATE_EPOCH. About the range, see the PR comment in [2]</span></div></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
Thanks,<br>
Severin<br>
<br>
> [1] <a href="https://github.com/NixOS/nixpkgs/issues/387516#issuecomment-2760642591" rel="noreferrer" target="_blank">https://github.com/NixOS/nixpkgs/issues/387516#issuecomment-2760642591</a><br>
> [2] <a href="https://github.com/openjdk/jdk/pull/6481#issuecomment-982399628" rel="noreferrer" target="_blank">https://github.com/openjdk/jdk/pull/6481#issuecomment-982399628</a><br>
<br>
</blockquote></div></div>