Seen during build: [platform:execute] gcc -c -O3 -pthread -fomit-frame-pointer -Wall -Wno-unused -O2 -pipe /var/tmp/portage/dev-python/pypy-1.8/temp/usession-release-1.8-0/platcheck_49.c -o /var/tmp/portage/dev-python/pypy-1.8/temp/usession-release-1.8-0/platcheck_49.o [platform:execute] make -j 3 in /var/tmp/portage/dev-python/pypy-1.8/temp/usession-release-1.8-0/testing_1 So it ignores CFLAGS and MAKEOPTS - might be nice to make it behave :)
The bad is that I get build failures due to randomly set parallelism.
cflags: pypy/translator/platform/linux.py: cflags = tuple( ['-O3', '-pthread', '-fomit-frame-pointer', '-Wall', '-Wno-unused'] + os.environ.get('CFLAGS', '').split()) makeopts: pypy/translator/c/genc.py: extra_opts += ['-j', str(self.config.translation.make_jobs)] It's a maze of riddles ...
CFLAGS are not ignored: the -O3 default is sensibly overridden as long as -Oanything is in CFLAGS, and none of the other flags you saw should be removed. In fact I had pypy break because of the -march value in my CFLAGS (this has already been fixed). I do not think removing the -O3 default (which would only affect people trying to build an -O0 pypy by leaving -O out of CFLAGS completely) is worth doing. I'm about to attach an untested patch that replaces the default guess at -j for make with use of MAKEOPTS. I think we could take that one as gentoo-specific improvement. Alternatively we could extract the -j value from MAKEOPTS in the ebuild and pass it to to translate.py using --make-jobs. The advantage of that approach is that it doesn't require patching, the disadvantage is that I know no great way of getting -j from MAKEOPTS (there's some awkward sed for it in the libreoffice ebuild and perl-module eclass). Just patching pypy seems far more straightforward, and as we really are calling make passing all MAKEOPTS instead of just using -j makes sense.
Created attachment 304327 [details, diff] respect MAKEOPTS when translating (untested)
pypy-1.9-r1 picks up -j from MAKEOPTS. CFLAGS and a bunch of other variables should already be used (appended after the pypy defaults). Please file a fresh bug if anything misses, or if there's a good reason to pick up more than just -j from MAKEOPTS.
(In reply to comment #5) > pypy-1.9-r1 picks up -j from MAKEOPTS. CFLAGS and a bunch of other variables > should already be used (appended after the pypy defaults). Please file a > fresh bug if anything misses, or if there's a good reason to pick up more > than just -j from MAKEOPTS. There is a good reason to pick up -l as well.
Right, but that'd require a patch to pypy. I'll see about writing one that takes the flags to pass on to make on the commandline (a less gentoo-specific version of the one attached to this bug), or feel free to do that yourself and run it by upstream. Personally I don't think -l is important enough for gentoo to patch the pypy build system.
(just verifying that the bug is closed correctly) The change that you made to the number of jobs can theoretically affect the amount of RAM used during the build. If necessary, please adjust the minimum requirement that is checked against. Or just ignore this comment if there is nothing to do.