Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

%environment variables not available in %post #1284

Closed
remyd1 opened this issue Feb 5, 2018 · 1 comment
Closed

%environment variables not available in %post #1284

remyd1 opened this issue Feb 5, 2018 · 1 comment

Comments

@remyd1
Copy link
Contributor

remyd1 commented Feb 5, 2018

Version of Singularity:

lastest stable branch (2.4.2-master.g09fb002)

Expected behavior

Variables defined in %environment sould be available in %post

Actual behavior

It is not working anymore, variables are empty.

Steps to reproduce behavior

My recipe:

cat Singularity.ubuntu.test
Bootstrap: docker
From: ubuntu:16.04

IncludeCmd: yes
%environment
    PERL5LIB=/usr/local/lib/perl5
    INSTALLPATH=/usr/local/bin
    export PERL5LIB
    export INSTALLPATH
    export LIBRARY_PATH

%labels
    Author Remy Dernat <remy.d1@gmail.com>
    Version 0.0.1
    build_date 2018 Feb 02

%post
    echo "Define some vars..."
    MODULESPATH=${INSTALLPATH}"/Modules"
    BINARIES=${INSTALLPATH}
    JAVAPATH="/usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java"
    echo "Perl Modules PATH:"$MODULESPATH
    echo "Binaries are located in :"$BINARIES
    echo "java PATH:"$JAVAPATH
cd
sudo rm -rf /usr/local/bin/singularity
sudo rm -rf /usr/local/libexec/singularity
git clone https://github.com/singularityware/singularity.git
cd singularity
./autogen.sh
./configure
make
sudo make install
sudo singularity build test.ubu.simg Singularity.ubuntu.test
@GodloveD
Copy link
Collaborator

GodloveD commented Feb 5, 2018

Hey @remyd1. Sorry for the inconvenience. We made a conscious decision to remove this behavior. Please see #1053 for the justification. Ping @olifre and @vsoch who were also part of that discussion.

Since we have already hashed this out in detail, I am going to close this issue. But feel free to keep on discussing. And if there is anything that can not be solved by placing the variable definitions in %post feel free to re-open. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants