Bug 7789 - perl is broken in cenbuild
Summary: perl is broken in cenbuild
Status: CLOSED FIXED
Alias: None
Product: ThinLinc
Classification: Unclassified
Component: Build system (show other bugs)
Version: trunk
Hardware: PC Unknown
: P2 Normal
Target Milestone: 4.14.0
Assignee: Pierre Ossman
URL:
Keywords: prosaic, samuel_tester
Depends on:
Blocks: 7778
  Show dependency treegraph
 
Reported: 2021-11-05 09:32 CET by Pierre Ossman
Modified: 2021-11-09 14:56 CET (History)
2 users (show)

See Also:
Acceptance Criteria:


Attachments

Description Pierre Ossman cendio 2021-11-05 09:32:18 CET
There is something broken with perl in its current state in cenbuild. It happens to work for everyone since we are using a very old build of perl (since 2014). If we rebuild it, however, we get a slightly broken version.

This was seen with bug 7778 where autoconf fails to build. The issue is that the expression "$!{EEXIST}" doesn't evaluate properly. It is supposed to return true if errno is current EEXIST. But it always seems to return false.
Comment 1 Pierre Ossman cendio 2021-11-05 09:35:27 CET
There is also some problem building perl for x86_64. It fails to link to the math functions properly:

> /usr/bin/ld: pp_sys.c:(.text+0x1ecf): undefined reference to `ceil'
> /usr/bin/ld: pp_sys.c:(.text+0x1f68): undefined reference to `fmod'
> /usr/bin/ld: pp_sys.c:(.text+0x1fe7): undefined reference to `floor'
> /usr/bin/ld: pp_sys.c:(.text+0x2240): undefined reference to `ceil'
Comment 2 Pierre Ossman cendio 2021-11-05 12:17:32 CET
The primary issue is fixed in a later version of perl, so a simple upgrade seems to solve that. The linking problem on x86_64 still remains after an upgrade though.

That issue turns out to be bug 7790. No idea why we haven't seen that until now. Perhaps something changed the last time we upgraded gcc?
Comment 3 Pierre Ossman cendio 2021-11-05 12:20:06 CET
Fixing gcc is a major task, so we'll try to work around things in the perl build instead. There seems to be some support for different environment variables for the different stages, but not for $LIBRARY_PATH that we are using. I've added a feature request for that though:

https://github.com/arsv/perl-cross/issues/121

For now we'll have to translate $LIBRARY_PATH to $LDFLAGS instead so we can get different behaviour for miniperl and perl.
Comment 5 Pierre Ossman cendio 2021-11-05 12:43:45 CET
Fixed now. The test program we used was:

> #!/usr/bin/perl
> 
> my $ok = mkdir "/tmp/test";
> my $errno = int($!);
> my $errmsg = "$!";
> my $iseperm = $!{EPERM};
> my $iseexist = $!{EEXIST};
> 
> die "$ok | $errno | $errmsg | $iseexist | $iseperm";

On a broken system the last two variables would be the empty string. On a working system they should either be 0 or the corresponding errno value.
Comment 6 Pierre Ossman cendio 2021-11-09 09:38:51 CET
Build of GTK+ fails with:

> Can't use 'defined(@array)' (Maybe you should just omit the defined()?) at /opt/docker-cenbuild/cenbuild/repo/rpmbuild/BUILD/gtk+-2.16.5/demos/gtk-demo/geninclude.pl line 43.

Apparently this is fixed in GTK+ 2.24:

https://gitlab.gnome.org/GNOME/gtk/-/commit/3da748930fdcb19aaae32ae2fc6cb2d802857752
Comment 7 Pierre Ossman cendio 2021-11-09 11:03:17 CET
Upgrading GTK+ is a massive snow ball, so let's just grab the fix instead.
Comment 9 Pierre Ossman cendio 2021-11-09 11:09:39 CET
Workaround in place and GTK+ now builds fine.
Comment 10 Linn cendio 2021-11-09 11:33:57 CET
I have some issues building server and client locally. I get an error complaining about perl-XML-Parser missing:

> 11:17:13 [linma@linma thinlinc-git]$ make client-macos-iso 
> ...
> checking for perl... /usr/bin/perl
> checking for perl >= 5.8.1... 5.34.0
> checking for XML::Parser... configure: error: XML::Parser perl module is required for intltool
> make[2]: *** [pulseaudio/src/pulseaudio] Error 2
> make[2]: Leaving directory `/local/home/linma/thinlinc-git/ctc/buildarea/BUILD/thinlinc-client'
> make[1]: *** [tl-client-macos.iso] Error 2
> make[1]: Leaving directory `/local/home/linma/thinlinc-git/ctc/client'
> make: *** [Makefile:830: client/tl-client-macos.iso] Error 2

It might be related to our upgrading of perl. My installed versions are perl 5.34.0 and perl-XML-Parser 2.36.
Comment 11 Pierre Ossman cendio 2021-11-09 12:20:08 CET
It contains a .so file, so it seems it needs a rebuild when perl is upgraded:

> $ echo 'use XML::Parser;' | cbrun x86_64 perl
> Can't load '/usr/lib64/perl5/vendor_perl/auto/XML/Parser/Expat/Expat.so' for module XML::Parser::Expat: /usr/lib64/perl5/vendor_perl/auto/XML/Parser/Expat/Expat.so: undefined symbol: PL_sv_yes at /usr/lib64/perl5/DynaLoader.pm line 193.
>  at /usr/lib64/perl5/vendor_perl/XML/Parser.pm line 14.
> Compilation failed in require at /usr/lib64/perl5/vendor_perl/XML/Parser.pm line 14.
> BEGIN failed--compilation aborted at /usr/lib64/perl5/vendor_perl/XML/Parser.pm line 18.
> Compilation failed in require at - line 1.
> BEGIN failed--compilation aborted at - line 1.
Comment 13 Pierre Ossman cendio 2021-11-09 12:21:34 CET
Did an upgrade at the same time, and it now loads properly:

> $ echo 'use XML::Parser;' | cbrun x86_64 perl
Comment 14 Samuel Mannehed cendio 2021-11-09 14:56:07 CET
I can reproduce the EEXIST error using cendio-build-perl-i386-5.20.1-3.noarch and run into the "undefined reference to `floor'" error when building cendio-build-perl-x86_64.

I can also reproduce the XML::Parser error when building the macOS ThinLinc client using cendio-build-perl-XML-Parser-osx64-2.36-2.noarch.

With the new cenbuild code that includes the LIBRARY_PATH fix I can successfully build a new release of cendio-build-perl-x86_64.

After upgrading to 5.34.0-1 of cendio-build-perl, I can no longer reproduce the EEXIST error in the cbrun environment.

Lastly, with the upgraded cendio-build-perl-XML-Parser packages I can also successfully build the client-macos-iso target.

Note You need to log in before you can comment on or make changes to this bug.