<!DOCTYPE html><html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<p>On 2025-03-28 11:28, Galder Zamarreno wrote:</p>
<blockquote type="cite" cite="mid:CAAcPREv0bbF8cjfS-_T7tO3ztKcJQKZzZJBi6JcY=mN9bqeUJA@mail.gmail.com">
<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" moz-do-not-send="true" class="moz-txt-link-freetext">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>
</div>
</blockquote>
<p>That will just call the default target, which is "jdk" unless you
have set something different with configure. That is a convenience
target for developers to get most, but not all, of the stuff built
that is needed to check that you did not break the build and to be
able to run a fair share of the tests. </p>
<p>You need to call "make jdk-image" to get a complete image that
can be distributed.</p>
<p>I was going to point you to the relevant part of the build
readme, but I noticed that this is not clearly spelled out there.
I guess we should update the documentation to make this clear.<br>
</p>
<p><br>
</p>
<blockquote type="cite" cite="mid:CAAcPREv0bbF8cjfS-_T7tO3ztKcJQKZzZJBi6JcY=mN9bqeUJA@mail.gmail.com">
<div dir="ltr">
<div class="gmail_quote gmail_quote_container">
<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>
<p><br>
</p>
<p>You can use the "--with-source-date" configure option. With it,
you can either pass in a ISO-8601 date string, or some of the
convenience aliases. I'd recommend using "configure
--with-source-date=version"; this will pick up the official
release date of the JDK version you are building and using that to
set SOURCE_DATE_EPOCH properly for all tools executed in the
build.</p>
<p>/Magnus<br>
</p>
<p><br>
</p>
<br>
<blockquote type="cite" cite="mid:CAAcPREv0bbF8cjfS-_T7tO3ztKcJQKZzZJBi6JcY=mN9bqeUJA@mail.gmail.com">
<div dir="ltr">
<div class="gmail_quote gmail_quote_container">
<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" moz-do-not-send="true" class="moz-txt-link-freetext">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" moz-do-not-send="true" class="moz-txt-link-freetext">https://github.com/openjdk/jdk/pull/6481#issuecomment-982399628</a><br>
<br>
</blockquote>
</div>
</div>
</blockquote>
</body>
</html>