Summary: | =sys-libs/glibc-2.28-r5 - pkg_postinst(): run_locale_gen() uses MAKEOPTS from build target | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | tt_1 <herrtimson> |
Component: | Current packages | Assignee: | Gentoo Toolchain Maintainers <toolchain> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | alexander |
Priority: | Normal | ||
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
See Also: | https://bugs.gentoo.org/show_bug.cgi?id=736794 | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Attachments: | patch against glibc-2.29-r2 ebuild |
Description
tt_1
2019-03-17 15:05:13 UTC
locale-gen always runs with '--jobs $(makeopts_jobs)' parameter: https://gitweb.gentoo.org/repo/gentoo.git/tree/sys-libs/glibc/glibc-2.28-r5.ebuild#n1113 https://dev.gentoo.org/~ulm/pms/head/pms.html does not say anything special about MAKEOPTS. It means MAKEOPTS is stored in environment as any other variable and is not dynamically changeable in pkg_*() phases. $ cat b680782-0.ebuild EAPI=6 inherit multiprocessing DESCRIPTION="Reproducer for https://bugs.gentoo.org/680782" HOMEPAGE="https://bugs.gentoo.org/680782" KEYWORDS="amd64 x86" LICENSE="GPL-2" SLOT="0" S="${WORKDIR}" src_install() { einfo "src_install() jobs: $(makeopts_jobs)"; } pkg_postinst() { einfo "src_install() jobs: $(makeopts_jobs)"; } # MAKEOPTS=-j4 emerge --buildpkgonly app-misc/b680782 --quiet-build=n * src_install() jobs: 4 # MAKEOPTS=-j2 emerge --usepkg app-misc/b680782 --quiet-build=n * src_install() jobs: 4 We could do something for ${MERGE_TYPE} == "binary" > Nontheless, this shouldn't happen, as it can possibly cause destruction if the discrepance of cores between host and target is way higher, and the amount of locales to be generated much higher. Running 400 processes is totally fine on a single core as long as RAM used for locale-generation is reasonable. restraining to -j1 for ${MERGE_TYPE} == "binary" would be just fine in my opinion. (In reply to tt_1 from comment #2) > restraining to -j1 for ${MERGE_TYPE} == "binary" would be just fine in my > opinion. It would slow glibc installation down for everyone who builds binary packages locally just before an upgrade. Do you mean in case of FEATURES="buildpkg" ? Got the same problem. 6 localedef processes is too much for my arm board: $ sudo dmesg | grep -i killed [423527.159682] Killed process 937 (localedef) total-vm:77484kB, anon-rss:74584kB, file-rss:24kB, shmem-rss:0kB I thinks it's clearly a package manager issue. It should restore MAKEOPTS to its original state after restoring environment at least in pkg_* phases... or doesn't store MAKEOPTS in environment in the first place. (In reply to Alexander Tsoy from comment #5) > Got the same problem. 6 localedef processes is too much for my arm board: > > $ sudo dmesg | grep -i killed > [423527.159682] Killed process 937 (localedef) total-vm:77484kB, > anon-rss:74584kB, file-rss:24kB, shmem-rss:0kB > > I thinks it's clearly a package manager issue. It should restore MAKEOPTS to > its original state after restoring environment at least in pkg_* phases... > or doesn't store MAKEOPTS in environment in the first place. As a workaround you can set lower MAKEOPTS on a host machine where you build glibc. Gentoo's package manager specification does not say anything special about MAKEOPTS. Hence it will be preserved in the environmet as the rest of options. Thus I would say it's not a problem in package manager but in a glibc ebuild. So, what is the status of this? Do you deem it to be fixable by dropping to -j1 with some fancy guards for merge type binary, in src_install? If so, I might be able to cook up something and attach a possible patch for the glibc ebuild. Thanks I'm not aware of any work done in this area thus status is unchanged: we need a tweak in glibc ebuild. I don't think there is a way to implement it cleanly. Aside from moving locale generation into another package. '[[ ${MERGE_TYPE} = "binary" ]]' might might be goot enough compromise. It will slow down all binary package users though. Created attachment 586536 [details, diff]
patch against glibc-2.29-r2 ebuild
Would this attempt work? In case you were willing to slow down locale-gen to -j1 for everyone who uses a binpkg, no matter how strong the hardware? :-)
(In reply to tt_1 from comment #9) > Created attachment 586536 [details, diff] [details, diff] > patch against glibc-2.29-r2 ebuild > > Would this attempt work? In case you were willing to slow down locale-gen to > -j1 for everyone who uses a binpkg, no matter how strong the hardware? :-) > if [[ ${MERGE_TYPE} == !"binary" ]] ; then That is not a valid match syntax. You might want to look at USE=compile-locales added no recent glibcs. That shifts locale generation from pkg_*() to src_*() phases and makes locale-gen a no-op. fixed in glibc-2.29-r5! :) |