On Fri, 2025-03-28 at 10:25 +0100, Galder Zamarreno wrote: > Hi, > > I continue experimenting with building mainline on Nix and I've made > some progress. Capstone, Ant and others are in, but I had to work > around an issue when trying to run JMH benchmarks [1]. > > Seems like when `test` make target is run, `jrt-fs` jar file is > created passing in `--date ...`. In Nix, I was getting this error: > > ``` > /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 > > ... > date 1980-01-01T00:00:00Z is not within the valid range 1980-01-01T00:00:02Z > to 2099-12-31T23:59:59Z > ``` > > @Andrew Leonard found the root of this validation in [2]. It seems > unlikely this is going to change. > > The cause is that on Nix shell envs `$SOURCE_DATE_EPOCH` is set > to 315532800 which is 1980-01-01T00:00:00Z. This can be easily worked > around by unsetting SOURCE_DATE_EPOCH and that works fine for my use > case. > > However, @Thomas Fitzsimmons had a very good point to make: > > > I also wonder why the test harness is passing --date > > $SOURCE_DATE_EPOCH, since the test jars are not distributed, not > > sure why they'd need to be reproducible... > > I think his question is valid. Why pass --date for a test jar?
I might be missing something, but isn't the question about why pass --date $SOURCE_DATE_EPOCH ... when creating jrt-fs.jar? jrt-fs.jar isn't a test jar. It's the JDK 8 compatible FS provider for JDK 9+ to read the JRT files. Are you suggesting it's only happening when running "make test"? I'd assume the same would happen for 'make images' too after JDK-8288396. Couldn't you just set SOURCE_DATE_EPOCH to a value after 1980-01- 01T00:00:02Z (btw, that looks like a bug to me; valid range should really be T00:00:00Z). Thanks, Severin > [1] https://github.com/NixOS/nixpkgs/issues/387516#issuecomment-2760642591 > [2] https://github.com/openjdk/jdk/pull/6481#issuecomment-982399628