Repository: spack/spack

Issue:
Installation issue: perl 5.34.1
### Steps to reproduce the issue

```console
# spack spec perl@5.34.1
Input spec
--------------------------------
perl@5.34.1

Concretized
--------------------------------
perl@5.34.1%gcc@12.1.0 cflags="-O3 -fno-omit-frame-pointer" cxxflags="-O3 -fno-omit-frame-pointer" fflags="-O3 -fno-omit-frame-pointer" +cpanm+shared+threads arch=linux-opensuse_tumbleweed20220611-x86_64
    ^berkeley-db@18.1.40%gcc@12.1.0 cflags="-O3 -fno-omit-frame-pointer" cxxflags="-O3 -fno-omit-frame-pointer" fflags="-O3 -fno-omit-frame-pointer" +cxx~docs+stl patches=b231fcc arch=linux-opensuse_tumbleweed20220611-x86_64
    ^bzip2@1.0.8%gcc@12.1.0 cflags="-O3 -fno-omit-frame-pointer" cxxflags="-O3 -fno-omit-frame-pointer" fflags="-O3 -fno-omit-frame-pointer" ~debug~pic+shared arch=linux-opensuse_tumbleweed20220611-x86_64
        ^diffutils@3.8%gcc@12.1.0 cflags="-O3 -fno-omit-frame-pointer" cxxflags="-O3 -fno-omit-frame-pointer" fflags="-O3 -fno-omit-frame-pointer"  arch=linux-opensuse_tumbleweed20220611-x86_64
            ^libiconv@1.16%gcc@12.1.0 cflags="-O3 -fno-omit-frame-pointer" cxxflags="-O3 -fno-omit-frame-pointer" fflags="-O3 -fno-omit-frame-pointer"  libs=shared,static arch=linux-opensuse_tumbleweed20220611-x86_64
    ^gdbm@1.19%gcc@12.1.0 cflags="-O3 -fno-omit-frame-pointer" cxxflags="-O3 -fno-omit-frame-pointer" fflags="-O3 -fno-omit-frame-pointer"  arch=linux-opensuse_tumbleweed20220611-x86_64
        ^readline@8.1%gcc@12.1.0 cflags="-O3 -fno-omit-frame-pointer" cxxflags="-O3 -fno-omit-frame-pointer" fflags="-O3 -fno-omit-frame-pointer"  arch=linux-opensuse_tumbleweed20220611-x86_64
            ^ncurses@6.2%gcc@12.1.0 cflags="-O3 -fno-omit-frame-pointer" cxxflags="-O3 -fno-omit-frame-pointer" fflags="-O3 -fno-omit-frame-pointer" ~symlinks+termlib abi=none arch=linux-opensuse_tumbleweed20220611-x86_64
                ^pkgconf@1.8.0%gcc@12.1.0 cflags="-O3 -fno-omit-frame-pointer" cxxflags="-O3 -fno-omit-frame-pointer" fflags="-O3 -fno-omit-frame-pointer"  arch=linux-opensuse_tumbleweed20220611-x86_64
    ^zlib@1.2.12%gcc@12.1.0 cflags="-O3 -fno-omit-frame-pointer" cxxflags="-O3 -fno-omit-frame-pointer" fflags="-O3 -fno-omit-frame-pointer" +optimize+pic+shared patches=0d38234 arch=linux-opensuse_tumbleweed20220611-x86_64
```


### Error message

<details><summary>Error message</summary><pre>
# spack install perl@5.34.1
[+] /opt/spack/opt/spack/linux-opensuse_tumbleweed20220611-x86_64/gcc-12.1.0/berkeley-db-18.1.40-yuswdv2arjqflpmc5nl5256g3vregs4j
[+] /opt/spack/opt/spack/linux-opensuse_tumbleweed20220611-x86_64/gcc-12.1.0/libiconv-1.16-tkdippvtjfcfn3f7puy7k6xt3kcr5enl
[+] /opt/spack/opt/spack/linux-opensuse_tumbleweed20220611-x86_64/gcc-12.1.0/pkgconf-1.8.0-svdw5ynwllbynqydr7oyfvsj37rnb3vo
[+] /opt/spack/opt/spack/linux-opensuse_tumbleweed20220611-x86_64/gcc-12.1.0/zlib-1.2.12-g4z5ussppan2vr7jk37uulb4fczsogyx
[+] /opt/spack/opt/spack/linux-opensuse_tumbleweed20220611-x86_64/gcc-12.1.0/diffutils-3.8-6lx2bahvsfy5xnttrkzwezjgyrtug5yp
[+] /opt/spack/opt/spack/linux-opensuse_tumbleweed20220611-x86_64/gcc-12.1.0/ncurses-6.2-hyhjlbh472lsm7od6uvfpwmvh22wh5uw
[+] /opt/spack/opt/spack/linux-opensuse_tumbleweed20220611-x86_64/gcc-12.1.0/bzip2-1.0.8-3qrkbdy7hdshwvx3egkg5b62f7yx6g6y
[+] /opt/spack/opt/spack/linux-opensuse_tumbleweed20220611-x86_64/gcc-12.1.0/readline-8.1-ogvx4nxyxdpgfsytvzrn5rdvi56wfhgk
[+] /opt/spack/opt/spack/linux-opensuse_tumbleweed20220611-x86_64/gcc-12.1.0/gdbm-1.19-nz6cjvjjevce4kgwsxtw5stsuin7uevr
==> Installing perl-5.34.1-hd3hcka7hh3e4ho3niogumh447vpis45
==> No binary for perl-5.34.1-hd3hcka7hh3e4ho3niogumh447vpis45 found: installing from source
==> Using cached archive: /opt/spack/var/spack/cache/_source-cache/archive/35/357951a491b0ba1ce3611263922feec78ccd581dddc24a446b033e25acf242a1.tar.gz
==> Using cached archive: /opt/spack/var/spack/cache/_source-cache/archive/9d/9da50e155df72bce55cb69f51f1dbb4b62d23740fb99f6178bb27f22ebdf8a46.tar.gz
==> Moving resource stage
        source: /tmp/root/spack-stage/resource-cpanm-hd3hcka7hh3e4ho3niogumh447vpis45/spack-src/
        destination: /tmp/root/spack-stage/spack-stage-perl-5.34.1-hd3hcka7hh3e4ho3niogumh447vpis45/spack-src/cpanm/cpanm
