tech-pkg archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: zig 0.17.1 ignores MAKE_JOBS



November 5, 2026 at 10:42 AM, "Greg Troxel" <gdt%lexort.com@localhost mailto:gdt%lexort.com@localhost?to=%22Greg%20Troxel%22%20%3Cgdt%40lexort.com%3E > wrote:


> 
> ivan%ivanpollak.com@localhost mailto:ivan%ivanpollak.com@localhost  writes:
> 
> > 
> > I noticed that the latest zig version ignores the 10 cores that I've set for
> >  pkgsrc but rather uses all my 12 cores. I'm pretty sure that this shouldn't
> >  be like that.
> > 
> Determining parallelism of 10 vs 12 seems very difficult, and you didn't
> explain how you reached this conclusion. Did you see 12 build jobs in
> ps?
> 
> I suggest that you build it with MAKE_JOBS=1 and then it will be
> clearer.

Tested it again with 1 and it seems that this was my error. Usually when building
programs, 10 cores are at 90-100% and 2 at 15-20% in btop, but yesterday all of them
were at 100%. Not sure why, didn't had anything open but a terminl window...
Also I noticed that the  cores constantly swap. Its not one that is pushed all the
time, but rather C2 then after a few seconds C3, then C5...

> 
> It's a modern disease (in the same vein as languages thinking it's good
> to have their own packaging systems and vendor things in) for
> langauges/systems to think they should determine how many cpus exist and
> use them. This is narcissistic of the language culture, assuming it is
> the only thing that matters. Traditionally, make ran one job, and -jN
> told it to run N, and this was straightforward.
> 
> In pkgsrc, we have been detecting the bad behvaior of "default
> equiv-of-jN to number of CPUs" and patching it out, typically needing
> language-specific mechanisms (e.g. GOMAXPROC). It is possible zig needs
> this too.
> 
> I suggest that you:
>  - do builds with MAKE_JOBS=1 and see what happens, to confirm there
>  is a problem
>  - read zig's build documentation to see what it says
>  - search in zig mailinglists or whatever
>  - if it's not documented clearly, and running more than one thread,
>  file a bug with zig
>  - if it is documented clearly and there is a way to set parallelism,
>  then either edit it into the Makefile or send a very concise
>  statement of what to do here
> 
> > 
> > Also the package takes quite some while for the installation
> >  process (and also all the 12 cores). This seems a bit weird because I thought
> >  that installing something most times is just copying files over to another
> >  directory, I might be wrong about this though.
> > 
> In general install can be parallelized too. You are saying "takes all
> the 12 cores", but that sounds funny to me as install should be mostly
> IO bound. How are you determining this? ("Load Average" is some
> combination of running/runnable processes including those blocked on
> IO.)

I've tested it again with MAKE_JOBS=1 and this seems to actually cause all cores
to be used. Also it really takes an eternity. It takes longer to install zig than
to build it.


Home | Main Index | Thread Index | Old Index