Issue 7701 - bogus clobbering of PATH and LD_LIBRARY_PATH (patch)
Summary: bogus clobbering of PATH and LD_LIBRARY_PATH (patch)
Status: CLOSED FIXED
Alias: None
Product: Build Tools
Classification: Code
Component: code (show other issues)
Version: current
Hardware: PC All
: P3 Trivial (vote)
Target Milestone: ---
Assignee: Unknown
QA Contact: issues@tools
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-09-12 17:34 UTC by mmeeks
Modified: 2003-03-16 20:15 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments
643 version of the patch.. (5.41 KB, patch)
2002-09-17 12:29 UTC, foskey
no flags Details | Diff
Please apply this patch to unbreak gcc 2.95 (594 bytes, patch)
2002-09-19 00:20 UTC, foskey
no flags Details | Diff
don't clobber the path patch (1.49 KB, patch)
2002-09-23 14:45 UTC, mmeeks
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this issue.
Description mmeeks 2002-09-12 17:34:19 UTC
We clobber the users' PATH / LD_LIBRARY_PATH, and proceed to try and construct
these accurately for their system out of thin air. This can badly confuse
compiler / ccache paths / aliases, and there's no need to do it.

Especially bad is including random directories such as '/usr/local' and
explicitely including gcc's include dir and /usr/include.

This removes some of these, and paves the way to more shared code between
platforms, reducing the size of the configure scripts - that is, assuming people
can set their paths right [ which they have to anyway ].
Comment 1 mmeeks 2002-09-12 17:40:07 UTC
Attaching files seems to cause an 'internal server error or mis ...'

so: inline:
Index: set_soenv.in
===================================================================
RCS file: /cvs/tools/config_office/set_soenv.in,v
retrieving revision 1.1.4.4
diff -u -p -u -r1.1.4.4 set_soenv.in
--- config_office/set_soenv.in	10 Sep 2002 17:41:11 -0000	1.1.4.4
+++ config_office/set_soenv.in	11 Sep 2002 09:26:44 -0000
@@ -924,10 +924,10 @@ elsif (($platform eq "$Linux") || ($plat
                         $ps.$JRELIBDIR.
                         $ps.$JRETOOLKITDIR.
                         $ps.$JRETHREADDIR.
-                        $ps.$USR_LOCAL.$LIB.
                         $ps.$par_dir.$LIB.
                         $ps_STLPORT_LIB.
-                        $ps.'$SOLARVER'.$ds.'$UPD'.$ds.'$INPATH'.$LIB;
+                        $ps.'$SOLARVER'.$ds.'$UPD'.$ds.'$INPATH'.$LIB.
+
		$ps.$ENV{'LD_LIBRARY_PATH'};
 }
 elsif ($platform eq "$FreeBSD")
 {  $LD_LIBRARY_PATH   = $cur_dir.
@@ -1003,23 +1003,19 @@ if ($platform eq "$Solaris") 
                         $L.$USR_DT.$LIB.
                         $L.$USR_OPENWIN.$LIB;
 }
-elsif (($platform eq "$Linux") || ($platform eq "$NetBSD") || 
($platform eq "$Tru64") || ($platform eq "$Irix") || ($platform eq
"$Irix64"))
-{  $SOLAREXTRALIB     = $L.$par_dir.$LIB.
-                        $L.$LIB.
-                        $L.$USR.$LIB.
-                        $L.$USR.$LOCAL.$LIB;
+elsif (($platform eq "$Linux") || ($platform eq "$NetBSD") || 
($platform eq "$Tru64") ||
+       ($platform eq "$Irix") || ($platform eq "$Irix64") ||
($platform eq "$FreeBSD"))
+{
+   $SOLAREXTRALIB     = $L.$par_dir.$LIB;
 }
 elsif ($platform eq "$Macosx") 
 {  $SOLAREXTRALIB     = $L.$LIB.
                         $L.$USR.$LIB;
 }
-elsif ($platform eq "$FreeBSD")
-{
-    $SOLAREXTRALIB    = $L.$par_dir.$LIB;
-}
 
 # Compiler include search directory paths.
-if (($platform eq "$Solaris") || ($platform eq "$Linux") ||
($platform eq "$FreeBSD") || ($platform eq "$NetBSD") || ($platform eq
"$Tru64") || ($platform eq "$Irix") || ($platform eq "$Irix64")) 
+if (($platform eq "$Solaris") || ($platform eq "$Linux") ||
($platform eq "$FreeBSD") ||
+    ($platform eq "$NetBSD") || ($platform eq "$Tru64") || ($platform
eq "$Irix") || ($platform eq "$Irix64")) 
 {  $SOLARINCLUDES     = $I.'$SOLARENV'.$INC;
 }
 elsif ($platform eq "$Winnt")
@@ -1082,18 +1078,10 @@ if ($platform eq "$Solaris") 
    }
 
    $PATH             .= GetCorrectPath($COMPATH.$BIN, $PERL_PATH,
$TCSH_PATH, $compiler);
-
-   $PATH             .= $ps.$USR.$ds."sbin".
-                        $ps.$ETC.
-                        $ps.$USR.$BIN.$ds."X11".
-
		$ps.$USR.$ds."X11".$BIN.
-                        $ps.$OPT.$ds."langtools".$BIN.
-                        $ps.$USR_OPENWIN.$BIN.
-                        $ps.$USR_DT.$BIN.
-                        $ps.$USR.$LIB.
-                        $ps.$USR_LOCAL.$BIN;
+   $PATH             .= $ps.$oldPATH;
 }
