From nobody Mon Sep 15 08:14:59 2025 X-Original-To: java@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cQHrr6zC7z68FR6 for ; Mon, 15 Sep 2025 08:15:08 +0000 (UTC) (envelope-from ronald-lists@klop.ws) Received: from smtp-relay-int-backup.realworks.nl (smtp-relay-int-backup.realworks.nl [87.255.56.188]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4cQHrq4P3Rz3XDk for ; Mon, 15 Sep 2025 08:15:07 +0000 (UTC) (envelope-from ronald-lists@klop.ws) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=klop.ws header.s=rw2 header.b=lvwQKTyj; dmarc=pass (policy=quarantine) header.from=klop.ws; spf=pass (mx1.freebsd.org: domain of ronald-lists@klop.ws designates 87.255.56.188 as permitted sender) smtp.mailfrom=ronald-lists@klop.ws Received: from smtp-relay-int-backup.realworks.nl (crmpreview6.colo2.realworks.nl [10.2.52.36]) by mailrelayint2.colo2.realworks.nl (Postfix) with ESMTP id 4cQHrh0CySzRM; Mon, 15 Sep 2025 10:14:59 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=klop.ws; s=rw2; t=1757924100; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=Nad6UREhstEQPZOE6sBqhaHikaZ5EpEgJhgNwkzQg5c=; b=lvwQKTyjZAaR0pRFjiu3CKVuaM3APqi8pgMRo/ph3BuFytrznhEH9DXS6E/YO+rID1I5kS ToTAh2gALGXNObLGEE/OFcP2dxjeZMFNWp8W+puFxYMk3eMNXcFkAEgNUxazV7lJDcDzx8 CY6zyqoqshlTpLBcYgCx5NXiGBzVhN2chG+H2PFCnOLqq/Z4vt/oYoejkGBjMAJJA+1Xui x4clANof5405BuGX7LwUpEkjRp5sdb0w4NWTS6uFPQGAJktxBApP5uFyE2d0SsCdnIQYsi 8WxVc8sl/NJLUAtEY9loYEtENC5Sugr1y3pJhqd5a8ptBDrzozRpGS39ddMaEw== Received: from crmpreview6.colo2.realworks.nl (localhost [127.0.0.1]) by crmpreview6.colo2.realworks.nl (Postfix) with ESMTP id BD91C200316; Mon, 15 Sep 2025 10:14:59 +0200 (CEST) Date: Mon, 15 Sep 2025 10:14:59 +0200 (CEST) From: Ronald Klop To: Harald Eilertsen Cc: java@freebsd.org Message-ID: <387357483.2815.1757924099539@localhost> In-Reply-To: References: <1221594030.658.1756976173189@localhost> <1330428831.1750.1756980558066@localhost> <2053927433.1876.1757575928041@localhost> Subject: (solved, I think) Re: openjdk build failures on "nm" List-Id: Porting Java to FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-java List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-java@FreeBSD.org MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_2814_372412663.1757924099532" X-Mailer: Realworks (765.87) X-Originating-Host: from (178.230.89.71 [178.230.89.71]) by crmpreview6.colo2.realworks.nl [10.2.52.36] with HTTP; Mon, 15 Sep 2025 10:14:59 +0200 Importance: Normal X-Priority: 3 (Normal) X-Originating-User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:142.0) Gecko/20100101 Firefox/142.0 X-Spamd-Bar: --- X-Spamd-Result: default: False [-3.50 / 15.00]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_SHORT(-1.00)[-1.000]; DMARC_POLICY_ALLOW(-0.50)[klop.ws,quarantine]; MID_RHS_NOT_FQDN(0.50)[]; R_SPF_ALLOW(-0.20)[+ip4:87.255.56.128/26]; R_DKIM_ALLOW(-0.20)[klop.ws:s=rw2]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; ARC_NA(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; RCVD_TLS_LAST(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; HAS_X_PRIO_THREE(0.00)[3]; MLMMJ_DEST(0.00)[java@freebsd.org]; RCPT_COUNT_TWO(0.00)[2]; RCVD_COUNT_TWO(0.00)[2]; TO_DN_SOME(0.00)[]; DKIM_TRACE(0.00)[klop.ws:+] X-Rspamd-Queue-Id: 4cQHrq4P3Rz3XDk ------=_Part_2814_372412663.1757924099532 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable Van: Harald Eilertsen Datum: donderdag, 11 september 2025 10:15 Aan: Ronald Klop CC: java@freebsd.org Onderwerp: Re: openjdk build failures on "nm" >=20 > 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=3D jdk17u > > > > NO_CCACHE=3D yes > > > > -_MAKE_JOBS=3D # > > +MAKE_JOBS_UNSAFE=3D yes > > MAKE_ENV=3D LANG=3D"C" \ > > LC_ALL=3D"C" \ > > CLASSPATH=3D"" \ >=20 > 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. >=20 > > I can commit this today to openjdk17 and if builds start to succeed to = other openjdk* ports. >=20 > I'm in favour! >=20 > H! >=20 >=20 >=20 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" to the make command in do-build. It was set empty to suppress = passing -j, because the port otherwise gives this error: =3D=3D=3D> Building for openjdk17-17.0.16+8.1_2 Error: 'make -jN' is not supported, use 'make JOBS=3DN' 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?=3D # MAKE_JOBS_NUMBER=3D 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 MA= KE_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-d= efault/56c5cbbc8d99/logs/openjdk23-23.0.2+7.1_2.log and search for "jobs" y= ou 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 runnin= g 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 o= f CPUs. * A bit more documentation/comments around overriding the _MAKE_JOBS variab= le in the Makefile could have saved us quite some research. =F0=9F=98=89 The current construction in openjdk17 handles MAKE_JOBS_NUMBER properly. An= d with that also the MAKE_JOBS_UNSAFE variable. After more testing we can u= se 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. =20 ------=_Part_2814_372412663.1757924099532 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable

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:08A= M +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=3D   jdk17u
>
> NO_CCACHE=3D     yes
>
> -_MAKE_JOBS=3D    #
> +MAKE_JOBS_UNSAFE=3D      yes
> MAKE_ENV=3D      LANG=3D"C" \
>            &nbs= p;   LC_ALL=3D"C" \
>            &nbs= p;   CLASSPATH=3D"" \

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<MAK= E_JOBS_NUMBER>" to the make command in do-build. It was set empty to sup= press passing -j, because the port otherwise gives this error:
=3D=3D=3D>  Building for openjdk17-17.0.16+8.=
1_2
Error: 'make -jN' is not supported, use 'make JOBS=3DN'

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?=3D        #
MAKE_JOBS_NUMBER=3D   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 MA= KE_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/l= ogs/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 runnin= g 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 o= f CPUs.
* A bit more documentation/comments around overriding the _MAKE_JOBS variab= le in the Makefile could have saved us quite some research. =F0=9F=98=89
The current construction in openjdk17 handles MAKE_JOBS_NUMBER properly. An= d with that also the MAKE_JOBS_UNSAFE variable. After more testing we can u= se 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.
  ------=_Part_2814_372412663.1757924099532--