==> Ran patch() for perl
==> perl: Executing phase: 'configure'
==> Error: ProcessError: ./Configure: Permission denied
    Command: './Configure' '-des' '-Dprefix=/opt/spack/opt/spack/linux-opensuse_tumbleweed20220611-x86_64/gcc-12.1.0/perl-5.34.1-hd3hcka7hh3e4ho3niogumh447vpis45' '-Dlocincpth=/opt/spack/opt/spack/linux-opensuse_tumbleweed20220611-x86_64/gcc-12.1.0/gdbm-1.19-nz6cjvjjevce4kgwsxtw5stsuin7uevr/include' '-Dloclibpth=/opt/spack/opt/spack/linux-opensuse_tumbleweed20220611-x86_64/gcc-12.1.0/gdbm-1.19-nz6cjvjjevce4kgwsxtw5stsuin7uevr/lib' '-Accflags=-DAPPLLIB_EXP=\"/opt/spack/opt/spack/linux-opensuse_tumbleweed20220611-x86_64/gcc-12.1.0/perl-5.34.1-hd3hcka7hh3e4ho3niogumh447vpis45/lib/perl5\"' '-Duseshrplib' '-Dusethreads'
See build log for details:
  /tmp/root/spack-stage/spack-stage-perl-5.34.1-hd3hcka7hh3e4ho3niogumh447vpis45/spack-build-out.txt</details>

I checked that the Configure script is not executable when extracting the source package from this version of perl, which is the reason why it fails to execute. This is most likely caused by the Windows-oriented changes from this release. File permissions are correct in the source package from the previous 5.34.0 release.

### Information on your system

```console
# spack debug report
* **Spack:** 0.19.0.dev0 (b2f7808985c70c0dd6d4caecf93ec76d71b79409)
* **Python:** 3.9.10
* **Platform:** linux-opensuse_tumbleweed20220611-skylake
* **Concretizer:** clingo
```

### Additional information

