安装 XML::[email protected] 失败并出现错误:Alien::Libxml2 中“static”之前为“__thread”

问题描述 投票:0回答:1

我有一个 docker 映像,其构建曾经成功,直到最近我开始观察到由于 Alien::Libxml2 和以下错误而导致构建失败。

/root/.cpanm/work/1700643185.67/Alien-Libxml2-0.19/_alien/extract_21vy/libxml2-2.12.0/dict.c:912:1: error: ‘__thread’ before ‘static’
 XML_THREAD_LOCAL static int localRngInitialized = 0;
 ^
/root/.cpanm/work/1700643185.67/Alien-Libxml2-0.19/_alien/extract_21vy/libxml2-2.12.0/dict.c:913:1: error: ‘__thread’ before ‘static’
 XML_THREAD_LOCAL static unsigned localRngState[2];

下面提供了 docker 映像的片段。

RUN yum install -y \
        perl-App-cpanminus-1.6922-2.el7.noarch \
        perl-Class-MethodMaker-2.20-1.el7.x86_64 \
        perl-ExtUtils-MakeMaker-6.68-3.el7.noarch \
        openssl-1.0.2k-26.el7_9.x86_64 \
    && cpanm --force --verbose XML::[email protected] \ 
    && rm -rf ~/.cpanm $(pip cache dir) \
    && yum remove -y perl-App-cpanminus-1.6922-2.el7.noarch \
    && yum clean all

以下是相关日志。

