Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 15 Sep 2025 10:14:59 +0200 (CEST)
From:      Ronald Klop <ronald-lists@klop.ws>
To:        Harald Eilertsen <haraldei@anduin.net>
Cc:        java@freebsd.org
Subject:   (solved, I think) Re: openjdk build failures on "nm"
Message-ID:  <387357483.2815.1757924099539@localhost>
In-Reply-To: <mxss65u22c5oy4gvokvpc472yospz5mtyv7aionej5qgq7ycx2@jpxajffsomeh>
References:  <1221594030.658.1756976173189@localhost> <wy6tjmjqq3temf3smm7vbohvxd5hvvaplrycx66zmfffkwg4sn@2lfjlx3fp7xr> <1330428831.1750.1756980558066@localhost> <efoy4e5mqaa5xen277swrpj3w2mgthmkxza5p3k3hbxfpc7hn5@joytibqygluz> <2053927433.1876.1757575928041@localhost> <mxss65u22c5oy4gvokvpc472yospz5mtyv7aionej5qgq7ycx2@jpxajffsomeh>

index | next in thread | previous in thread | raw e-mail

[-- Attachment #1 --]
Van: Harald Eilertsen <haraldei@anduin.net>
Datum: donderdag, 11 september 2025 10:15
Aan: Ronald Klop <ronald-lists@klop.ws>
CC: java@freebsd.org
Onderwerp: Re: openjdk build failures on "nm"
> 
> On Thu, Sep 11, 2025 at 09:32:08AM +0200, Ronald Klop wrote:
> > As it seems hard to debug, what do the java@ maintainers think of this experiment?
> >
> > diff --git a/java/openjdk17/Makefile b/java/openjdk17/Makefile
> > index 5cb25e6aee72..ba7001ff2bd0 100644
> > --- a/java/openjdk17/Makefile
> > +++ b/java/openjdk17/Makefile
> > @@ -38,7 +38,7 @@ GH_PROJECT=   jdk17u
> >
> > NO_CCACHE=     yes
> >
> > -_MAKE_JOBS=    #
> > +MAKE_JOBS_UNSAFE=      yes
> > MAKE_ENV=      LANG="C" \
> >                LC_ALL="C" \
> >                CLASSPATH="" \
> 
> That's well spotted! I think this is definitely worth trying. I'm no
> expert on the ports Makefiles myself, but was told to use
> MAKE_JOBS_UNSAFE instead in the review for openjdk24. Haven't gone
> through all the ancient version yet, as my focus is mainly on mainline,
> and these days on openjdk25.
> 
> > I can commit this today to openjdk17 and if builds start to succeed to other openjdk* ports.
> 
> I'm in favour!
> 
> H!
> 
> 
> 

Hi Harald,

I found out what happens in openjdk23 and openjdk24 around _MAKE_JOBS.

_MAKE_JOBS is an internal variable in Mk/bsd.port.mk used to add "-j<MAKE_JOBS_NUMBER>" to the make command in do-build. It was set empty to suppress passing -j, because the port otherwise gives this error:
===>  Building for openjdk17-17.0.16+8.1_2
Error: 'make -jN' is not supported, use 'make JOBS=N'

NB: this error comes from work/jdk17u-jdk-17.0.16-8-1/make/InitSupport.gmk:119
In /usr/ports/Mk/bsd.port.mk we have these lines of code:
.    if defined(DISABLE_MAKE_JOBS) || defined(MAKE_JOBS_UNSAFE)
_MAKE_JOBS?=        #
MAKE_JOBS_NUMBER=   1
.    else
So setting _MAKE_JOBS is a side effect of MAKE_JOBS_UNSAFE. The suggestion of using MAKE_JOBS_UNSAFE was just another way of setting _MAKE_JOBS and MAKE_JOBS_NUMBER.
But the MAKE_JOBS_NUMBER is never passed to the (implicit) do-build target of the ports Makefile.

If you look in https://pkg-status.freebsd.org/beefy17/data/15stable-amd64-default/56c5cbbc8d99/logs/openjdk23-23.0.2+7.1_2.log and search for "jobs" you will find this:
checking for number of cores... 48
checking for memory size... 130685 MB
checking for appropriate number of jobs to run in parallel... 48
...
Build performance summary:
* Build jobs:     48
So, in summary
* MAKE_JOBS_UNSAFE sets _MAKE_JOBS empty and gives the suggestion of running without parallel jobs. But the port further ignores MAKE_JOBS_NUMBER and ...
* The port decides to run with 48 parallel jobs as it looks at the number of CPUs.
* A bit more documentation/comments around overriding the _MAKE_JOBS variable in the Makefile could have saved us quite some research. 😉

The current construction in openjdk17 handles MAKE_JOBS_NUMBER properly. And with that also the MAKE_JOBS_UNSAFE variable. After more testing we can use this blueprint in other openjdk ports.
Also in openjdk23 and -24. They don't have flapping builds but can improve handling of MAKE_JOBS_NUMBER.

Regards,
Ronald.
 
[-- Attachment #2 --]
<html><head></head><body><br>
<p><strong>Van:</strong> Harald Eilertsen &lt;haraldei@anduin.net&gt;<br>
<strong>Datum:</strong> donderdag, 11 september 2025 10:15<br>
<strong>Aan:</strong> Ronald Klop &lt;ronald-lists@klop.ws&gt;<br>
<strong>CC:</strong> java@freebsd.org<br>
<strong>Onderwerp:</strong> Re: openjdk build failures on "nm"</p>

<blockquote style="padding-right: 0px; padding-left: 5px; margin-left: 5px; border-left: #000000 2px solid; margin-right: 0px">
<div class="MessageRFC822Viewer" id="P">
<div class="TextPlainViewer" id="P.P">On Thu, Sep 11, 2025 at 09:32:08AM +0200, Ronald Klop wrote:<br>
&gt; As it seems hard to debug, what do the java@ maintainers think of this experiment?<br>
&gt;<br>
&gt; diff --git a/java/openjdk17/Makefile b/java/openjdk17/Makefile<br>
&gt; index 5cb25e6aee72..ba7001ff2bd0 100644<br>
&gt; --- a/java/openjdk17/Makefile<br>
&gt; +++ b/java/openjdk17/Makefile<br>
&gt; @@ -38,7 +38,7 @@ GH_PROJECT= &nbsp;&nbsp;jdk17u<br>
&gt;<br>
&gt; NO_CCACHE= &nbsp;&nbsp;&nbsp;&nbsp;yes<br>
&gt;<br>
&gt; -_MAKE_JOBS= &nbsp;&nbsp;&nbsp;#<br>
&gt; +MAKE_JOBS_UNSAFE= &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;yes<br>
&gt; MAKE_ENV= &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;LANG="C" \<br>
&gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;LC_ALL="C" \<br>
&gt; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;CLASSPATH="" \<br>
<br>
That's well spotted! I think this is definitely worth trying. I'm no<br>
expert on the ports Makefiles myself, but was told to use<br>
MAKE_JOBS_UNSAFE instead in the review for openjdk24. Haven't gone<br>
through all the ancient version yet, as my focus is mainly on mainline,<br>
and these days on openjdk25.<br>
<br>
&gt; I can commit this today to openjdk17 and if builds start to succeed to other openjdk* ports.<br>
<br>
I'm in favour!<br>
<br>
H!</div>

<hr></div>
</blockquote>
<br>
Hi Harald,<br>
<br>
I found out what happens in openjdk23 and openjdk24 around _MAKE_JOBS.<br>
<br>
_MAKE_JOBS is an internal variable in Mk/bsd.port.mk used to add "-j&lt;MAKE_JOBS_NUMBER&gt;" to the make command in do-build. It was set empty to suppress passing -j, because the port otherwise gives this error:
<pre class="description">===&gt;  Building for openjdk17-17.0.16+8.1_2
Error: 'make -jN' is not supported, use 'make JOBS=N'

NB: this error comes from work/jdk17u-jdk-17.0.16-8-1/make/InitSupport.gmk:119
</pre>
<br>
In /usr/ports/Mk/bsd.port.mk we have these lines of code:
<pre>.    if defined(DISABLE_MAKE_JOBS) || defined(MAKE_JOBS_UNSAFE)
_MAKE_JOBS?=        #
MAKE_JOBS_NUMBER=   1
.    else</pre>
<br>
So setting _MAKE_JOBS is a side effect of MAKE_JOBS_UNSAFE. The suggestion of using MAKE_JOBS_UNSAFE was just another way of setting _MAKE_JOBS and MAKE_JOBS_NUMBER.<br>
But the MAKE_JOBS_NUMBER is never passed to the (implicit) do-build target of the ports Makefile.<br>
<br>
If you look in&nbsp;<a href="https://pkg-status.freebsd.org/beefy17/data/15stable-amd64-default/56c5cbbc8d99/logs/openjdk23-23.0.2+7.1_2.log">https://pkg-status.freebsd.org/beefy17/data/15stable-amd64-default/56c5cbbc8d99/logs/openjdk23-23.0.2+7.1_2.log</a>&nbsp;and search for "jobs" you will find this:

<pre>checking for number of cores... 48
checking for memory size... 130685 MB
checking for appropriate number of jobs to run in parallel... 48
...
</pre>

<pre>Build performance summary:
* Build jobs:     48
</pre>
So, in summary<br>
* MAKE_JOBS_UNSAFE sets _MAKE_JOBS empty and gives the suggestion of running without parallel jobs. But the port further ignores MAKE_JOBS_NUMBER and ...<br>
* The port decides to run with 48 parallel jobs as it looks at the number of CPUs.<br>
* A bit more documentation/comments around overriding the _MAKE_JOBS variable in the Makefile could have saved us quite some research. 😉<br>
<br>
The current construction in openjdk17 handles MAKE_JOBS_NUMBER properly. And with that also the MAKE_JOBS_UNSAFE variable. After more testing we can use this blueprint in other openjdk ports.<br>
Also in openjdk23 and -24. They don't have flapping builds but can improve handling of MAKE_JOBS_NUMBER.<br>
<br>
Regards,<br>
Ronald.<br>
&nbsp;</body></html>
help

Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?387357483.2815.1757924099539>