```console
# cat /tmp/root/spack-stage/spack-stage-perl-5.34.1-hd3hcka7hh3e4ho3niogumh447vpis45/spack-build-out.txt
==> perl: Executing phase: 'configure'
==> [2022-06-13-08:16:40.896437] './Configure' '-des' '-Dprefix=/opt/spack/opt/spack/linux-opensuse_tumbleweed20220611-x86_64/gcc-12.1.0/perl-5.34.1-hd3hcka7hh3e4ho3niogumh447vpis45' '-Dlocincpth=/opt/spack/opt/spack/linux-opensuse_tumbleweed20220611-x86_64/gcc-12.1.0/gdbm-1.19-nz6cjvjjevce4kgwsxtw5stsuin7uevr/include' '-Dloclibpth=/opt/spack/opt/spack/linux-opensuse_tumbleweed20220611-x86_64/gcc-12.1.0/gdbm-1.19-nz6cjvjjevce4kgwsxtw5stsuin7uevr/lib' '-Accflags=-DAPPLLIB_EXP=\"/opt/spack/opt/spack/linux-opensuse_tumbleweed20220611-x86_64/gcc-12.1.0/perl-5.34.1-hd3hcka7hh3e4ho3niogumh447vpis45/lib/perl5\"' '-Duseshrplib' '-Dusethreads'
```
<details><summary>spack-build-env.txt</summary><pre>
ACL_BOARD_VENDOR_PATH=/opt/Intel/OpenCLFPGA/oneAPI/Boards; export ACL_BOARD_VENDOR_PATH
ADVISOR_2022_DIR=/opt/intel/oneapi/advisor/2022.1.0; export ADVISOR_2022_DIR
APM=/opt/intel/oneapi/advisor/2022.1.0/perfmodels; export APM
function BASH_FUNC__spack_shell_wrapper%%() {  for var in LD_LIBRARY_PATH DYLD_LIBRARY_PATH DYLD_FALLBACK_LIBRARY_PATH;
 do
 eval "if [ -n \"\${${var}-}\" ]; then export SPACK_$var=\${${var}}; fi";
 done;
 if [ -n "${ZSH_VERSION:-}" ]; then
 emulate -L sh;
 fi;
 _sp_flags="";
 while [ ! -z ${1+x} ] && [ "${1#-}" != "${1}" ]; do
 _sp_flags="$_sp_flags $1";
 shift;
 done;
 if [ -n "$_sp_flags" ] && [ "${_sp_flags#*h}" != "${_sp_flags}" ] || [ "${_sp_flags#*V}" != "${_sp_flags}" ]; then
 command spack $_sp_flags "$@";
 return;
 fi;
 _sp_subcommand="";
 if [ ! -z ${1+x} ]; then
 _sp_subcommand="$1";
 shift;
 fi;
 case $_sp_subcommand in 
 "cd")
 _sp_arg="";
 if [ -n "$1" ]; then
 _sp_arg="$1";
 shift;
 fi;
 if [ "$_sp_arg" = "-h" ] || [ "$_sp_arg" = "--help" ]; then
 command spack cd -h;
 else
 LOC="$(spack location $_sp_arg "$@")";
 if [ -d "$LOC" ]; then
 cd "$LOC";
 else
 return 1;
 fi;
 fi;
 return
 ;;
 "env")
 _sp_arg="";
 if [ -n "$1" ]; then
 _sp_arg="$1";
 shift;
 fi;
 if [ "$_sp_arg" = "-h" ] || [ "$_sp_arg" = "--help" ]; then
 command spack env -h;
 else
 case $_sp_arg in 
 activate)
 _a=" $@";
 if [ -z ${1+x} ] || [ "${_a#* --sh}" != "$_a" ] || [ "${_a#* --csh}" != "$_a" ] || [ "${_a#* -h}" != "$_a" ] || [ "${_a#* --help}" != "$_a" ]; then
 command spack env activate "$@";
 else
 stdout="$(command spack $_sp_flags env activate --sh "$@")" || return;
 eval "$stdout";
 fi
 ;;
 deactivate)
 _a=" $@";
 if [ "${_a#* --sh}" != "$_a" ] || [ "${_a#* --csh}" != "$_a" ]; then
 command spack env deactivate "$@";
 else
 if [ -n "$*" ]; then
 command spack env deactivate -h;
 else
 stdout="$(command spack $_sp_flags env deactivate --sh)" || return;
 eval "$stdout";
 fi;
 fi
 ;;
 *)
 command spack env $_sp_arg "$@"
 ;;
 esac;
 fi;
 return
 ;;
 "load" | "unload")
 _a=" $@";
 if [ "${_a#* --sh}" != "$_a" ] || [ "${_a#* --csh}" != "$_a" ] || [ "${_a#* -h}" != "$_a" ] || [ "${_a#* --list}" != "$_a" ] || [ "${_a#* --help}" != "$_a" ]; then
 command spack $_sp_flags $_sp_subcommand "$@";
 else
 stdout="$(command spack $_sp_flags $_sp_subcommand --sh "$@")" || return;
 eval "$stdout";
 fi
 ;;
 *)
 command spack $_sp_flags $_sp_subcommand "$@"
 ;;
 esac
}; export -f BASH_FUNC__spack_shell_wrapper%%
function BASH_FUNC_activate-spack-view%%() {  spack env deactivate;
 spack env activate spack-based-docker
}; export -f BASH_FUNC_activate-spack-view%%
function BASH_FUNC_spack%%() {  : this is a shell function from: /opt/spack/share/spack/setup-env.sh;
 : the real spack script is here: /opt/spack/bin/spack;
 _spack_shell_wrapper "$@";
 return $?
}; export -f BASH_FUNC_spack%%
BUILD_BZIP2=0; export BUILD_BZIP2
BUILD_ZLIB=0; export BUILD_ZLIB
BZIP2_INCLUDE=/opt/spack/opt/spack/linux-opensuse_tumbleweed20220611-x86_64/gcc-12.1.0/bzip2-1.0.8-3qrkbdy7hdshwvx3egkg5b62f7yx6g6y/include; export BZIP2_INCLUDE
BZIP2_LIB=/opt/spack/opt/spack/linux-opensuse_tumbleweed20220611-x86_64/gcc-12.1.0/bzip2-1.0.8-3qrkbdy7hdshwvx3egkg5b62f7yx6g6y/lib; export BZIP2_LIB
CC=/opt/spack/lib/spack/env/gcc/gcc; export CC
CCL_CONFIGURATION=cpu_gpu_dpcpp; export CCL_CONFIGURATION
CLASSPATH=/opt/intel/oneapi/mpi/2021.6.0//lib/mpi.jar:/opt/intel/oneapi/dal/2021.6.0/lib/onedal.jar; export CLASSPATH
CMAKE_PREFIX_PATH=/opt/spack/opt/spack/linux-opensuse_tumbleweed20220611-x86_64/gcc-12.1.0/zlib-1.2.12-g4z5ussppan2vr7jk37uulb4fczsogyx:/opt/spack/opt/spack/linux-opensuse_tumbleweed20220611-x86_64/gcc-12.1.0/gdbm-1.19-nz6cjvjjevce4kgwsxtw5stsuin7uevr:/opt/spack/opt/spack/linux-opensuse_tumbleweed20220611-x86_64/gcc-12.1.0/readline-8.1-ogvx4nxyxdpgfsytvzrn5rdvi56wfhgk:/opt/spack/opt/spack/linux-opensuse_tumbleweed20220611-x86_64/gcc-12.1.0/ncurses-6.2-hyhjlbh472lsm7od6uvfpwmvh22wh5uw:/opt/spack/opt/spack/linux-opensuse_tumbleweed20220611-x86_64/gcc-12.1.0/bzip2-1.0.8-3qrkbdy7hdshwvx3egkg5b62f7yx6g6y:/opt/spack/opt/spack/linux-opensuse_tumbleweed20220611-x86_64/gcc-12.1.0/berkeley-db-18.1.40-yuswdv2arjqflpmc5nl5256g3vregs4j; export CMAKE_PREFIX_PATH
CONDA_DEFAULT_ENV=intelpython-python3.9; export CONDA_DEFAULT_ENV
CONDA_EXE=/opt/intel/oneapi/intelpython/latest/bin/conda; export CONDA_EXE
CONDA_PREFIX=/opt/intel/oneapi/intelpython/latest; export CONDA_PREFIX
CONDA_PROMPT_MODIFIER='(intelpython-python3.9) '; export CONDA_PROMPT_MODIFIER
CONDA_PYTHON_EXE=/opt/intel/oneapi/intelpython/latest/bin/python; export CONDA_PYTHON_EXE
CONDA_SHLVL=1; export CONDA_SHLVL
CXX=/opt/spack/lib/spack/env/gcc/g++; export CXX
DAALROOT=/opt/intel/oneapi/dal/2021.6.0; export DAALROOT
DALROOT=/opt/intel/oneapi/dal/2021.6.0; export DALROOT
DAL_MAJOR_BINARY=1; export DAL_MAJOR_BINARY
DAL_MINOR_BINARY=1; export DAL_MINOR_BINARY
DIAGUTIL_PATH=/opt/intel/oneapi/vtune/2022.3.0/sys_check/vtune_sys_check.py:/opt/intel/oneapi/dpcpp-ct/2022.1.0/sys_check/sys_check.sh:/opt/intel/oneapi/debugger/2021.6.0/sys_check/debugger_sys_check.py:/opt/intel/oneapi/compiler/2022.1.0/sys_check/sys_check.sh:/opt/intel/oneapi/advisor/2022.1.0/sys_check/advisor_sys_check.py:; export DIAGUTIL_PATH
DNNLROOT=/opt/intel/oneapi/dnnl/2022.1.0/cpu_dpcpp_gpu_dpcpp; export DNNLROOT
F77=/opt/spack/lib/spack/env/gcc/gfortran; export F77
FC=/opt/spack/lib/spack/env/gcc/gfortran; export FC
FI_PROVIDER_PATH=/opt/intel/oneapi/mpi/2021.6.0//libfabric/lib/prov:/usr/lib64/libfabric; export FI_PROVIDER_PATH
FORCE_UNSAFE_CONFIGURE=1; export FORCE_UNSAFE_CONFIGURE
FPGA_VARS_ARGS=''; export FPGA_VARS_ARGS
FPGA_VARS_DIR=/opt/intel/oneapi/compiler/2022.1.0/linux/lib/oclfpga; export FPGA_VARS_DIR
GDB_INFO=/opt/intel/oneapi/debugger/2021.6.0/documentation/info/; export GDB_INFO
GPG_TTY=/dev/pts/0; export GPG_TTY
HOME=/root; export HOME
HOSTNAME=49af368215a8; export HOSTNAME
INFOPATH=/opt/intel/oneapi/debugger/2021.6.0/gdb/intel64/lib; export INFOPATH
INTELFPGAOCLSDKROOT=/opt/intel/oneapi/compiler/2022.1.0/linux/lib/oclfpga; export INTELFPGAOCLSDKROOT
INTEL_PYTHONHOME=/opt/intel/oneapi/debugger/2021.6.0/dep; export INTEL_PYTHONHOME
IPPCP_TARGET_ARCH=intel64; export IPPCP_TARGET_ARCH
IPPCRYPTOROOT=/opt/intel/oneapi/ippcp/2021.6.0; export IPPCRYPTOROOT
IPPROOT=/opt/intel/oneapi/ipp/2021.6.0; export IPPROOT
IPP_TARGET_ARCH=intel64; export IPP_TARGET_ARCH
LC_ALL=C; export LC_ALL
LC_CTYPE=C.UTF-8; export LC_CTYPE
LS_COLORS='no=00:fi=00:di=01;34:ln=00;36:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=41;33;01:ex=00;32:*.cmd=00;32:*.exe=01;32:*.com=01;32:*.bat=01;32:*.btm=01;32:*.dll=01;32:*.tar=00;31:*.tgz=00;31:*.arc=00;31:*.arj=00;31:*.taz=00;31:*.lha=00;31:*.lz4=00;31:*.lzh=00;31:*.lzma=00;31:*.tlz=00;31:*.txz=00;31:*.tzo=00;31:*.t7z=00;31:*.zip=00;31:*.z=00;31:*.Z=00;31:*.dz=00;31:*.gz=00;31:*.lrz=00;31:*.lz=00;31:*.lzo=00;31:*.xz=00;31:*.zst=00;31:*.tzst=00;31:*.bz2=00;31:*.bz=00;31:*.tbz=00;31:*.tbz2=00;31:*.tz=00;31:*.deb=00;31:*.rpm=00;31:*.jar=00;31:*.war=00;31:*.ear=00;31:*.sar=00;31:*.rar=00;31:*.alz=00;31:*.ace=00;31:*.zoo=00;31:*.cpio=00;31:*.7z=00;31:*.rz=00;31:*.cab=00;31:*.wim=00;31:*.swm=00;31:*.dwm=00;31:*.esd=00;31:*.asf=01;35:*.avi=01;35:*.bmp=01;35:*.cgm=01;35:*.dl=01;35:*.emf=01;35:*.flc=01;35:*.fli=01;35:*.flv=01;35:*.gif=01;35:*.gl=01;35:*.jpeg=01;35:*.jpg=01;35:*.m2v=01;35:*.m4v=01;35:*.mjpeg=01;35:*.mjpg=01;35:*.mkv=01;35:*.mng=01;35:*.mov=01;35:*.mp4=01;35:*.mp4v=01;35:*.mpeg=01;35:*.mpg=01;35:*.nuv=01;35:*.ogm=01;35:*.pbm=01;35:*.pcx=01;35:*.pgm=01;35:*.png=01;35:*.ppm=01;35:*.qt=01;35:*.rm=01;35:*.rmvb=01;35:*.svg=01;35:*.svgz=01;35:*.tga=01;35:*.tif=01;35:*.tiff=01;35:*.vob=01;35:*.webm=01;35:*.webp=01;35:*.wmv=01;35:*.xbm=01;35:*.xcf=01;35:*.xpm=01;35:*.xwd=01;35:*.yuv=01;35:*.ogv=01;35:*.ogx=01;35:*.aiff=00;32:*.ape=00;32:*.aac=00;32:*.au=00;32:*.flac=00;32:*.m4a=00;32:*.mid=00;32:*.midi=00;32:*.mka=00;32:*.mp3=00;32:*.mpc=00;32:*.ogg=00;32:*.ra=00;32:*.voc=00;32:*.wav=00;32:*.wma=00;32:*.wv=00;32:*.oga=00;32:*.opus=00;32:*.spx=00;32:*.xspf=00;32:'; export LS_COLORS
LS_OPTIONS='-A -N --color=tty -T 0'; export LS_OPTIONS
MANPATH=/opt/intel/oneapi/mpi/2021.6.0/man:/opt/intel/oneapi/debugger/2021.6.0/documentation/man:/opt/intel/oneapi/compiler/2022.1.0/documentation/en/man/common::; export MANPATH
MKLROOT=/opt/intel/oneapi/mkl/2022.1.0; export MKLROOT
NLSPATH=/opt/intel/oneapi/mkl/2022.1.0/lib/intel64/locale/%l_%t/%N:/opt/intel/oneapi/compiler/2022.1.0/linux/compiler/lib/intel64_lin/locale/%l_%t/%N; export NLSPATH
OCL_ICD_FILENAMES=libintelocl_emu.so:libalteracl.so:/opt/intel/oneapi/compiler/2022.1.0/linux/lib/x64/libintelocl.so; export OCL_ICD_FILENAMES
#OLDPWD=/tmp/root/spack-stage/spack-stage-perl-5.34.1-hd3hcka7hh3e4ho3niogumh447vpis45; export OLDPWD
PATH=/opt/spack/opt/spack/linux-opensuse_tumbleweed20220611-x86_64/gcc-12.1.0/gdbm-1.19-nz6cjvjjevce4kgwsxtw5stsuin7uevr/bin:/opt/spack/opt/spack/linux-opensuse_tumbleweed20220611-x86_64/gcc-12.1.0/bzip2-1.0.8-3qrkbdy7hdshwvx3egkg5b62f7yx6g6y/bin:/opt/spack/opt/spack/linux-opensuse_tumbleweed20220611-x86_64/gcc-12.1.0/berkeley-db-18.1.40-yuswdv2arjqflpmc5nl5256g3vregs4j/bin:/opt/spack/lib/spack/env/gcc:/opt/spack/lib/spack/env/case-insensitive:/opt/spack/lib/spack/env:/opt/spack/bin:/opt/intel/oneapi/vtune/2022.3.0/bin64:/opt/intel/oneapi/vpl/2022.1.0/bin:/opt/intel/oneapi/mpi/2021.6.0//libfabric/bin:/opt/intel/oneapi/mpi/2021.6.0//bin:/opt/intel/oneapi/mkl/2022.1.0/bin/intel64:/opt/intel/oneapi/intelpython/latest/bin:/opt/intel/oneapi/intelpython/latest/condabin:/opt/intel/oneapi/dpcpp-ct/2022.1.0/bin:/opt/intel/oneapi/dev-utilities/2021.6.0/bin:/opt/intel/oneapi/debugger/2021.6.0/gdb/intel64/bin:/opt/intel/oneapi/compiler/2022.1.0/linux/lib/oclfpga/bin:/opt/intel/oneapi/compiler/2022.1.0/linux/bin/intel64:/opt/intel/oneapi/compiler/2022.1.0/linux/bin:/opt/intel/oneapi/advisor/2022.1.0/bin64:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin; export PATH
PKG_CONFIG_PATH=/opt/spack/opt/spack/linux-opensuse_tumbleweed20220611-x86_64/gcc-12.1.0/zlib-1.2.12-g4z5ussppan2vr7jk37uulb4fczsogyx/lib/pkgconfig:/opt/spack/opt/spack/linux-opensuse_tumbleweed20220611-x86_64/gcc-12.1.0/readline-8.1-ogvx4nxyxdpgfsytvzrn5rdvi56wfhgk/lib/pkgconfig:/opt/spack/opt/spack/linux-opensuse_tumbleweed20220611-x86_64/gcc-12.1.0/ncurses-6.2-hyhjlbh472lsm7od6uvfpwmvh22wh5uw/lib/pkgconfig:/opt/intel/oneapi/vtune/2022.3.0/include/pkgconfig/lib64:/opt/intel/oneapi/vpl/2022.1.0/lib/pkgconfig:/opt/intel/oneapi/tbb/2021.6.0/env/../lib/pkgconfig:/opt/intel/oneapi/mpi/2021.6.0/lib/pkgconfig:/opt/intel/oneapi/mkl/2022.1.0/lib/pkgconfig:/opt/intel/oneapi/ippcp/2021.6.0/lib/pkgconfig:/opt/intel/oneapi/dpl/2021.7.0/lib/pkgconfig:/opt/intel/oneapi/dnnl/2022.1.0/cpu_dpcpp_gpu_dpcpp/../lib/pkgconfig:/opt/intel/oneapi/dal/2021.6.0/lib/pkgconfig:/opt/intel/oneapi/compiler/2022.1.0/lib/pkgconfig:/opt/intel/oneapi/ccl/2021.6.0/lib/pkgconfig:/opt/intel/oneapi/advisor/2022.1.0/include/pkgconfig/lib64:; export PKG_CONFIG_PATH
#PWD=/tmp/root/spack-stage/spack-stage-perl-5.34.1-hd3hcka7hh3e4ho3niogumh447vpis45/spack-src; export PWD
PYTHON_SPACK_SPEC='python@3: +bz2 -dbm -lzma -pyexpat -sqlite3 -pythoncmd                             ^ gettext -bzip2 -git -xz'; export PYTHON_SPACK_SPEC
ROOT_SPACK_SPEC='root@6.24.06 cxxstd=17 -davix                        -examples +gdml -minuit -opengl -pythia8 +python +root7                        -roofit +tbb +threads -tmva -unuran -vdt -x -xml                                   ^ python@3: +bz2 -dbm -lzma -pyexpat -sqlite3 -pythoncmd                             ^ gettext -bzip2 -git -xz'; export ROOT_SPACK_SPEC
SETUP_ENV=/root/setup_env.sh; export SETUP_ENV
SETVARS_COMPLETED=1; export SETVARS_COMPLETED
SHLVL=1; export SHLVL
SPACK_CC=/usr/bin/gcc; export SPACK_CC
SPACK_CC_RPATH_ARG=-Wl,-rpath,; export SPACK_CC_RPATH_ARG
SPACK_CFLAGS='-O3 -fno-omit-frame-pointer'; export SPACK_CFLAGS
SPACK_COMPILER_SPEC=gcc@12.1.0; export SPACK_COMPILER_SPEC
SPACK_CXX=/usr/bin/g++; export SPACK_CXX
SPACK_CXXFLAGS='-O3 -fno-omit-frame-pointer'; export SPACK_CXXFLAGS
SPACK_CXX_RPATH_ARG=-Wl,-rpath,; export SPACK_CXX_RPATH_ARG
SPACK_DEBUG_LOG_DIR=/tmp/root/spack-stage/spack-stage-perl-5.34.1-hd3hcka7hh3e4ho3niogumh447vpis45/spack-src; export SPACK_DEBUG_LOG_DIR
SPACK_DEBUG_LOG_ID=perl-hd3hcka; export SPACK_DEBUG_LOG_ID
SPACK_DTAGS_TO_ADD=--disable-new-dtags; export SPACK_DTAGS_TO_ADD
SPACK_DTAGS_TO_STRIP=--enable-new-dtags; export SPACK_DTAGS_TO_STRIP
SPACK_ENV=/opt/spack/var/spack/environments/spack-based-docker; export SPACK_ENV
SPACK_ENV_NAME=spack-based-docker; export SPACK_ENV_NAME
SPACK_ENV_PATH=/opt/spack/lib/spack/env:/opt/spack/lib/spack/env/case-insensitive:/opt/spack/lib/spack/env/gcc; export SPACK_ENV_PATH
SPACK_F77=/usr/bin/gfortran; export SPACK_F77
SPACK_F77_RPATH_ARG=-Wl,-rpath,; export SPACK_F77_RPATH_ARG
SPACK_FC=/usr/bin/gfortran; export SPACK_FC
SPACK_FC_RPATH_ARG=-Wl,-rpath,; export SPACK_FC_RPATH_ARG
SPACK_FFLAGS='-O3 -fno-omit-frame-pointer'; export SPACK_FFLAGS
SPACK_INCLUDE_DIRS=/opt/spack/opt/spack/linux-opensuse_tumbleweed20220611-x86_64/gcc-12.1.0/zlib-1.2.12-g4z5ussppan2vr7jk37uulb4fczsogyx/include:/opt/spack/opt/spack/linux-opensuse_tumbleweed20220611-x86_64/gcc-12.1.0/gdbm-1.19-nz6cjvjjevce4kgwsxtw5stsuin7uevr/include:/opt/spack/opt/spack/linux-opensuse_tumbleweed20220611-x86_64/gcc-12.1.0/readline-8.1-ogvx4nxyxdpgfsytvzrn5rdvi56wfhgk/include:/opt/spack/opt/spack/linux-opensuse_tumbleweed20220611-x86_64/gcc-12.1.0/ncurses-6.2-hyhjlbh472lsm7od6uvfpwmvh22wh5uw/include:/opt/spack/opt/spack/linux-opensuse_tumbleweed20220611-x86_64/gcc-12.1.0/bzip2-1.0.8-3qrkbdy7hdshwvx3egkg5b62f7yx6g6y/include:/opt/spack/opt/spack/linux-opensuse_tumbleweed20220611-x86_64/gcc-12.1.0/berkeley-db-18.1.40-yuswdv2arjqflpmc5nl5256g3vregs4j/include; export SPACK_INCLUDE_DIRS
SPACK_LD_LIBRARY_PATH=/opt/intel/oneapi/vpl/2022.1.0/lib:/opt/intel/oneapi/tbb/2021.6.0/env/../lib/intel64/gcc4.8:/opt/intel/oneapi/mpi/2021.6.0//libfabric/lib:/opt/intel/oneapi/mpi/2021.6.0//lib/release:/opt/intel/oneapi/mpi/2021.6.0//lib:/opt/intel/oneapi/mkl/2022.1.0/lib/intel64:/opt/intel/oneapi/ippcp/2021.6.0/lib/intel64:/opt/intel/oneapi/ipp/2021.6.0/lib/intel64:/opt/intel/oneapi/dnnl/2022.1.0/cpu_dpcpp_gpu_dpcpp/lib:/opt/intel/oneapi/debugger/2021.6.0/gdb/intel64/lib:/opt/intel/oneapi/debugger/2021.6.0/libipt/intel64/lib:/opt/intel/oneapi/debugger/2021.6.0/dep/lib:/opt/intel/oneapi/dal/2021.6.0/lib/intel64:/opt/intel/oneapi/compiler/2022.1.0/linux/lib:/opt/intel/oneapi/compiler/2022.1.0/linux/lib/x64:/opt/intel/oneapi/compiler/2022.1.0/linux/lib/oclfpga/host/linux64/lib:/opt/intel/oneapi/compiler/2022.1.0/linux/compiler/lib/intel64_lin:/opt/intel/oneapi/ccl/2021.6.0/lib/cpu_gpu_dpcpp; export SPACK_LD_LIBRARY_PATH
SPACK_LINKER_ARG=-Wl,; export SPACK_LINKER_ARG
SPACK_LINK_DIRS=/opt/spack/opt/spack/linux-opensuse_tumbleweed20220611-x86_64/gcc-12.1.0/zlib-1.2.12-g4z5ussppan2vr7jk37uulb4fczsogyx/lib:/opt/spack/opt/spack/linux-opensuse_tumbleweed20220611-x86_64/gcc-12.1.0/gdbm-1.19-nz6cjvjjevce4kgwsxtw5stsuin7uevr/lib:/opt/spack/opt/spack/linux-opensuse_tumbleweed20220611-x86_64/gcc-12.1.0/readline-8.1-ogvx4nxyxdpgfsytvzrn5rdvi56wfhgk/lib:/opt/spack/opt/spack/linux-opensuse_tumbleweed20220611-x86_64/gcc-12.1.0/ncurses-6.2-hyhjlbh472lsm7od6uvfpwmvh22wh5uw/lib:/opt/spack/opt/spack/linux-opensuse_tumbleweed20220611-x86_64/gcc-12.1.0/bzip2-1.0.8-3qrkbdy7hdshwvx3egkg5b62f7yx6g6y/lib:/opt/spack/opt/spack/linux-opensuse_tumbleweed20220611-x86_64/gcc-12.1.0/berkeley-db-18.1.40-yuswdv2arjqflpmc5nl5256g3vregs4j/lib; export SPACK_LINK_DIRS
SPACK_PYTHON=/opt/intel/oneapi/intelpython/latest/bin/python3; export SPACK_PYTHON
SPACK_ROOT=/opt/spack; export SPACK_ROOT
SPACK_RPATH_DIRS=/opt/spack/opt/spack/linux-opensuse_tumbleweed20220611-x86_64/gcc-12.1.0/perl-5.34.1-hd3hcka7hh3e4ho3niogumh447vpis45/lib:/opt/spack/opt/spack/linux-opensuse_tumbleweed20220611-x86_64/gcc-12.1.0/perl-5.34.1-hd3hcka7hh3e4ho3niogumh447vpis45/lib64:/opt/spack/opt/spack/linux-opensuse_tumbleweed20220611-x86_64/gcc-12.1.0/zlib-1.2.12-g4z5ussppan2vr7jk37uulb4fczsogyx/lib:/opt/spack/opt/spack/linux-opensuse_tumbleweed20220611-x86_64/gcc-12.1.0/gdbm-1.19-nz6cjvjjevce4kgwsxtw5stsuin7uevr/lib:/opt/spack/opt/spack/linux-opensuse_tumbleweed20220611-x86_64/gcc-12.1.0/readline-8.1-ogvx4nxyxdpgfsytvzrn5rdvi56wfhgk/lib:/opt/spack/opt/spack/linux-opensuse_tumbleweed20220611-x86_64/gcc-12.1.0/ncurses-6.2-hyhjlbh472lsm7od6uvfpwmvh22wh5uw/lib:/opt/spack/opt/spack/linux-opensuse_tumbleweed20220611-x86_64/gcc-12.1.0/bzip2-1.0.8-3qrkbdy7hdshwvx3egkg5b62f7yx6g6y/lib:/opt/spack/opt/spack/linux-opensuse_tumbleweed20220611-x86_64/gcc-12.1.0/berkeley-db-18.1.40-yuswdv2arjqflpmc5nl5256g3vregs4j/lib; export SPACK_RPATH_DIRS
SPACK_SHORT_SPEC='perl@5.34.1%gcc@12.1.0+cpanm+shared+threads arch=linux-opensuse_tumbleweed20220611-x86_64/hd3hcka'; export SPACK_SHORT_SPEC
SPACK_SYSTEM_DIRS=/bin:/usr/bin:/usr/local/bin:/bin64:/usr/bin64:/usr/local/bin64:/include:/usr/include:/usr/local/include:/lib:/usr/lib:/usr/local/lib:/lib64:/usr/lib64:/usr/local/lib64:/:/usr:/usr/local; export SPACK_SYSTEM_DIRS
SPACK_TARGET_ARGS='-march=x86-64 -mtune=generic'; export SPACK_TARGET_ARGS
TBBROOT=/opt/intel/oneapi/tbb/2021.6.0/env/..; export TBBROOT
TERM=xterm; export TERM
VTUNE_PROFILER_2022_DIR=/opt/intel/oneapi/vtune/2022.3.0; export VTUNE_PROFILER_2022_DIR
VTUNE_PROFILER_DIR=/opt/intel/oneapi/vtune/2022.3.0; export VTUNE_PROFILER_DIR
ZLIB_INCLUDE=/opt/spack/opt/spack/linux-opensuse_tumbleweed20220611-x86_64/gcc-12.1.0/zlib-1.2.12-g4z5ussppan2vr7jk37uulb4fczsogyx/include; export ZLIB_INCLUDE
ZLIB_LIB=/opt/spack/opt/spack/linux-opensuse_tumbleweed20220611-x86_64/gcc-12.1.0/zlib-1.2.12-g4z5ussppan2vr7jk37uulb4fczsogyx/lib; export ZLIB_LIB
_CE_CONDA=''; export _CE_CONDA
_CE_M=''; export _CE_M
container=podman; export container</details>

### General information

- [X] I have run `spack debug report` and reported the version of Spack/Python/Platform
- [X] I have run `spack maintainers <name-of-the-package>` and **@mentioned** any maintainers
- [X] I have uploaded the build log and environment files
- [X] I have searched the issues of this repo and believe this is not a duplicate


Discussion:
Strangely enough, if I just grab https://www.cpan.org/src/5.0/perl-5.34.1.tar.gz, I see correct Configure file permissions there. Not sure what's going on here...

Resolving patch:
diff --git a/lib/spack/spack/util/compression.py b/lib/spack/spack/util/compression.py
--- a/lib/spack/spack/util/compression.py
+++ b/lib/spack/spack/util/compression.py
@@ -79,9 +79,15 @@ def _untar(archive_file):
     if tar_support() and not uncompress_required and\
             not lzma_needed_and_not_available:
         import tarfile
-        tar = tarfile.open(archive_file)
-        tar.extractall()
-        tar.close()
+
+        # Extract all members but wipe ownership info. This ensures we
+        # will not attempt to chown the files as superuser.
+        def filter(tarinfo):
+            tarinfo.uid = tarinfo.gid = 0
+            tarinfo.uname = tarinfo.gname = 'root'
+            return tarinfo
+        with tarfile.open(archive_file) as tar:
+            tar.extractall(members=map(filter, tar.getmembers()))
     else:
         tar = which('tar', required=True)
         tar.add_default_arg('-oxf')


Test patch: