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

Bug 700746

Summary: sys-fs/lxcfs fails emerge when cross compiling
Product: Gentoo Linux Reporter: Fergus Dall <sidereal>
Component: Current packagesAssignee: Erik Mackdanz <stasibear>
Status: RESOLVED FIXED    
Severity: normal CC: john, juippis, sidereal, virtualization
Priority: Normal Keywords: PATCH
Version: unspecified   
Hardware: AMD64   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: Proposed patch
Proposed patch (with Signed-off-by line)
Proposed patch (with Signed-off-by line)

Description Fergus Dall 2019-11-20 04:20:04 UTC
Emerge fails during configure phase because the configure script tries to check the distribution it's running on, which is forbidden when cross-compiling. This can be fixed by adding "--with-distro=gentoo" to the econf command. I will attach a patch to this bug.

Reproducible: Always

Steps to Reproduce:
1. Set up a Chrome OS development environment, as per https://chromium.googlesource.com/chromiumos/docs/+/master/developer_guide.md
2. Add the sys-fs/lxcfs to the overlay in //src/third-party/portage-stable
3. Run ./build_packaged --board tatl sys-fs/lxcfs
Actual Results:  
Emerging sys-fs/lxcfs fails during the configure phase with the following logs:

checking dependency style of x86_64-cros-linux-gnu-clang... (cached) none
checking for x86_64-cros-linux-gnu-clang option to accept ISO C99... none needed
checking for main in -lpthread... yes
checking pkg-config is at least version 0.9.0... yes
checking for FUSE... yes
checking for help2man... /usr/bin/help2man
checking host distribution... checking for /etc/redhat-release... configure: error: cannot check for file existence when cross compiling


I encountered this in the context of Chrome OS development, but the issue can probably be reproduced with a simpler set up
Comment 1 Fergus Dall 2019-11-20 04:37:15 UTC
Created attachment 596864 [details, diff]
Proposed patch
Comment 2 Fergus Dall 2019-11-20 04:45:51 UTC
Created attachment 596866 [details, diff]
Proposed patch (with Signed-off-by line)
Comment 3 Joonas Niilola gentoo-dev 2020-05-19 05:40:58 UTC
Hey, 

is this still a problem with 4.0.3? I don't see much changing in upstream about this...

Could you make a similar patch to 4.0.3 with sign-off? I don't want to touch the stable ebuild at all anymore, and intend to stabilize 4.0.3 ~soon and drop any older ones.
Comment 4 Fergus Dall 2020-06-01 12:28:37 UTC
Created attachment 643024 [details, diff]
Proposed patch (with Signed-off-by line)

Sorry for the slow response. I've confirmed that this is still needed for 4.0.3 and attached a new patch for that version.
Comment 5 Joonas Niilola gentoo-dev 2020-06-01 12:46:52 UTC
Ah, I was supposed to commit this fix with
https://gitweb.gentoo.org/repo/gentoo.git/commit/app-emulation/lxc?id=355c9e38d5aa95657add1cf52e0a11f9df88bd18

Thanks for the reminder and patch!
Comment 6 Larry the Git Cow gentoo-dev 2020-06-01 12:47:46 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c29d76ec44c5a81a96d99b32fe46cc1d889453f9

commit c29d76ec44c5a81a96d99b32fe46cc1d889453f9
Author:     Fergus Dall <sidereal@google.com>
AuthorDate: 2019-11-20 04:32:34 +0000
Commit:     Joonas Niilola <juippis@gentoo.org>
CommitDate: 2020-06-01 12:46:34 +0000

    sys-fs/lxcfs: Add "--with-distro=gentoo" to econf
    
    This is required for cross-compiling to work
    
    Closes: https://bugs.gentoo.org/700746
    Signed-off-by: Fergus Dall <sidereal@google.com>
    Signed-off-by: Joonas Niilola <juippis@gentoo.org>

 sys-fs/lxcfs/lxcfs-4.0.3.ebuild | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)