Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 27 Oct 2021 16:23:40 +0200
From:      Piotr Kubaj <pkubaj@anongoth.pl>
To:        Alexey Dokuchaev <danfe@freebsd.org>
Cc:        ports-committers@freebsd.org, dev-commits-ports-all@freebsd.org, dev-commits-ports-main@freebsd.org
Subject:   Re: git: 981564583497 - main - net/cjdns: fix build on powerpc64*
Message-ID:  <YXlg7IMwniDx32C%2B@KGPE-D16>
In-Reply-To: <YXj02W6rRXC0ZSTA@FreeBSD.org>
References:  <202110261848.19QImqrt031580@gitrepo.freebsd.org> <YXj02W6rRXC0ZSTA@FreeBSD.org>

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

--3RZko24Ko6ngRveI
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

Not really:
> os.cpus()
[]
> Math.floor((os.cpus() =3D=3D [] ? 1 : cpus.length) * 1.25)
Uncaught ReferenceError: cpus is not defined
> Math.floor((os.cpus() =3D=3D 0 ? 1 : cpus.length) * 1.25)
1

On 21-10-27 06:42:33, Alexey Dokuchaev wrote:
> On Tue, Oct 26, 2021 at 06:48:52PM +0000, Piotr Kubaj wrote:
> > commit 9815645834977fe2ada5052d3c81881b7624bed7
> >=20
> >     net/cjdns: fix build on powerpc64*
> >    =20
> >     On powerpc64 and powerpc64le systems, os.cpus(), gets defined to []:
> >     > cpus =3D os.cpus()
> >     []
> >    =20
> >     It has type object:
> >     > typeof cpus
> >     'object'
> >    =20
> >     This causes jobs to be 0:
> >     > Math.floor((typeof cpus =3D=3D=3D 'undefined' ? 1 : cpus.length) =
* 1.25);
> >     0
> >    =20
> >     Change it so that instead of comparing type to undefined, we compar=
e to 0:
> >     > Math.floor((os.cpus() =3D=3D 0 ? 1 : cpus.length) * 1.25);
>=20
> Wouldn't os.cpus() =3D=3D [] be more correct^Wreadable?
>=20
> On a related note, JavaScript is horrible language, don't write in it.
> Pro tip: if some $lang has =3D=3D=3D operator, it's highly likely that it=
 is
> just as bad.
>=20
> ./danfe

--3RZko24Ko6ngRveI
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----

iQIzBAABCgAdFiEEycyIeNkkgohzsoorelmbhSCDnJ0FAmF5YOwACgkQelmbhSCD
nJ0gUw/6AoM3/XDBAdh3Q02h60rVPbj1Ob8FQfSaRTZd+sXSDrjM2dhcsUhx5+CH
eJneP6KNvE970NAF3bhF8odL5h5DGqh3CCB1VLRRpqI+1AQhVACfL6+ixNqbw55s
MfxlF9EQUFRrOyPp5hn8eKVRiP0diq8T6Uj3OY9/Us9IJHzP70eUQurwQqp1QNHf
5pbzH2jpP6zh0q8teYjx+8wdraUZEY0z/B/mmka4v273GoVrCTg4IchmlwItDiCo
nFYJCwauR4eMmMSZGuFT5AHVtjJz22T4/M+Id1Z2kQDQnrZR1GX7ab0NbIOA0u7W
dSOxY/PpN8SuO9bPpG1hBGYvQDy6CupHCGQL8A1R7SEedfhQk8qry0WDQ5zwHhDk
7q9qGlnXWevPxS3MwsxP28rj0ZuDVGkwoYfkiSGv3rmoRqDsYDdtJnpVm+8MZVCT
ckZmdMymk9yAxutomWOsol6iKFwXDjHQWNaqqgxuqFwbITGiHUC5uITvzs1Du5sv
+x+VnllDk7WB5nxEOgC6vl8FQtH3W9jxbr86647FkqbAW5CXIJvEcmdMF6pf4JP0
pBNtuz8A/hIVnEOcnyN+qRKQvLhI6SM4BSx/u/sZFQ/tLawH168flnw4a0MYR1Ht
DBLAWYxjFY+DEEgtA9izO+WuqdPToyXTiW05oEVmcA06jd23TtI=
=nxaQ
-----END PGP SIGNATURE-----

--3RZko24Ko6ngRveI--



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