In pkg_setup, the glibc ebuild dies if it's working on a previous version of glibc than the one installed. It should warn there and fail in pkg_preinst. One applicable reason for people to want to build a previous version of glibc, but not install it: I build all the packages for all of my systems on my fastest system and each system installs the one appropriate. Right now, my main box is on the latest version of glibc, so I can't build packages for more reasonable versions of glibc. I'd make the change myself (and have in an overlay), but I have no idea what the process is to submit this sort of thing. Reproducible: Always
most people who downgrade do it because they want to downgrade, not because they want to test compile if you want to test compile, dont run the setup step: ebuild <glibc ebuild> clean unpack compile install
Not 'test compile'. I'm talking about building a package for another system. By not fixing this, you are preventing anyone from setting up a standard build system for potentially more than one platform. Is there a reason that moving that check would break something or cause an undesirable effect?
unless there's a way to detect portage is doing -B, then you'll have to work around the issue by doing: ROOT=// emerge sys-libs/glibc -B i told you why it's undesirable: people would waste time building an entire glibc (which is not fast) only to have it call die
Maybe an ewarn message in pkg_setup would be sufficient, with the die to pkg_preinst. There's currently no clues in the environment for the ebuild to determine that it's executing in --buildpkgonly mode. We can add an EAPI extension for that, similar to bug 154495.
once we update glibc to a newer EAPI, we can fix this
i've added the check, but it won't really start working until the EAPI is updated. but that's being done elsewhere. Commit message: Check MERGE_TYPE when doing downgrade check http://sources.gentoo.org/sys-libs/glibc/files/eblits/pkg_setup.eblit?r1=1.11&r2=1.12