Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 446172 - sys-libs/pam-1.1.5 fails to cross-compile because flex is not installed in the target
Summary: sys-libs/pam-1.1.5 fails to cross-compile because flex is not installed in th...
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: PAM Gentoo Team (OBSOLETE)
URL:
Whiteboard:
Keywords: PATCH
Depends on: 317337
Blocks:
  Show dependency tree
 
Reported: 2012-12-05 22:11 UTC by Ambroz Bizjak
Modified: 2014-05-08 23:22 UTC (History)
4 users (show)

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


Attachments
build log (pam-log,178.72 KB, text/plain)
2012-12-05 22:13 UTC, Ambroz Bizjak
Details
pam-1.1.5.ebuild-flex-check.patch (pam-1.1.5.ebuild-flex-check.patch,541 bytes, patch)
2012-12-05 22:23 UTC, Ambroz Bizjak
Details | Diff
pam-1.1.5.ebuild-flex-hdepend.patch (pam-1.1.5.ebuild-flex-hdepend.patch,1.13 KB, patch)
2012-12-05 22:47 UTC, Ambroz Bizjak
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.