Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 446172

Summary: sys-libs/pam-1.1.5 fails to cross-compile because flex is not installed in the target
Product: Gentoo Linux Reporter: Ambroz Bizjak <ambrop7>
Component: [OLD] Core systemAssignee: PAM Gentoo Team (OBSOLETE) <pam-bugs+disabled>
Status: RESOLVED INVALID    
Severity: normal CC: alexanders83, chewi, steev, zerochaos
Priority: Normal Keywords: PATCH
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on: 317337    
Bug Blocks:    
Attachments: build log
pam-1.1.5.ebuild-flex-check.patch
pam-1.1.5.ebuild-flex-hdepend.patch

Description Ambroz Bizjak 2012-12-05 22:11:04 UTC
PAM requires that libfl.a from sys-devel/flex be present in the target root at build time. When building for native, this is not a problem, because there is a DEPEND on sys-devel/flex. But for cross-compile, DEPEND by default means that the package is needed on the host, so there is no guarantee that flex will also be present in the target filesystem.

Reproducible: Always

Steps to Reproduce:
1. Make sure sys-devel/flex is not installed in the target (!) filesystem
2. Try to cross-compile sys-libs/pam
Comment 1 Ambroz Bizjak 2012-12-05 22:13:52 UTC
Created attachment 331570 [details]
build log
Comment 2 Ambroz Bizjak 2012-12-05 22:23:52 UTC
Created attachment 331572 [details, diff]
pam-1.1.5.ebuild-flex-check.patch

This patch adds a manual check into the ebuild to abort if flex is not installed, and instructs the user to cross-compile flex and try again (as opposed to failing with an obscure error).

A proper solution for this bug will only be possible after the features in the experimental EAPI 5-hdepend become part of an official EAPI. Then, sys-devel will be put both into HDEPEND and DEPEND, ensuring it is installed in both the host and the target at build time. For more information, see http://blogs.gentoo.org/zmedico/2012/09/25/experimental-eapi-5-hdepend/ .

P.S. I'm not sure if the flex check should instead go into pkg_pretend()? If that was done, consider that on native installs, flex may not be installed in pkg_pretend() but will be by the time the package is built, as a dependency, so tc-is-cross-compiler really is necessary.
Comment 3 Ambroz Bizjak 2012-12-05 22:47:59 UTC
Created attachment 331576 [details, diff]
pam-1.1.5.ebuild-flex-hdepend.patch

Proper fix utilizing HDEPEND.
P.S. This bug should depend on 317337 (EAPI HDEPEND support).
Comment 4 Alexander Stein 2013-01-09 09:31:25 UTC
I'm doing cross-compiling myself and can confirm that installing flex on the build-host is required. So reply #3 seems correct
Comment 5 James Le Cuirot gentoo-dev 2014-01-15 12:32:25 UTC
Ambroz, you can add the dependency on bug #317337 yourself since you created this bug. I have filed a couple of other use-cases for HDEPEND, autogen and dbus-glib.
Comment 6 SpanKY gentoo-dev 2014-05-08 22:30:23 UTC
the pam package has DEPEND=sys-devel/flex.  that is sufficient to cross-compile.
Comment 7 James Le Cuirot gentoo-dev 2014-05-08 23:22:45 UTC
Mike, please reopen this. flex needs to be installed to the *target* which DEPEND can't help with.