Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 403991 - dev-python/pypy build system ignores MAKEOPTS
Summary: dev-python/pypy build system ignores MAKEOPTS
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Python Gentoo Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-02-16 02:25 UTC by Patrick Lauer
Modified: 2012-06-18 04:55 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
respect MAKEOPTS when translating (untested) (pypy-1.8-respect-makeopts.patch,608 bytes, patch)
2012-03-05 21:34 UTC, Marien Zwart (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Patrick Lauer gentoo-dev 2012-02-16 02:25:34 UTC
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 :)
Comment 1 Justin Lecher (RETIRED) gentoo-dev 2012-02-20 18:10:07 UTC
The bad is that I get build failures due to randomly set parallelism.
Comment 2 Patrick Lauer gentoo-dev 2012-03-05 08:10:05 UTC
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 ...
Comment 3 Marien Zwart (RETIRED) gentoo-dev 2012-03-05 21:34:11 UTC
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.
Comment 4 Marien Zwart (RETIRED) gentoo-dev 2012-03-05 21:34:34 UTC
Created attachment 304327 [details, diff]
respect MAKEOPTS when translating (untested)
Comment 5 Marien Zwart (RETIRED) gentoo-dev 2012-06-17 15:30:30 UTC
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.
Comment 6 Justin Lecher (RETIRED) gentoo-dev 2012-06-17 17:57:40 UTC
(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.
Comment 7 Marien Zwart (RETIRED) gentoo-dev 2012-06-17 19:38:09 UTC
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.
Comment 8 Alexander E. Patrakov 2012-06-18 04:55:00 UTC
(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.