Bug 1749445

Summary: enabling devtoolset-8 exports bad PYTHONPATH
Product: Red Hat Developer Toolset Reporter: Joe Wright <jwright>
Component: devtoolset-metaAssignee: Marek Polacek <mpolacek>
Status: CLOSED ERRATA QA Contact: Martin Cermak <mcermak>
Severity: high Docs Contact:
Priority: unspecified    
Version: DTS 8.0 RHEL 7CC: fche, jakub, mnewsome, ohudlick, pbhoot, tborcin
Target Milestone: alpha   
Target Release: 9.0   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: devtoolset-9-9.0-1.el7 Doc Type: No Doc Update
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-12-10 07:49:10 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:
Embargoed:

Description Joe Wright 2019-09-05 15:53:31 UTC
Description of problem:
The 'devtoolset-6' and 'devtoolset-8' enable script exports a PYTHONPATH like this:

/opt/rh/devtoolset-6/root/usr/lib64/python2.7/site-packages:/opt/rh/devtoolset-6/root/usr/lib/python2.7/site-packages


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

How reproducible:


Steps to Reproduce:
1. run the DTS 8 enable script
2.
3.

Actual results:
PYTHONPATH becomes /opt/rh/devtoolset-6/root/usr/lib64/python2.7/site-packages:/opt/rh/devtoolset-6/root/usr/lib/python2.7/site-packages

Expected results:
- DTS doesn't have python
- The directories do not exist

Additional info:
this was originally introduced in the devtoolset-1.1 release.

        $ git show 38b3081c6e2e0b034f229d8fa3c93787293ae8d4
        commit 38b3081c6e2e0b034f229d8fa3c93787293ae8d4
        Author: Frank Ch. Eigler <fche>
        Date:   Wed Aug 22 13:15:16 2012 -0400

            enable script: add PYTHONPATH as per PERL5LIB

        diff --git a/devtoolset-1.1.spec b/devtoolset-1.1.spec
        index 5c92f90..bc9ef90 100644
        --- a/devtoolset-1.1.spec
        +++ b/devtoolset-1.1.spec
        @@ -3,7 +3,7 @@
         Summary: Package that installs %scl
         Name: %scl_name
         Version: 1
        -Release: 6%{?dist}
        +Release: 7%{?dist}
         BuildArch: noarch
         License: GPLv2+
         Group: Applications/File
        @@ -56,6 +56,9 @@ export PERL5LIB=%{_scl_root}/%{perl_vendorarch}:%{_scl_root}/usr/lib/perl5:%{_sc
         # or else /etc/ld.so.conf.d files?
         rpmlibdir=`rpm --eval "%%{_libdir}"`
         export LD_LIBRARY_PATH=%{_scl_root}$rpmlibdir${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
        +# duplicate python site.py logic for sitepackages
        +pythonvers=`python -c 'import sys; print sys.version[:3]'`
        +export PYTHONPATH=%{_scl_root}/lib64/python$pythonvers/site-packages:%{_scl_root}/lib/python$pythonvers/site-packages${PYTHONPATH:+:${PYTHONPATH}}
         EOF
         mkdir -p %{buildroot}/%{_scl_root}/usr/bin
         cat > %{buildroot}/%{_scl_root}/usr/bin/sudo <<\EOF
        @@ -90,6 +93,9 @@ mkdir -p %{buildroot}%{_docdir}
         %{_root_sysconfdir}/rpm/macros.%{scl}-config
 
         %changelog
        +* Wed Aug 22 2012 Frank Ch. Eigler <fche> 1-7
        +- add $PYTHONPATH definition, roughly paralleling PERL5LIB
        +
         * Tue Aug 21 2012 Frank Ch. Eigler <fche> 1-6
         - bz849452: include a %{_scl_root}/usr/bin/sudo wrapper.
         - add %{_scl_root}/usr/lib/perl5 to PERL5LIB.

Comment 3 Frank Ch. Eigler 2019-09-10 13:32:45 UTC
I assume we did this with some python-related code we do or did ship with some dts component, maybe gdb or systemtap.  Does this variable setting pose any problems?

Comment 4 Frank Ch. Eigler 2019-09-10 17:14:50 UTC
A search over a variety of dts6+ packages, I see none that contain content in either that python site-packages or perl.  It seems we can drop both settings.

Comment 5 Marek Polacek 2019-09-23 17:21:31 UTC
*** Bug 1749434 has been marked as a duplicate of this bug. ***

Comment 6 Marek Polacek 2019-09-23 19:13:18 UTC
Patch committed.

Comment 14 errata-xmlrpc 2019-12-10 07:49:10 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-2019:4132