conda-forge / perl-feedstock

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

Tests Fail with "Insecure directory in $ENV{PATH} while running with -T switch" #13

Closed ashokrags closed 7 years ago

ashokrags commented 7 years ago

Hi, I tried to use your recipe to build a perl package in a docker container and the tests failed with "Insecure directory in $ENV{PATH} while running with -T switch ". I have found a workaround, but I was wondering if you had run into this issue and if there were any obvious solutions that I am missing Thanks Ashok

ashokrags commented 7 years ago

Hi all, Just thought I would share. This was due to trying to build perl in a docker image as root. The perl tests were failing because of issues with setups. There are two ways to fix this 1) hacky: Edit the build.sh to drop you into a subshell and run tests from there

(
PATH=$mypath
make test
)

2) Proper fix: Create a user in your docker image and run condo build as a user

t-bltg commented 7 years ago

Hi,

I'm hitting the same issue, could you explain what you put in $mypath ?

jakirkham commented 7 years ago

Is it worth adding a PR? Also we do plan on using a non-root user in the docker image in the future.

ashokrags commented 7 years ago

@neok-m4700 only saw your message now. This was my build.sh that worked using the hack, but once I figured out the docker root issue I commented out my hacks

#!/bin/bash
export LD_LIBRARY_PATH=$(pwd)

# world-writable files are not allowed
chmod -R o-w $SRC_DIR

# Give install_name_tool enough room to work its magic
if [ `uname -s` == "Darwin" ]; then
    export LDFLAGS="${LDFLAGS} -Wl,-headerpad_max_install_names"
fi

sh Configure -Dusethreads -Duserelocatableinc -Dprefix=$PREFIX -de -Aldflags="$LDFLAGS"
make
make test
# change permissions again after building
chmod -R o-w $SRC_DIR
#mypath="/conda/bin:/usr/bin:/bin:/usr/local/bin/:/usr/local/sbin:/sbin"
#(
#PATH=$mypath
#make test
#)
make install
jakirkham commented 7 years ago

FYI PR ( https://github.com/conda-forge/docker-images/pull/36 ) will switch us to a non-root user when building. All feedstocks re-rendered with conda-smithy v2.3.0+ will work smoothly with those changes. staged-recipes is already equipped to make that change once the Docker image PR is merged.