Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 704776 - sys-apps/file-5.38 breaks cross compilaton
Summary: sys-apps/file-5.38 breaks cross compilaton
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-01-04 16:24 UTC by Andrew Aladjev
Modified: 2020-01-04 18:34 UTC (History)
1 user (show)

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


Attachments
build log (build.log,53.05 KB, text/plain)
2020-01-04 17:04 UTC, Andrew Aladjev
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Aladjev 2020-01-04 16:24:56 UTC
Hello. I can cross compile =sys-apps/file-5.37-r1, but =sys-apps/file-5.38 fails.

mips-unknown-linux-gnu-emerge -v1 =sys-apps/file-5.37-r1

/bin/sh ../libtool  --tag=CC   --mode=compile mips-unknown-linux-gnu-gcc -DHAVE_CONFIG_H -I. -I/usr/mips-unknown-linux-gnu/tmp/portage/sys-apps/file-5.37-r1/work/file-5.37/src ...


mips-unknown-linux-gnu-emerge -v1 =sys-apps/file-5.38

x86_64-pc-linux-gnu-gcc -DHAVE_CONFIG_H -I. -I/usr/mips-unknown-linux-gnu/tmp/portage/sys-apps/file-5.38/work/file-5.38/src ...

It uses wrong compiler somehow.
Comment 1 Andrew Aladjev 2020-01-04 16:43:28 UTC
We can see that workaround for #362941 failed.

# when cross-compiling, we need to build up our own file
# because people often don't keep matching host/target
# file versions #362941
if tc-is-cross-compiler && ! ROOT=/ has_version ~${CATEGORY}/${P} ; then

My container (with mips toolchain installed) has =sys-apps/file-5.37-r1 installed so "has_version ~${CATEGORY}/${P}" is false and workaround is not active. This workaround doesn't looks healthy.

I think that "SpanKY" developer is the author of this code. Please assign this bug to him. Thank you.
Comment 2 Lars Wendler (Polynomial-C) (RETIRED) gentoo-dev 2020-01-04 16:49:10 UTC
(In reply to Andrew Aladjev from comment #1)
> 
> I think that "SpanKY" developer is the author of this code. Please assign
> this bug to him. Thank you.

Mike (a.k.a. SpanKY) is in base-system team, so this bug is already assigned to the correct target.
Comment 3 Mike Gilbert gentoo-dev 2020-01-04 16:59:54 UTC
Please attach the build log.
Comment 4 Andrew Aladjev 2020-01-04 17:01:05 UTC
Hello Mike, I've fixed workaround by replacing

econf --disable-shared --disable-libseccomp

with 

econf --disable-shared --disable-libseccomp --disable-fsect-man5 --disable-bzlib --disable-xzlib --disable-zlib

Please update it, maybe it can be removed? Thank you.
Comment 5 Andrew Aladjev 2020-01-04 17:01:46 UTC
I will attach build log in 2 minutes, sorry.
Comment 6 Andrew Aladjev 2020-01-04 17:04:54 UTC
Created attachment 602550 [details]
build log
Comment 7 Mike Gilbert gentoo-dev 2020-01-04 17:21:52 UTC
(In reply to Andrew Aladjev from comment #4)

Ah, that's helpful; so it's failing because the package has grown some additional optional dependencies that we need to disable for the minimal CBUILD configuration.
Comment 8 Andrew Aladjev 2020-01-04 17:50:54 UTC
Yes, file v5.38 received new bzip2 and lzma deps. Maybe we need to disable it in cross compile workaround.
Comment 9 Larry the Git Cow gentoo-dev 2020-01-04 18:08:52 UTC
The bug has been closed via the following commit(s):

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

commit 30b0ca3905ccd1bff0a5f1641adf2226d57f23b1
Author:     Mike Gilbert <floppym@gentoo.org>
AuthorDate: 2020-01-04 18:07:12 +0000
Commit:     Mike Gilbert <floppym@gentoo.org>
CommitDate: 2020-01-04 18:08:29 +0000

    sys-apps/file: refactor cross-compile logic
    
    Add build_src_configure and need_build_file helper functions.
    Pass --disable-{bzlib,xzlib,zlib} to configure in build_src_configure.
    Use tc-env_build helper in build_src_configure.
    Convert "ROOT=/ has_version" to PMS-compliant "has_version -b".
    Make ECONF_SOURCE and PATH local variables.
    
    Closes: https://bugs.gentoo.org/704776
    Package-Manager: Portage-2.3.84_p2, Repoman-2.3.20_p24
    Signed-off-by: Mike Gilbert <floppym@gentoo.org>

 sys-apps/file/file-5.38.ebuild | 42 ++++++++++++++++++++++++------------------
 sys-apps/file/file-9999.ebuild | 42 ++++++++++++++++++++++++------------------
 2 files changed, 48 insertions(+), 36 deletions(-)
Comment 10 Mike Gilbert gentoo-dev 2020-01-04 18:10:28 UTC
This is partially untested as I don't have a working cross-compiler at the moment. Please re-open the bug if it you encounter problems.
Comment 11 Andrew Aladjev 2020-01-04 18:34:57 UTC
I've tested new ebuild now - work perfect for my current mips toolchain. Thank you.