conda-forge / perl-feedstock

A conda-smithy repository for perl.
BSD 3-Clause "New" or "Revised" License
3 stars 32 forks source link

Perl artifacts contain hardcoded compiler paths #29

Open mariusvniekerk opened 6 years ago

mariusvniekerk commented 6 years ago

See https://github.com/conda-forge/perl-unix-processors-feedstock/pull/2

epruesse commented 5 years ago

It's these files:

./x86_64-linux-thread-multi/CORE/config.h
./x86_64-linux-thread-multi/Config_heavy.pl
./x86_64-linux-thread-multi/Config.pm
epruesse commented 5 years ago

The first two are listed in info/has_prefix

epruesse commented 5 years ago

The prefix added there is wrong though:

/opt/anaconda1anaconda2anaconda3 text lib/5.26.2/x86_64-linux-thread-multi/Config_heavy.pl

should be

/home/conda/feedstock_root/build_artifacts/perl_1548813468557/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placeh text  lib/5.26.2/x86_64-linux-thread-multi/Config_heavy.pl
epruesse commented 5 years ago

Workaround for build.sh in client recipe:

wrong_prefix="$(perl -V | sed -rn "s|\s+cc='([^']+)/bin/.*|\1|p")"
if test -n "$wrong_prefix"; then
  echo "Perl has broken build env prefix. Fixing..."
  good_prefix="${CXX%/bin/*}"
  echo "Replacing"
  echo "  $wrong_prefix"
  echo "with"
  echo "  $good_prefix"
  grep -rlI "$wrong_prefix" $(perl -e 'print "@INC"') | \
      sort -u |\
      xargs sed -ibak "s|$wrong_prefix|$good_prefix|g"
  if perl -V | grep "$wrong_prefix"; then
     echo "Failed to fix paths - expect breakage below"
  else
      echo "Sucesss!"
  fi
fi
abretaud commented 5 years ago

There are a few PR blocked by this, is anyone working on it? I've tried to look into it, but I just don't understand where this /opt/anaconda1anaconda2anaconda3 comes from... any clue?