Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bugzilla DB migration completed. Please report issues to Infra team via email via infra@gentoo.org or IRC
Bug 555374 - sys-apps/portage restores old value of CXX which is no longer valid
Summary: sys-apps/portage restores old value of CXX which is no longer valid
Status: CONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal major (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-07-19 17:57 UTC by Michał Górny
Modified: 2016-01-30 13:03 UTC (History)
1 user (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2015-07-19 17:57:06 UTC
* Messages for package net-libs/webkit-gtk-2.4.9-r200:

 * ERROR: net-libs/webkit-gtk-2.4.9-r200::gentoo failed (pretend phase):
 *   You need at least GCC 4.7.x or Clang >= 3.3 for C++11-specific compiler flags

This happens when I try to install previously-built webkit-gtk binary package. And it happens because Portage restores old value of CXX which is no longer valid.

I'd say two bugs here. @gnome faulting at checking compiler flags during binary package install, and @dev-portage for restoring old values of CXX and other configuration variables for pkg_pretend().
Comment 1 Zac Medico gentoo-dev 2015-07-19 18:18:48 UTC
(In reply to Michał Górny from comment #0)
> @dev-portage for restoring old values of CXX and
> other configuration variables for pkg_pretend().

We could define a list of special environment variables somewhere, for compatibility between package managers.
Comment 2 Ulrich Müller gentoo-dev 2015-07-19 19:02:43 UTC
(In reply to Zac Medico from comment #1)
> (In reply to Michał Górny from comment #0)
> > @dev-portage for restoring old values of CXX and
> > other configuration variables for pkg_pretend().
> 
> We could define a list of special environment variables somewhere, for
> compatibility between package managers.

https://projects.gentoo.org/pms/5/pms.html#x1-12200011.2
"Note: pkg_pretend is not part of the normal call sequence, and does not take part in environment saving."
Comment 3 Zac Medico gentoo-dev 2015-07-19 20:21:35 UTC
(In reply to Ulrich Müller from comment #2)
> (In reply to Zac Medico from comment #1)
> > (In reply to Michał Górny from comment #0)
> > > @dev-portage for restoring old values of CXX and
> > > other configuration variables for pkg_pretend().
> > 
> > We could define a list of special environment variables somewhere, for
> > compatibility between package managers.
> 
> https://projects.gentoo.org/pms/5/pms.html#x1-12200011.2
> "Note: pkg_pretend is not part of the normal call sequence, and does not
> take part in environment saving."

But for binary packages, it makes sense to call the pkg_pretend function _from_ the saved build-time environment, since the ebuilds/eclasses that the binary package was built with might not even be available when pkg_pretend is executed. Since pkg_pretend originates from a saved environment, doesn't if follow that some of the environment variables might also come from the saved environment?
Comment 4 Ulrich Müller gentoo-dev 2015-07-19 20:53:49 UTC
(In reply to Zac Medico from comment #3)
> (In reply to Ulrich Müller from comment #2)
> > https://projects.gentoo.org/pms/5/pms.html#x1-12200011.2
> > "Note: pkg_pretend is not part of the normal call sequence, and does not
> > take part in environment saving."
> 
> But for binary packages, it makes sense to call the pkg_pretend function
> _from_ the saved build-time environment, since the ebuilds/eclasses that the
> binary package was built with might not even be available when pkg_pretend
> is executed. Since pkg_pretend originates from a saved environment, doesn't
> if follow that some of the environment variables might also come from the
> saved environment?

No objections to this interpretation. The problem is with the ebuild, which shouldn't rely on any particular state of the environment (i.e. being saved, or not being saved) in pkg_pretend().
Comment 5 Zac Medico gentoo-dev 2015-07-20 00:55:50 UTC
A condition like [[ ${MERGE_TYPE} != binary ]] might be useful in the webkit-gtk pkg_pretend.
Comment 6 Ulrich Müller gentoo-dev 2015-07-23 20:24:10 UTC
Do we need to clarify the spec?

"Note: pkg_pretend is not part of the normal call sequence, and does not take part in environment saving. For binary packages, variables in pkg_pretend may have a value that was assigned previously in the build sequence; ebuilds must not rely on this."
Comment 7 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2015-07-23 20:31:07 UTC
The spec is supposed not to cover binary packages, so I'm not sure if it's the right thing to mention problems with Portage implementation of them. If at all, I would go for something like 'you can't rely on environment variables having any sane values'.
Comment 8 Alexandre Rostovtsev (RETIRED) gentoo-dev 2015-07-26 04:25:05 UTC
Thanks, that was an obvious mistake in our ebuild, should be fixed now. Reassigning remaining half of the issue to portage, since I don't thing there is anything left for gnome to do :)

+  26 Jul 2015; Alexandre Rostovtsev <tetromino@gentoo.org>
+  webkit-gtk-2.4.8.ebuild, webkit-gtk-2.4.8-r200.ebuild,
+  webkit-gtk-2.4.9.ebuild, webkit-gtk-2.4.9-r200.ebuild,
+  webkit-gtk-2.6.5.ebuild, webkit-gtk-2.6.6.ebuild, webkit-gtk-2.8.3.ebuild:
+  Don't check for c++11 support in pkg_pretend when installing binpkg (bug
+  #555374, thanks to Michał Górny). Check for disk space in pkg_setup under
+  the same conditions as in pkg_pretend (this logic was accidentally dropped in
+  the 2.6.x bump).