ContinuumIO / anaconda-issues

Anaconda issue tracking
648 stars 224 forks source link

link to gcc_linux-64 compiler in sysroot folder is broken #10690

Open nehaljwani opened 5 years ago

nehaljwani commented 5 years ago

From @luvaul on February 28, 2019 5:46

Current Behavior

Compilation fails when I use cpanm to install a missing Perl module with C components:

(alertsdp) lance@manta:~> cpanm PDL::IO::FITS
--> Working on PDL::IO::FITS
Fetching http://www.cpan.org/authors/id/C/CH/CHM/PDL-2.019.tar.gz ... OK
Configuring PDL-2.019 ... OK
Building and testing PDL-2.019 ... FAIL
! Installing PDL::IO::FITS failed. See /home/lance/.cpanm/work/1551325415.19933/build.log for details. Retry with --force to force install it.
(alertsdp) lance@manta:~> grep x86_64-conda_cos6-linux-gnu-gcc /home/lance/.cpanm/work/1551325415.19933/build.log
/tmp/build/80754af9/perl_1527832170752/_build_env/bin/x86_64-conda_cos6-linux-gnu-gcc -c  "-I/home/lance/.cpanm/work/1551325415.19933/PDL-2.019/Basic/Core" -D_REENTRANT -D_GNU_SOURCE --sysroot=/tmp/build/80754af9/perl_1527832170752/_build_env/x86_64-conda_cos6-linux-gnu/sysroot -fwrapv -fno-strict-aliasing -pipe -fstack-protector-strong -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_FORTIFY_SOURCE=2 -O2   -DVERSION=\"2.019\" -DXS_VERSION=\"2.019\" -fPIC --sysroot=/tmp/build/80754af9/perl_1527832170752/_build_env/x86_64-conda_cos6-linux-gnu/sysroot "-I/home/lance/miniconda3/envs/alertsdp/lib/5.26.2/x86_64-linux-thread-multi/CORE"  -DBADVAL=1 -DBADVAL_USENAN=0 -DBADVAL_PER_PDL=0 Core.c
/bin/sh: /tmp/build/80754af9/perl_1527832170752/_build_env/bin/x86_64-conda_cos6-linux-gnu-gcc: No such file or directory

Looks like the link to the compiler (from gcc_linux-64) in the sysroot folder under /tmp/build is broken, but I can't check because the sysroot folder is deleted after the build attempt. (I think gcc_linux-64 is a dependency of, and was installed because of, the perl package which I install as you'll see below.)

Steps to Reproduce

wget https://repo.anaconda.com/miniconda/Miniconda2-latest-Linux-x86_64.sh
chmod +x Miniconda2-latest-Linux-x86_64.sh
./Miniconda2-latest-Linux-x86_64.sh
rm -f Miniconda2-latest-Linux-x86_64.sh
# logout then back in
#conda update conda conda-env  # have tried with & without this step: same result
conda create -n alertsdp
conda activate alertsdp
conda config --env --add channels eumetsat --add channels http://ssb.stsci.edu/astroconda --add channels bioconda --add channels conda-forge --add channels defaults
conda install python=2.7 perl-app-cpanminus perl-dbi perl-dbd-pg perl-inline perl-inline-c perl-test-leaktrace perl-list-moreutils perl-pegex perl-digest-sha1 perl-extutils-cbuilder perl-file-map perl-test-exception perl-test-warn perl-test-deep perl-module-build perl-sub-uplevel perl-capture-tiny
cpanm PDL::IO::FITS

Additional Debugging Info

(alertsdp) lance@manta:~> conda deactivate
(base) lance@manta:~> CONDA_BUILD=1 conda activate alertsdp | grep CC=
+CC=/home/lance/miniconda2/envs/alertsdp/bin/x86_64-conda_cos6-linux-gnu-cc
+GCC=/home/lance/miniconda2/envs/alertsdp/bin/x86_64-conda_cos6-linux-gnu-gcc
(base) lance@manta:~> conda activate alertsdp
(alertsdp) lance@manta:~> printenv | grep SYSCONFIGDATA
_CONDA_PYTHON_SYSCONFIGDATA_NAME=_sysconfigdata_x86_64_conda_cos6_linux_gnu
(alertsdp) lance@manta:~> python -c "import sysconfig; print sysconfig.get_config_var('CC')"
x86_64-conda_cos6-linux-gnu-gcc -pthread
(alertsdp) lance@manta:~> ls -alF /home/lance/miniconda2/envs/alertsdp/bin | grep cc
lrwxrwxrwx  1 lance comp      31 Feb 28 16:34 gcc -> x86_64-conda_cos6-linux-gnu-gcc*
lrwxrwxrwx  1 lance comp      31 Feb 28 16:33 x86_64-conda_cos6-linux-gnu-cc -> x86_64-conda_cos6-linux-gnu-gcc*
-rwxrwxr-x  2 lance comp  904080 Aug 22  2018 x86_64-conda_cos6-linux-gnu-gcc*
-rwxrwxr-x  2 lance comp   25560 Aug 22  2018 x86_64-conda_cos6-linux-gnu-gcc-ar*
-rwxrwxr-x  2 lance comp   25528 Aug 22  2018 x86_64-conda_cos6-linux-gnu-gcc-nm*
-rwxrwxr-x  2 lance comp   25528 Aug 22  2018 x86_64-conda_cos6-linux-gnu-gcc-ranlib*

