Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 723222 - dev-perl/Data-Dump-Streamer broken by LD!=CCLD
Summary: dev-perl/Data-Dump-Streamer broken by LD!=CCLD
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Gentoo Perl team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: perl-toolchain
  Show dependency tree
 
Reported: 2020-05-15 10:21 UTC by Agostino Sarubbo
Modified: 2020-09-19 09:17 UTC (History)
1 user (show)

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


Attachments
build.log (build.log,8.33 KB, text/plain)
2020-05-15 10:21 UTC, Agostino Sarubbo
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Agostino Sarubbo gentoo-dev 2020-05-15 10:21:32 UTC
This is an auto-filed bug because dev-perl/Data-Dump-Streamer fails to compile.
The issue was originally discovered on amd64, but it may be reproducible on other arches as well.
If you think that a different summary clarifies the issue better, feel free to change it.
Attached build log and emerge --info.

NOTE:
If you need further logs, feel free to ask.
Comment 1 Agostino Sarubbo gentoo-dev 2020-05-15 10:21:40 UTC
Created attachment 639312 [details]
build.log

build log and emerge --info
Comment 2 Kent Fredric (IRC: kent\n) (RETIRED) gentoo-dev 2020-05-15 14:19:22 UTC
No real interesting build code in this, its just using Module::Build as far as I can tell, so its likely ExtUtils::CBuilder ( which is used by Module::Build ), or Module::Build doing it wrong.

(Which basically means anything that has a ".xs" file in its source, depends on dev-perl/Module-Build, and ships a Build.PL, will fail the same way)
Comment 3 Kent Fredric (IRC: kent\n) (RETIRED) gentoo-dev 2020-05-15 14:47:00 UTC
the "active" code that presents that warning:

https://metacpan.org/release/Module-Build/source/lib/Module/Build/Base.pm#L1528-1534

>    if ( ! $self->have_c_compiler ) {
>       $self->log_warn(<<'EOM');
> Warning: ExtUtils::CBuilder not installed or no compiler detected
> Proceeding with configuration, but compilation may fail during Build
>  
> EOM
>     }


that is ultimately answered by:

https://metacpan.org/release/Module-Build/source/lib/Module/Build/Base.pm#L5314-5315

>   my $b = $self->cbuilder;
>   my $have = $b && eval { $b->have_compiler };

And have_compiler does a test compile in ->compile, which gets its CC from:

  my @cc = $self->split_like_shell($args{'C++'} ? $cf->{cxx} : $cf->{cc});

( https://metacpan.org/source/AMBS/ExtUtils-CBuilder-0.280234/lib/ExtUtils/CBuilder/Base.pm#L146-226 )

And $cf is the configuration hash that is built during ExtUtils::CBuilder->new(), which, by default, inherits its value of "cc" from Perl's Config.pm , which _Should_ be the value you get when you do:

   perl -V:cc

*UNLESS* You have CC= explicitly defined in ENV, which will override perl's choice. 

So please report what `/usr/bin/perl -V:cc` does on a system with this failure.

( It should be a valid CC, and if not, either perl is broken, or the valid CC was removed after building perl )

Though its entirely possible the logic changed since the perl you're using, vs the sources i'm reading, but my diff of the version I'm showing and the one before perl 5.26 is:

https://metacpan.org/diff/file?target=AMBS/ExtUtils-CBuilder-0.280234/&source=AMBS%2FExtUtils-CBuilder-0.280224

And there's zero changes in that set that could be imagined to affect this at all.
Comment 4 Agostino Sarubbo gentoo-dev 2020-05-15 14:58:52 UTC
It seems that overwrite CC does not change it always reports x86_64-pc-linux-gnu-gcc

$ /usr/bin/perl -V:cc
cc='x86_64-pc-linux-gnu-gcc';

$ export CC="foo" ; /usr/bin/perl -V:cc
cc='x86_64-pc-linux-gnu-gcc';
Comment 5 Kent Fredric (IRC: kent\n) (RETIRED) gentoo-dev 2020-05-15 15:19:35 UTC
(In reply to Agostino Sarubbo from comment #4)
> It seems that overwrite CC does not change it always reports
> x86_64-pc-linux-gnu-gcc
> 
> $ /usr/bin/perl -V:cc
> cc='x86_64-pc-linux-gnu-gcc';
> 
> $ export CC="foo" ; /usr/bin/perl -V:cc
> cc='x86_64-pc-linux-gnu-gcc';

Setting CC in ENV never changes what `perl -V:cc` does, it always returns the hardcoded config.

The only place CC gets respected, is the logic in ExtUtils::CBuilder, which internally replaces perl's default with the value of $ENV{CC} when present.

https://metacpan.org/source/AMBS/ExtUtils-CBuilder-0.280234/lib/ExtUtils/CBuilder/Base.pm#L36-39

> while (my ($k,$v) = each %Config) {
>    $self->{config}{$k} = $v unless exists $self->{config}{$k};
>  }
>  $self->{config}{cc} = $ENV{CC} if defined $ENV{CC};

( And %Config is the dataset you're seeing with perl -V:cc )
Comment 6 Kent Fredric (IRC: kent\n) (RETIRED) gentoo-dev 2020-05-16 02:28:28 UTC
Ah, no, this isn't CC related, this is LD="ld" when it needs to be LD="cc" related.

> x86_64-pc-linux-gnu-ld: unrecognised emulation mode: arch=native

That's why I can't reproduce this.

CCLD shit is harder to fix than AR/CC stuff.

Works fine for me with stock perl with only ar,gcc,cc nuked and AR= and CC= defined.
Comment 7 Agostino Sarubbo gentoo-dev 2020-06-15 13:41:15 UTC
I can reproduce with perl-5.30.3-r1 too
Comment 8 Larry the Git Cow gentoo-dev 2020-07-05 21:36:29 UTC
The bug has been referenced in the following commit(s):

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

commit 5bf738c5f0c57446d435263b7e10ab104bdad9f6
Author:     Kent Fredric <kentnl@gentoo.org>
AuthorDate: 2020-07-05 21:36:03 +0000
Commit:     Kent Fredric <kentnl@gentoo.org>
CommitDate: 2020-07-05 21:36:03 +0000

    dev-perl/Data-Dump-Streamer: -r bump for EAPI7 + Toolchain love
    
    - EAPI7
    - Ensure not to break when LD!=CCLD
    - Ensure CFLAGS passed to compiler
    
    Bug: https://bugs.gentoo.org/723222
    Package-Manager: Portage-2.3.100, Repoman-2.3.22
    Signed-off-by: Kent Fredric <kentnl@gentoo.org>

 .../Data-Dump-Streamer-2.400.0-r1.ebuild           | 54 ++++++++++++++++++++++
 1 file changed, 54 insertions(+)
Comment 9 Kent Fredric (IRC: kent\n) (RETIRED) gentoo-dev 2020-09-19 09:17:41 UTC
commit d5196d6d72969b442b2f050a59ca51eac95df264
Author: Kent Fredric <kentnl@gentoo.org>
Date:   2020-08-18 21:14:58 +1200

    dev-perl/Data-Dump-Streamer: Cleanup old 2.400.0
    
    Package-Manager: Portage-2.3.103, Repoman-2.3.22
    Signed-off-by: Kent Fredric <kentnl@gentoo.org>