PDCurses icon indicating copy to clipboard operation
PDCurses copied to clipboard

make -j fails for libXCurses

Open parov0z opened this issue 11 months ago • 2 comments

When using parallel build, it randomly fails, because targets are not syncronized.

Add this line to makefile: $(PDCLIBS) : .WAIT $(SHOFILES)

parov0z avatar Jan 10 '25 16:01 parov0z

Ideally, we should add that line somewhere in makefile.in, so that it'll then appear in makefile after you run configure.

I've been trying to replicate this, without success thus far. I assume I'm doing something slightly different from you, but haven't figured out what yet. I've tried running ./configure with both --enable-debug and without, and with varying numbers after -j. I think you'd be most likely to run into the problem with larger numbers of simultaneous jobs, though. I tried running with -j70, thinking that ought to cause just about everything to be built at once and therefore make any synchronization issues obvious. But... so far, I can't break it. Any hints on how to get this to fail?

Bill-Gray avatar Jan 12 '25 03:01 Bill-Gray

Any hints on how to get this to fail?

I was able to reproduce on 2 machines with nproc=4 and 12 Make sure you have disabled ccache if it's installed

The problem is .o files are being moved and then restored while making .sho libXCurses.a only waits for .o and if any .sho target is being built at the same time, we may see 'file not found' error.

And of course this line obviously needs to be in makefile.in

Also, I have to say that I have a very poor knowledge about makefiles, and maybe this solution is not perfect.

parov0z avatar Jan 13 '25 06:01 parov0z