Expected Behavior

That the compilation/installation would proceed without issue.

Environment Information

`conda info`

``` (alertsdp) lance@manta:~> conda info active environment : alertsdp active env location : /home/lance/miniconda2/envs/alertsdp shell level : 2 user config file : /home/lance/.condarc populated config files : /home/lance/miniconda2/envs/alertsdp/.condarc conda version : 4.5.12 conda-build version : not installed python version : 2.7.15.final.0 base environment : /home/lance/miniconda2 (writable) channel URLs : https://repo.anaconda.com/pkgs/main/linux-64 https://repo.anaconda.com/pkgs/main/noarch https://repo.anaconda.com/pkgs/free/linux-64 https://repo.anaconda.com/pkgs/free/noarch https://repo.anaconda.com/pkgs/r/linux-64 https://repo.anaconda.com/pkgs/r/noarch https://repo.anaconda.com/pkgs/pro/linux-64 https://repo.anaconda.com/pkgs/pro/noarch https://conda.anaconda.org/conda-forge/linux-64 https://conda.anaconda.org/conda-forge/noarch https://conda.anaconda.org/bioconda/linux-64 https://conda.anaconda.org/bioconda/noarch http://ssb.stsci.edu/astroconda/linux-64 http://ssb.stsci.edu/astroconda/noarch https://conda.anaconda.org/eumetsat/linux-64 https://conda.anaconda.org/eumetsat/noarch package cache : /home/lance/miniconda2/pkgs /home/lance/.conda/pkgs envs directories : /home/lance/miniconda2/envs /home/lance/.conda/envs platform : linux-64 user-agent : conda/4.5.12 requests/2.21.0 CPython/2.7.15 Linux/3.10.0-862.6.3.el7.x86_64 centos/7 glibc/2.17 UID:GID : 317:1024 netrc file : None offline mode : False ```

`conda config --show-sources`

``` (alertsdp) lance@manta:~> conda config --show-sources ==> /home/lance/miniconda2/envs/alertsdp/.condarc <== channels: - defaults - conda-forge - bioconda - http://ssb.stsci.edu/astroconda - eumetsat ```

`conda list --show-channel-urls`

``` (alertsdp) lance@manta:~> conda list --show-channel-urls # packages in environment at /home/lance/miniconda2/envs/alertsdp: # # Name Version Build Channel binutils_impl_linux-64 2.31.1 h6176602_1 defaults binutils_linux-64 2.31.1 h6176602_6 defaults ca-certificates 2019.1.23 0 defaults certifi 2018.11.29 py27_0 defaults gcc_impl_linux-64 7.3.0 habb00fd_1 defaults gcc_linux-64 7.3.0 h553295d_6 defaults krb5 1.16.1 hc83ff2d_6 defaults libedit 3.1.20181209 hc058e9b_0 defaults libffi 3.2.1 hd88cf55_4 defaults libgcc-ng 8.2.0 hdf63c60_1 defaults libpq 10.5 h1ad7b7a_0 defaults libstdcxx-ng 8.2.0 hdf63c60_1 defaults make 4.2.1 h1bed415_1 defaults ncurses 6.1 he6710b0_1 defaults openssl 1.0.2r h7b6447c_0 defaults perl 5.26.2 h14c3975_0 defaults perl-app-cpanminus 1.7044 pl526_1 bioconda perl-capture-tiny 0.48 pl526_0 bioconda perl-carp 1.38 pl526_1 bioconda perl-constant 1.33 pl526_1 bioconda perl-cpan-meta 2.150010 pl526_0 bioconda perl-cpan-meta-requirements 2.140 pl526_0 bioconda perl-cpan-meta-yaml 0.018 pl526_0 bioconda perl-data-dumper 2.173 pl526_0 bioconda perl-dbd-pg 3.7.4 pl526_0 bioconda perl-dbi 1.642 pl526_0 bioconda perl-digest-md5 2.55 pl526_0 bioconda perl-digest-sha1 2.13 pl526h2d50403_0 bioconda perl-encode 2.88 pl526_1 bioconda perl-exporter 5.72 pl526_1 bioconda perl-exporter-tiny 1.002001 pl526_0 bioconda perl-extutils-cbuilder 0.280230 pl526_1 bioconda perl-extutils-makemaker 7.34 pl526_3 bioconda perl-extutils-manifest 1.71 pl526_0 bioconda perl-extutils-parsexs 3.35 pl526_0 bioconda perl-file-map 0.65 pl526h14c3975_1 eumetsat perl-file-path 2.15 pl526_0 bioconda perl-file-sharedir-install 0.13 pl526_0 bioconda perl-file-temp 0.2304 pl526_2 bioconda perl-getopt-long 2.50 pl526_1 bioconda perl-inline 0.80 pl526_3 bioconda perl-inline-c 0.78 pl526h470a237_0 bioconda perl-ipc-cmd 1.02 pl526_0 bioconda perl-json-pp 4.00 pl526_0 bioconda perl-list-moreutils 0.428 pl526_1 bioconda perl-list-moreutils-xs 0.428 pl526_0 bioconda perl-locale-maketext-simple 0.21 pl526_1 bioconda perl-module-build 0.4224 pl526_3 bioconda perl-module-corelist 5.20181218 pl526_0 bioconda perl-module-load 0.32 pl526_1 bioconda perl-module-load-conditional 0.68 pl526_2 bioconda perl-module-metadata 1.000033 pl526_0 bioconda perl-params-check 0.38 pl526_1 bioconda perl-parent 0.236 pl526_1 bioconda perl-parse-recdescent 1.967015 pl526_0 bioconda perl-pegex 0.61 pl526_1 bioconda perl-perl-ostype 1.010 pl526_1 bioconda perl-scalar-list-utils 1.45 pl526h470a237_3 bioconda perl-sub-uplevel 0.2800 pl526h470a237_0 bioconda perl-test-deep 1.128 pl526_0 bioconda perl-test-exception 0.43 pl526_2 bioconda perl-test-leaktrace 0.16 pl526_1 bioconda perl-test-warn 0.36 pl526_0 bioconda perl-text-abbrev 1.02 pl526_0 bioconda perl-text-parsewords 3.30 pl526_0 bioconda perl-version 0.9924 pl526_0 bioconda perl-xsloader 0.24 pl526_0 bioconda perl-yaml-libyaml 0.66 pl526_1 bioconda pip 19.0.3 py27_0 defaults postgresql 10.5 h1ad7b7a_0 defaults python 2.7.15 h77bded6_2 defaults readline 7.0 h7b6447c_5 defaults setuptools 40.8.0 py27_0 defaults sqlite 3.26.0 h7b6447c_0 defaults tk 8.6.8 hbc83047_0 defaults wheel 0.33.1 py27_0 defaults zlib 1.2.11 h7b6447c_3 defaults ```

Copied from original issue: conda/conda#8354

nehaljwani commented 5 years ago

This is a packaging bug, not a bug in Conda. Moving.

nehaljwani commented 5 years ago

@luvaul I am guessing that the real reason as to why this is happening is that the path to the compiler is hardcoded in some config files:

grep -lr '/tmp/build/80754af9/perl_1527832170752'  ~/m3/pkgs/perl-5.26.2-h14c3975_0
/home/wani/m3/pkgs/perl-5.26.2-h14c3975_0/lib/5.26.2/x86_64-linux-thread-multi/CORE/config.h
/home/wani/m3/pkgs/perl-5.26.2-h14c3975_0/lib/5.26.2/x86_64-linux-thread-multi/Config.pm
/home/wani/m3/pkgs/perl-5.26.2-h14c3975_0/lib/5.26.2/x86_64-linux-thread-multi/Config_heavy.pl
luvaul commented 5 years ago

Thank you @nehaljwani, your hint helped me search for and find a working perl whose $Config{cc} value doesn't contain a hardcoded compiler path: conda install -c conda-forge perl=5.26.2=h470a237_0

Not sure why this isn't the default perl for conda-forge, but whatever:

(alertsdp) lance@manta:~> conda search perl=5.26.2
Loading channels: done
# Name                  Version           Build  Channel
perl                     5.26.2      h14c3975_0  pkgs/main
perl                     5.26.2   h14c3975_1000  conda-forge
perl                     5.26.2   h14c3975_1001  conda-forge
perl                     5.26.2   h14c3975_1002  conda-forge
perl                     5.26.2      h470a237_0  conda-forge
fthommen commented 5 years ago

Is this considered a bug and will there be a fixed package on https://anaconda.org/anaconda/perl?

imk1 commented 5 years ago

I am having this problem too. What version of anaconda's perl works? Thanks!