-elsif (($platform eq "$Linux") or ($platform eq "$NetBSD") or
($platform eq "$Tru64") or ($platform eq "$Irix") or ($platform eq
"$Irix64"))
+elsif (($platform eq "$Linux") or ($platform eq "$NetBSD") or
($platform eq "$Tru64") or
+       ($platform eq "$Irix") or ($platform eq "$Irix64") or
($platform eq "$FreeBSD"))
 {  $PATH              = $cur_dir.
                         $ps.'$SOLARVER'.$ds.'$UPD'.$ds.'$INPATH'.$BIN.
                         $ps.'$SOLARENV'.$ds.'$OUTPATH'.$BIN.
@@ -1104,30 +1092,8 @@ elsif (($platform eq "$Linux") or ($plat
       $PATH .=          $ps.'$JAVA_HOME'.$BIN;
    }
 
-   $PATH             .= GetCorrectPath($COMPATH, $PERL_PATH,
$TCSH_PATH, $compiler);
-
-   $PATH             .= $ps.$USR.$ds."sbin".
-                        $ps.$ETC.
-                        $ps.$USR.$BIN.$ds."X11".
-
		$ps.$USR.$ds."X11".$BIN.
-                        $ps.$USR.$LIB;
+   $PATH             .= $ps.$oldPATH;
 }
-elsif ($platform eq "$FreeBSD")
-{  $PATH              = $cur_dir.
-                        $ps.'$SOLARVER'.$ds.'$UPD'.$ds.'$INPATH'.$BIN.
-                        $ps.'$SOLARENV'.$ds.'$OUTPATH'.$BIN.
-                        $ps.'$SOLARENV'.$BIN.
-                        $ps.'$JAVA_HOME'.$BIN.
-
		$ps.$USR_LOCAL.$BIN.
-
		$ps.$USR_LOCAL.$ds."sbin";
-
-   $PATH             .= GetCorrectPath($COMPATH, $PERL_PATH,
$TCSH_PATH, $compiler);
-
-   $PATH             .= $ps.$USR.$ds."sbin".
-                        $ps.$USR.$ds."X11R6".$ds."bin".
-                        $ps.$USR.$LIB;
-}
-
 elsif ($platform eq "$Winnt")
 { 
    my ( $noldPATH );
@@ -1242,9 +1208,6 @@ elsif (($platform eq "$Linux") || ($plat
 
		$L.'$SOLARENV'.$ds.'$OUTPATH'.$LIB.
                         $L.'$SOLARVER'.$ds.'$UPD'.$ds.'$INPATH'.$LIB.
                         $L.'$SOLARENV'.$ds.'$OUTPATH'.$LIB.
-                        $L.$LIB.
-                        $L.$USR_LIB.
-                        $L.$USR_LOCAL.$LIB.
                         $L.'$JAVA_HOME'.$LIB.
                         $L.$JRELIBDIR.
                         $L.$JRETOOLKITDIR.
@@ -1350,9 +1313,7 @@ else
 
 #The tail, if needed
 if (($platform eq "$Linux") or  ($platform eq "$FreeBSD") or
($platform eq "$NetBSD"))
-{  $SOLARINC         .= $I.$XINC.
-                        $I.$GCC_INCLUDE.
-                        $I.$USR.$INCLUDE;
+{  $SOLARINC         .= $I.$XINC;
 }
 elsif ($platform eq "$Tru64") 
 {  $SOLARINC         .= $I.$XINC.
Comment 2 foskey 2002-09-15 03:57:42 UTC
IN order for this to work with gcc 2.95 you also have to apply this patch:

Index: unxlngi3.mk
===================================================================
RCS file: /cvs/oo/tools/solenv/inc/unxlngi3.mk,v
retrieving revision 1.17
diff -r1.17 unxlngi3.mk
87,90d86
< # name of C++ Compiler
< CC=g++
< # name of C Compiler
< cc=gcc
92,96d87
< # do not use standard header search paths
< # if installed elsewhere
< .IF "$(BUILD_SOSL)"!=""
< CFLAGS=-nostdinc
< .ENDIF

Comment 3 foskey 2002-09-17 12:29:27 UTC
Created attachment 2877 [details]
643 version of the patch..
Comment 4 foskey 2002-09-19 00:20:07 UTC
Created attachment 2904 [details]
Please apply this patch to unbreak gcc 2.95
Comment 5 Unknown 2002-09-19 12:20:48 UTC
just need to clarify: 

has patch id=2877 been comitted, but id=2904 not? 
Comment 6 foskey 2002-09-19 13:36:59 UTC
That is correct,  please apply this patch.
Comment 7 Unknown 2002-09-19 15:37:56 UTC
patches are on SRX643_OO branch

Comment 8 mmeeks 2002-09-23 14:44:27 UTC
Sadly; while the LD_LIBRARY_PATH brokenness got fixed;
you seem to have entirely missed the (more important) 'PATH' fixing
aspect; which remains un-committed.

I attach the remainder, that stops the PATH being clobbered [
interestingly we now have two cases for FreeBSD path setup, but
neither does not clobber ;-] most odd:
Comment 9 mmeeks 2002-09-23 14:45:27 UTC
Created attachment 2940 [details]
don't clobber the path patch
Comment 10 foskey 2002-09-24 14:07:38 UTC
Applied patch to SRX643_OO only.  Version  1.1.4.8
Comment 11 mmeeks 2002-09-30 10:35:09 UTC
Thanks guys for nailing this, a big help.
Comment 12 michael.bemmer 2003-03-16 20:11:18 UTC
As discussed with Armin, he thought these bug were closed, he sees all of them
as verified.
Comment 13 michael.bemmer 2003-03-16 20:15:00 UTC
As discussed with Armin, he thought these bug were closed, he sees all of them
as verified.