Building and testing Alien-Libxml2-0.19 ... cp lib/Alien/Libxml2.pm blib/lib/Alien/Libxml2.pm
/usr/bin/perl -MAlien::Build::MM=cmd -e prefix site /usr/lib64/perl5 /usr/local/lib64/perl5 /usr/lib64/perl5/vendor_perl
Alien::Build::Plugin::PkgConfig::Negotiate> Using PkgConfig plugin: PkgConfig::CommandLine
main> prefix /usr/local/lib64/perl5/auto/share/dist/Alien-Libxml2
/usr/bin/perl -MAlien::Build::MM=cmd -e version 0.19
Alien::Build::Plugin::PkgConfig::Negotiate> Using PkgConfig plugin: PkgConfig::CommandLine
/usr/bin/perl -MAlien::Build::MM=cmd -e download
Alien::Build::Plugin::PkgConfig::Negotiate> Using PkgConfig plugin: PkgConfig::CommandLine
Alien::Build::Plugin::Core::Download> candidate *https://download.gnome.org/sources/libxml2/2.12/libxml2-2.12.0.tar.xz
Alien::Build::Plugin::Core::Download> candidate  https://download.gnome.org/sources/libxml2/2.11/libxml2-2.11.6.tar.xz
Alien::Build::Plugin::Core::Download> candidate  https://download.gnome.org/sources/libxml2/2.11/libxml2-2.11.5.tar.xz
Alien::Build::Plugin::Core::Download> candidate  https://download.gnome.org/sources/libxml2/2.11/libxml2-2.11.4.tar.xz
Alien::Build::Plugin::Core::Download> candidate  https://download.gnome.org/sources/libxml2/2.11/libxml2-2.11.3.tar.xz
Alien::Build::Plugin::Core::Download> candidate  https://download.gnome.org/sources/libxml2/2.11/libxml2-2.11.2.tar.xz
Alien::Build::Plugin::Core::Download> candidate  https://download.gnome.org/sources/libxml2/2.11/libxml2-2.11.1.tar.xz
Alien::Build::Plugin::Core::Download> candidate  https://download.gnome.org/sources/libxml2/2.11/libxml2-2.11.0.tar.xz
Alien::Build::Plugin::Core::Download> candidate  ...
Alien::Build::Plugin::Core::Download> setting version based on archive to 2.12.0
Alien::Build::Plugin::Core::Download> downloaded libxml2-2.12.0.tar.xz
/usr/bin/perl -MAlien::Build::MM=cmd -e build
Alien::Build::Plugin::PkgConfig::Negotiate> Using PkgConfig plugin: PkgConfig::CommandLine
Alien::Build::Plugin::Extract::CommandLine> + tar -xf /root/.cpanm/work/1700643185.67/Alien-Libxml2-0.19/_alien/download_P33B/libxml2-2.12.0.tar.xz
Alien::Build::CommandSequence> + /root/.cpanm/work/1700643185.67/Alien-Libxml2-0.19/_alien/extract_21vy/libxml2-2.12.0/configure --prefix=/usr/local/lib64/perl5/auto/share/dist/Alien-Libxml2 --with-pic --prefix=/usr/local/lib64/perl5/auto/share/dist/Alien-Libxml2 --without-python --disable-shared --enable-static
configure: loading site script /tmp/fnVMnUdRXE/config.site
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking for a BSD-compatible install... /bin/install -c
checking whether build environment is sane... yes
checking for a race-free mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether to enable maintainer-specific portions of Makefiles... yes
checking whether make supports nested variables... (cached) yes
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether the compiler supports GNU C... yes
checking whether gcc accepts -g... yes
checking for gcc option to enable C11 features... -std=gnu11
checking whether gcc -std=gnu11 understands -c and -o together... yes
checking whether make supports the include directive... yes (GNU style)
checking dependency style of gcc -std=gnu11... gcc3
checking whether ln -s works... yes
checking for tar... /bin/tar
checking for perl... /bin/perl
checking for wget... /bin/wget
checking for xsltproc... /usr/bin/xsltproc
checking pkg-config is at least version 0.9.0... yes
checking how to print strings... printf
checking for a sed that does not truncate output... /bin/sed
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for fgrep... /bin/grep -F
checking for ld used by gcc -std=gnu11... /bin/ld
checking if the linker (/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /bin/nm -B
checking the name lister (/bin/nm -B) interface... BSD nm
checking the maximum length of command line arguments... 1572864
checking how to convert x86_64-pc-linux-gnu file names to x86_64-pc-linux-gnu format... func_convert_file_noop
checking how to convert x86_64-pc-linux-gnu file names to toolchain format... func_convert_file_noop
checking for /bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for dlltool... no
checking how to associate runtime and link libraries... printf %s\n
checking for ar... ar
checking for archiver @FILE support... @
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /bin/nm -B output from gcc -std=gnu11 object... ok
checking for sysroot... no
checking for a working dd... /bin/dd
checking how to truncate binary pipes... /bin/dd bs=4096 count=1
checking for mt... no
checking if : is a manifest tool... no
checking for stdio.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for strings.h... yes
checking for sys/stat.h... yes
checking for sys/types.h... yes
checking for unistd.h... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking if gcc -std=gnu11 supports -fno-rtti -fno-exceptions... no
checking for gcc -std=gnu11 option to produce PIC... -fPIC -DPIC
checking if gcc -std=gnu11 PIC flag -fPIC -DPIC works... yes
checking if gcc -std=gnu11 static flag -static works... no
checking if gcc -std=gnu11 supports -c -o file.o... yes
checking if gcc -std=gnu11 supports -c -o file.o... (cached) yes
checking whether the gcc -std=gnu11 linker (/bin/ld -m elf_x86_64) supports shared libraries... yes
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... no
checking whether to build static libraries... yes
checking for cos in -lm... yes
checking for stdint.h... (cached) yes
checking for inttypes.h... (cached) yes
checking for fcntl.h... yes
checking for unistd.h... (cached) yes
checking for sys/stat.h... (cached) yes
checking for sys/mman.h... yes
checking for sys/socket.h... yes
checking for netinet/in.h... yes
checking for arpa/inet.h... yes
checking for netdb.h... yes
checking for sys/select.h... yes
checking for poll.h... yes
checking for sys/time.h... yes
checking for sys/timeb.h... yes
checking for dl.h... no
checking for dlfcn.h... (cached) yes
checking for glob.h... yes
checking for uint32_t... yes
checking for snprintf... yes
checking for vsnprintf... yes
checking for gettimeofday... yes
checking for ftime... yes
checking for stat... yes
checking for isascii... yes
checking for mmap... yes
checking for munmap... yes
checking for va_copy... yes
checking whether va_list is an array type... yes
checking for library containing gethostbyname... none required
checking for library containing connect... none required
checking for type of socket length (socklen_t)... socklen_t *
checking whether to enable IPv6... yes
checking whether __attribute__((destructor)) is accepted... yes
checking whether the linker accepts -Wl,--undefined-version... no
checking for library containing dlopen... -ldl
checking for pthread.h... yes
checking for library containing pthread_join... -lpthread
checking for Z... yes
checking for LZMA... yes
checking for libiconv... none required
Disabling ICU support
Disabling code coverage for GCC
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating include/Makefile
config.status: creating include/libxml/Makefile
config.status: creating include/private/Makefile
config.status: creating doc/Makefile
config.status: creating doc/examples/Makefile
config.status: creating doc/devhelp/Makefile
config.status: creating example/Makefile
config.status: creating fuzz/Makefile
config.status: creating python/Makefile
config.status: creating python/tests/Makefile
config.status: creating xstc/Makefile
config.status: creating include/libxml/xmlversion.h
config.status: creating libxml-2.0.pc
config.status: creating libxml-2.0-uninstalled.pc
config.status: creating libxml2-config.cmake
config.status: creating python/setup.py
config.status: creating xml2-config
config.status: creating config.h
config.status: executing depfiles commands
config.status: executing libtool commands
Alien::Build::CommandSequence> + make
make[1]: Entering directory `/root/.cpanm/work/1700643185.67/Alien-Libxml2-0.19/_alien/build_2FW_'
make  all-recursive
make[2]: Entering directory `/root/.cpanm/work/1700643185.67/Alien-Libxml2-0.19/_alien/build_2FW_'
Making all in include
make[3]: Entering directory `/root/.cpanm/work/1700643185.67/Alien-Libxml2-0.19/_alien/build_2FW_/include'
Making all in libxml
make[4]: Entering directory `/root/.cpanm/work/1700643185.67/Alien-Libxml2-0.19/_alien/build_2FW_/include/libxml'
make[4]: Nothing to be done for `all'.
make[4]: Leaving directory `/root/.cpanm/work/1700643185.67/Alien-Libxml2-0.19/_alien/build_2FW_/include/libxml'
Making all in private
make[4]: Entering directory `/root/.cpanm/work/1700643185.67/Alien-Libxml2-0.19/_alien/build_2FW_/include/private'
make[4]: Nothing to be done for `all'.
make[4]: Leaving directory `/root/.cpanm/work/1700643185.67/Alien-Libxml2-0.19/_alien/build_2FW_/include/private'
make[4]: Entering directory `/root/.cpanm/work/1700643185.67/Alien-Libxml2-0.19/_alien/build_2FW_/include'
make[4]: Nothing to be done for `all-am'.
make[4]: Leaving directory `/root/.cpanm/work/1700643185.67/Alien-Libxml2-0.19/_alien/build_2FW_/include'
make[3]: Leaving directory `/root/.cpanm/work/1700643185.67/Alien-Libxml2-0.19/_alien/build_2FW_/include'
Making all in .
make[3]: Entering directory `/root/.cpanm/work/1700643185.67/Alien-Libxml2-0.19/_alien/build_2FW_'
  CC       xmllint-xmllint.o
  CC       libxml2_la-buf.lo
  CC       libxml2_la-chvalid.lo
  CC       libxml2_la-dict.lo
/root/.cpanm/work/1700643185.67/Alien-Libxml2-0.19/_alien/extract_21vy/libxml2-2.12.0/dict.c:912:1: error: ‘__thread’ before ‘static’
 XML_THREAD_LOCAL static int localRngInitialized = 0;
 ^
/root/.cpanm/work/1700643185.67/Alien-Libxml2-0.19/_alien/extract_21vy/libxml2-2.12.0/dict.c:913:1: error: ‘__thread’ before ‘static’
 XML_THREAD_LOCAL static unsigned localRngState[2];
 ^
make[3]: *** [libxml2_la-dict.lo] Error 1
make[3]: Leaving directory `/root/.cpanm/work/1700643185.67/Alien-Libxml2-0.19/_alien/build_2FW_'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/root/.cpanm/work/1700643185.67/Alien-Libxml2-0.19/_alien/build_2FW_'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/root/.cpanm/work/1700643185.67/Alien-Libxml2-0.19/_alien/build_2FW_'
external command failed at /usr/local/share/perl5/Alien/Build/CommandSequence.pm line 88.
make: *** [_alien/mm/build] Error 2
FAIL
! Installing Alien::Libxml2 failed. See /root/.cpanm/work/1700643185.67/build.log for details. Retry with --force to force install it.
! Installing the dependencies failed: Module 'Alien::Libxml2' is not installed
! Bailing out the installation for XML-LibXML-2.0208.
16 distributions installed

最近没有对 perl 或 os 进行版本升级,直到几天前,相同的映像构建得很好。我的猜测是该模块的分布发生了一些变化,导致了失败,但我在网上没有找到任何与之相关的内容。

我也尝试过使用 --force 标签;它确实有助于在本地计算机上安装 XML::[email protected] 模块,但与 docker 映像一起使用时则没有帮助。我正在寻找对此解决方案的修复,因为升级到最新版本,即 XML::[email protected] 没有解决问题。

c docker perl cpan
1个回答
0
投票

既然您考虑过 XML::[电子邮件受保护],我假设您也对 XML::[电子邮件受保护]

持开放态度

您只提供了

Dockerfile
中的一个片段,因此基本图像和设置只是一个假设。

🗎

Dockerfile

FROM centos:7

RUN yum install -y epel-release && \
    yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm

ENV PERL_MM_USE_DEFAULT=1

RUN yum install -y \
        gcc \
        perl-App-cpanminus-1.6922-2.el7.noarch \
        perl-Class-MethodMaker-2.20-1.el7.x86_64 \
        perl-ExtUtils-MakeMaker-6.68-3.el7.noarch \
        openssl-1.0.2k-26.el7_9.x86_64

RUN cpanm \
        [email protected] \
        FFI::[email protected] \
        Alien::Build::Plugin::Download::[email protected] \
        XML::[email protected] \
        XML::[email protected]

RUN yum remove -y perl-App-cpanminus-1.6922-2.el7.noarch && \
    yum clean all
© www.soinside.com 2019 - 2024. All rights reserved.