Bug 1323656

Summary: Image does not set X_SCLS properly for all commands
Product: Red Hat Developer Toolset Reporter: Miloš Prchlík <mprchlik>
Component: devtoolset-4-perftools-containerAssignee: Frank Ch. Eigler <fche>
Status: CLOSED ERRATA QA Contact: Martin Cermak <mcermak>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: DTS 4.1 RHEL 7CC: mbenitez, mcermak, mpolacek, qe-baseos-tools-bugs
Target Milestone: beta1   
Target Release: 4.1   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: devtoolset-4-perftools-docker rhel7 4-8 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 1323575 Environment:
Last Closed: 2016-05-31 08:45:11 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Bug Depends On: 1323575    
Bug Blocks:    

Description Miloš Prchlík 2016-04-04 11:13:15 UTC
The situation described bellow for devtoolset-4-toolchain-rhel7 image is true also for devtoolset-4-perftools-rhel7, therefore cloning the bug.

+++ This bug was initially created as a clone of Bug #1323575 +++

Description of problem:

X_SCLS environmental variable - among many others - is not set for all commands that can be executed using docker-4-toolchain image. It loos like the variable exists only when bash gets involved:

.qa.[root@ibm-x3630m4-01 ~]# docker run --rm rhscl/devtoolset-4-toolchain-rhel7 bash -c 'env'
MANPATH=/opt/rh/devtoolset-4/root/usr/share/man:
HOSTNAME=cb70ccd9b20d
PERL5LIB=/opt/rh/devtoolset-4/root//usr/lib64/perl5/vendor_perl:/opt/rh/devtoolset-4/root/usr/lib/perl5:/opt/rh/devtoolset-4/root//usr/share/perl5/vendor_perl
X_SCLS=devtoolset-4 
JAVACONFDIRS=/opt/rh/devtoolset-4/root/etc/java:/etc/java
PCP_DIR=/opt/rh/devtoolset-4/root
LD_LIBRARY_PATH=/opt/rh/devtoolset-4/root/usr/lib64:/opt/rh/devtoolset-4/root/usr/lib
XDG_CONFIG_DIRS=/opt/rh/devtoolset-4/root/etc/xdg:/etc/xdg
PATH=/opt/rh/devtoolset-4/root/usr/bin:/opt/app-root/src/bin:/opt/app-root/bin:/opt/rh/devtoolset-4/root/usr/bin/:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
PKGM=yum
PWD=/opt/app-root/src
SHLVL=1
HOME=/opt/app-root/src
PYTHONPATH=/opt/rh/devtoolset-4/root/usr/lib64/python2.7/site-packages:/opt/rh/devtoolset-4/root/usr/lib/python2.7/site-packages
XDG_DATA_DIRS=/opt/rh/devtoolset-4/root/usr/share:/usr/local/share:/usr/share
INFOPATH=/opt/rh/devtoolset-4/root/usr/share/info
container=docker
_=/usr/bin/env
.qa.[root@ibm-x3630m4-01 ~]# 


Compare with:

.qa.[root@ibm-x3630m4-01 ~]# docker run --rm rhscl/devtoolset-4-toolchain-rhel7 env
PATH=/opt/app-root/src/bin:/opt/app-root/bin:/opt/rh/devtoolset-4/root/usr/bin/:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
HOSTNAME=1857734cceaf
container=docker
PKGM=yum
HOME=/opt/app-root/src
BASH_ENV=/opt/app-root/etc/scl_enable
ENV=/opt/app-root/etc/scl_enable
PROMPT_COMMAND=. /opt/app-root/etc/scl_enable
.qa.[root@ibm-x3630m4-01 ~]# 


For example, when I decide to use python scripting, my scripts won't have any information about enabled collections:

.qa.[root@ibm-x3630m4-01 ~]# docker run --rm rhscl/devtoolset-4-toolchain-rhel7 python -c 'import os, pprint; pprint.pprint(dict(os.environ), width=1)'
{'BASH_ENV': '/opt/app-root/etc/scl_enable',
 'ENV': '/opt/app-root/etc/scl_enable',
 'HOME': '/opt/app-root/src',
 'HOSTNAME': '10d760a7149d',
 'PATH': '/opt/app-root/src/bin:/opt/app-root/bin:/opt/rh/devtoolset-4/root/usr/bin/:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
 'PKGM': 'yum',
 'PROMPT_COMMAND': '. /opt/app-root/etc/scl_enable',
 'container': 'docker'}
.qa.[root@ibm-x3630m4-01 ~]# 


Version-Release number of selected component (if applicable):

rhscl/devtoolset-4-toolchain-rhel7, release 9.2 (95d79b670a3a)


How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

--- Additional comment from Marek Polacek on 2016-04-04 12:17:23 CEST ---

Bah, I thought
# Enable the SCL for all bash scripts.
ENV BASH_ENV=/opt/app-root/etc/scl_enable \
    ENV=/opt/app-root/etc/scl_enable \
    PROMPT_COMMAND=". /opt/app-root/etc/scl_enable"
was supposed to handle all these cases.  Not sure yet why it is ignored.

--- Additional comment from Marek Polacek on 2016-04-04 13:00:14 CEST ---

Note that devtoolset-4-perftools-docker behaves the same.

Comment 1 Miloš Prchlík 2016-04-05 10:50:18 UTC
FYI, we found a possible solution, see https://bugzilla.redhat.com/show_bug.cgi?id=1323575#c9 and later.

Comment 5 errata-xmlrpc 2016-05-31 08:45:11 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHEA-2016:1151