Apache OpenOffice (AOO) Bugzilla – Issue 18132
GetCorrectPath doesn't ...
Last modified: 2004-02-11 21:01:21 UTC
Despite our best efforts; GetCorrectPath does such nasty things to $PATH that I've never been able to trust it. By contrast, this re-write cleanly, and generically checks for path conflicts for all added paths, and attempts to minimally alter your path as/where it has to.
Created attachment 8393 [details] have a better go at getting this right.
of course; we should use 'join $ps, ...' instead of $ds on the last line ... ;-)
Waiting on working branch...
Hi, I found that this issue is already started but have no target. Please consider to set the target, as it is already started. Thanks
set target.
committed to ooo111fix2, can please someone verify ?
This broke the build in fix2: pavel@oo:~/BuildDir/ooo_1.1.1_src/readlicense_oo> set|grep /usr/lib/java/bin JAVA_BINDIR=/usr/lib/java/bin PATH=.:/home/pavel/BuildDir/ooo_1.1.1_src/solver/645/unxlngi4.pro/bin:/home/pavel/BuildDir/ooo_1.1.1_src/solenv/unxlngi4/bin:/home/pavel/BuildDir/ooo_1.1.1_src/solenv/bin:/opt/experimental/bin/:/usr/local/bin:/usr/bin:/usr/X11R6/bin:/bin:/usr/games:/opt/gnome/bin:/opt/kde3/bin:.:/usr/lib/java/bin.:/home/pavel/BuildDir/ooo_1.1.1_src/solver/645/unxlngi4.pro/bin:/home/pavel/BuildDir/ooo_1.1.1_src/solenv/unxlngi4/bin:/opt/experimental/bin/:/usr/local/X11R6/games:/gnome/kde3/bin:.:/lib/java//usr/bin The PATH contains: ..../bin. instead of ..../bin pavel@oo:~/BuildDir/ooo_1.1.1_src> which java /usr/lib/java/bin/java pavel@oo:~/BuildDir/ooo_1.1.1_src> . LinuxIntelEnv.Set.sh pavel@oo:~/BuildDir/ooo_1.1.1_src> which java pavel@oo:~/BuildDir/ooo_1.1.1_src>
Hi Pavel, This sounds bad; it'd be nice to see the value of PATH after sourcing the LinuxIntelEnv.Set.sh as well - it's slightly hard to see what's gone wrong otherwise. So your original path has: 'usr/lib/java/bin.' in it - do you intend the '.' to be there, and/or what do you intend it to do ? also, the code should (IMHO) transmit strange paths like that through just fine. Either way, more detail would help. [ Why is there no NEEDINFO state in this bugzilla ? ]
The value of PATH is shown in my previous comment. It is pretty long... Java is in /usr/lib/java as my previos comment shows. JAVA_BINDIR is correct. JAVA_BINDIR=/usr/lib/java/bin I'm not at home right now so I can not provide more detailed answer. The dot after bin is wrong. It was added by the change Martin applied.
Well; I just grabbed the fix2 code, and I see the problem, we were doing something foolish with $PATH .= GetCorrectPath($PATH,...) when we wanted an assignment; hence the problem. I've committed the attached patch that should fix the problem; there was also some $ps,$ds confusion that I thought we sorted out a while back. Thanks.
Created attachment 12352 [details] a fix.
Yes, this fixed it - thanks!
Current fix2 on FreeBSD: java is not in PATH: pavel@leda:~> /usr/local/jdk1.4.1/bin/java -version java version "1.4.1-p4" Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.1-p4-root_12_nov_2003_22_44) Java HotSpot(TM) Client VM (build 1.4.1-p4-root_12_nov_2003_22_44, mixed mode) pavel@leda:~> The configure command: ./configure --with-jdk-home=/usr/local/jdk1.4.1 --with-dict=ALL --with-lang=ENUS,CZECH,SLOVAK,DAN,HUNG,SLOVENIAN,DTCH,FINN,WELSH --with-gnu-patch=/usr/bin/patch --with-gnu-cp=/usr/local/bin/gcp --disable-crashdump --with-ant-home=/home/pavel/BuildDir/jakarta-ant-1.5.1 --disable-mozilla ******************************************************************** * * * OpenOffice.org build configuration. * * * * The configure proces checks your platform to see whether * * you can build OpenOffice.org on it. * * This proces checks all pre-requisites and generates a file * * containing the necessary environment variables. * * Source this file after configure has ended successfully. * * * * Any warning that is generated during the configure process * * must be taken into account, since it can be a reason for * * an unsuccessfull build of OpenOffice.org * * * ******************************************************************** ******************************************************************** * * * Checking the platform pre-requisites. * * * ******************************************************************** checking for gawk... no checking for mawk... no checking for nawk... nawk checking for nawk... /usr/bin/nawk checking for sed... /usr/bin/sed checking the operating system... checking the FreeBSD operating system release... found OSVERSION=490101 checked (FreeBSD) checking for gcc... gcc checking for C compiler default output... a.out checking whether the C compiler works... yes checking whether we are cross compiling... no checking for suffix of executables... checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether gcc accepts -g... yes checking for gcc option to accept ANSI C... none needed checking for gcc... /usr/local/gcc-3.2.3/bin/gcc checking the GNU gcc compiler version... checked (gcc 3.2.3) checking the GNU make version... checked (gmake 3.80) checking how to run the C preprocessor... gcc -E checking for egrep... grep -E checking for ANSI C header files... yes checking pam_appl.h... yes checking for g++... g++ checking whether we are using the GNU C++ compiler... yes checking whether g++ accepts -g... yes checking try to compile exception code... Exceptions type: dwarf2 checking for STLport4 headers... using internal stlport. checking whether to build with Java support... yes checking the installed JDK... checked (JDK 1.4.1-p4) checking how to run the C preprocessor... gcc -E checking how to run the C++ preprocessor... g++ -E checking for xmkmf... /usr/X11R6/bin/xmkmf checking for perl... /usr/bin/perl checking the Perl version... checked (perl 5) checking for tcsh... /bin/tcsh checking for dmake... no checking which zlib to use... internal checking for X... libraries /usr/X11R6/lib, headers /usr/X11R6/include checking for gethostbyname... yes checking for connect... yes checking for remove... yes checking for shmat... yes checking for IceConnectionNumber in -lICE... yes checking for XOpenDisplay in -lX11... yes checking for bison... /usr/local/bin/bison checking for flex... /usr/bin/flex checking for patch... /usr/bin/patch checking for zip... /usr/local/bin/zip checking GPC files... GPC files found checking whether to build mozilla connectivity... yes checking whether to include Bitstream Vera fonts... yes checking for jakarta-ant... no checking for ant... /home/pavel/BuildDir/jakarta-ant-1.5.1/bin/ant checking if /home/pavel/BuildDir/jakarta-ant-1.5.1/bin/ant works... Ant works ******************************************************************** * * * Setting up the build environment variables. * * * ******************************************************************** configure: creating ./config.status config.status: creating set_soenv Use of uninitialized value at ./set_soenv line 847. Setting up the environment for building OpenOffice.org Setting platform independent values... Setting FreeBSD specific values... done Setting the environment variables... done Setting the aliases... done The variable SRC_ROOT is set to: /home/pavel/BuildDir/ooo_1.1.1_src The variable SHELL is set to: /bin/tcsh The variable JAVA_HOME is set to: /usr/local/jdk1.4.1 The variable XSLTPROC is set to: NO_XSLTPROC The variable ANT_HOME is set to: /home/pavel/BuildDir/jakarta-ant-1.5.1 The variable JDKLIB is set to: unset The variable STLPORT4 is set to: NO_STLPORT4 The variable ASM_PATH is set to: unset The variable BUILD_SOSL is set to: true The variable LOCAL_SOLENV is set to: true The variable FRAMEWORKSHOME is set to: unset # # Platform independent constant values. # The variable DIC_CSCZ is set to: TRUE The variable DIC_DADK is set to: TRUE The variable DIC_DEDE is set to: TRUE The variable DIC_ENGB is set to: TRUE The variable DIC_ENUS is set to: TRUE The variable DIC_FIFI is set to: TRUE The variable DIC_HUHU is set to: TRUE The variable DIC_ITIT is set to: TRUE The variable DIC_RURU is set to: TRUE The variable DIC_SKSK is set to: TRUE The variable DIC_SLSI is set to: TRUE The variable RES_ARAB is set to: unset The variable RES_CAT is set to: unset The variable RES_CHINSIM is set to: unset The variable RES_CHINTRAD is set to: unset The variable RES_CZECH is set to: TRUE The variable RES_DAN is set to: TRUE The variable RES_DTCH is set to: TRUE The variable RES_ENUS is set to: TRUE The variable RES_FREN is set to: unset The variable RES_GREEK is set to: unset The variable RES_HUNG is set to: TRUE The variable RES_ITAL is set to: unset The variable RES_JAPN is set to: unset The variable RES_KOREAN is set to: unset The variable RES_POL is set to: unset The variable RES_PORT is set to: unset The variable RES_PORTBR is set to: unset The variable RES_RUSS is set to: unset The variable RES_SLOVAK is set to: TRUE The variable RES_SLOVENIAN is set to: TRUE The variable RES_SPAN is set to: unset The variable RES_SWED is set to: unset The variable RES_TURK is set to: unset The variable RES_FINN is set to: TRUE The variable RES_ESTONIAN is set to: unset The variable RES_WELSH is set to: TRUE The variable CALL_CDECL is set to: TRUE The variable COMMON_OUTDIR is set to: The variable common_build is set to: The variable NO_SRS_PATCH is set to: true The variable PRODUCT is set to: full The variable PROFULLSWITCH is set to: product=full The variable BIG_GOODIES is set to: TRUE The variable BMP_WRITES_FLAG is set to: TRUE The variable BUILD_SOSL_RELEASE is set to: TRUE The variable MK_UNROLL is set to: TRUE The variable MULTITHREAD_OBJ is set to: The variable NO_REC_RES is set to: TRUE The variable PROEXT is set to: .pro The variable SO3 is set to: TRUE The variable SOLAR_PLUGIN is set to: TRUE The variable TF_PACKAGES is set to: TRUE The variable TF_FILEURL is set to: TRUE The variable TF_CFGDATA is set to: TRUE The variable TF_SVDATA is set to: TRUE The variable TF_SDBAPI is set to: ist_da The variable TF_UCB is set to: ist_da The variable UPDATER is set to: YES The variable build_deliver is set to: true The variable USE_NEWCHARSET is set to: TRUE The variable USE_NEW_RSC is set to: TRUE The variable VCL is set to: TRUE The variable USE_NAMESPACE is set to: TRUE The variable ENABLEUNICODE is set to: TRUE The variable NEW_JAR_PACK is set to: TRUE The variable NO_BSYMBOLIC is set to: TRUE The variable TF_FILTER is set to: TRUE The variable ENABLE_STATIC_GTK is set to: FALSE The variable PSPRINT is set to: TRUE The variable MKDEPENDSOLVER is set to: TRUE # # Platform dependent constant values. # The variable SOLAR_JAVA is set to: TRUE The variable BIG_SVX is set to: TRUE The variable COM is set to: GCC The variable COMPATH is set to: /usr/local/gcc-3.2.3/bin The variable CPU is set to: I The variable CPUNAME is set to: INTEL The variable CVER is set to: C300 The variable DLLSUFFIX is set to: fi The variable GUI is set to: UNX The variable GLIBC is set to: The variable GUIBASE is set to: unx The variable GUIENV is set to: sal The variable GVER is set to: VCL The variable OS is set to: FREEBSD The variable EXCEPTIONS is set to: dwarf2 The variable OSVERSION is set to: 490101 The variable PTHREAD_CFLAGS is set to: -D_THREAD_SAFE The variable PTHREAD_LIBS is set to: -pthread The variable OUTPATH is set to: unxfbsd The variable INPATH is set to: unxfbsd.pro The variable GVERDIR is set to: unxfbsd.pro The variable PATH_SEPERATOR is set to: : The variable XPVERSION is set to: 3 The variable COMEX is set to: unset The variable PROSWITCH is set to: -DPRODUCT The variable BOTH is set to: unset The variable CDPATHx is set to: unset The variable DEMO_ENV is set to: unset The variable DYNAMIC_CRT is set to: unset The variable SET_EXCEPTIONS is set to: unset The variable emergency is set to: unset The variable use_shl_versions is set to: unset The variable WRAPCMD is set to: # # Variable values. # The variable PERL is set to: /usr/bin/perl The variable GNUMAKE is set to: gmake The variable UPD is set to: 645 The variable SOLARUPD is set to: 645 The variable WORK_STAMP is set to: FIX645 The variable TF_ONE51 is set to: FIX645 The variable TF_SVDATA is set to: TRUE The variable TF_CFGDATA is set to: TRUE The variable TF_FILEURL is set to: TRUE The variable URD_ONLY is set to: FIX645 The variable SOLARROOT is set to: $SRC_ROOT The variable RSCRES is set to: $SRC_ROOT The variable SOLARVER is set to: /home/pavel/BuildDir/ooo_1.1.1_src/solver The variable SOLARVERSION is set to: $SOLARVER/645 The variable SOLARENV is set to: /home/pavel/BuildDir/ooo_1.1.1_src/solenv The variable SOLARENVINC is set to: $SOLARENV/inc The variable LOCALINI is set to: $SOLARENV/config The variable STAR_INIROOT is set to: $SOLARENV/config The variable STAR_INIROOTOLD is set to: $SOLARENV/config The variable STAR_STANDLST is set to: $SOLARENV/config/stand.lst The variable STAR_SSCOMMON is set to: $SOLARENV/config/ssolar.cmn The variable STAR_SSOLARINI is set to: $SOLARENV/config/ssolar.ini The variable STAR_RESOURCEPATH is set to: $SOLARVER/$UPD/$INPATH/bin The variable STAR_REGISTRY is set to: $STAR_RESOURCEPATH/applicat.rdb The variable DMAKEROOT is set to: $SOLARENVINC/startup The variable CLASSPATH is set to: $JAVA_HOME/jre/lib/rt.jar:. The variable XCLASSPATH is set to: $JAVA_HOME/jre/lib/rt.jar:. The variable LD_LIBRARY_PATH is set to: .:$SOLARENV/$INPATH/lib:$JAVA_HOME/jre/lib/i386:$JAVA_HOME/jre/lib/i386/client:$JAVA_HOME/jre/lib/i386/native_threads:../lib:$SOLARVER/$UPD/$INPATH/lib: The variable SOLARDEF is set to: -DUNX -DGCC -DC300 -DVCL -DFREEBSD -DINTEL -DX86 -DOSVERSION=490101 -D_THREAD_SAFE -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -DSUPD=645 -DPRODUCT -DUPDVER=""'"'"SV645"'"'"" The variable SCPDEFS is set to: The variable SOLAREXTRAINC is set to: unset The variable SOLAREXTRALIB is set to: -L../lib The variable SOLARINCLUDES is set to: -I$SOLARENV/inc The variable PATH is set to: .:$SOLARVER/$UPD/$INPATH/bin:$SOLARENV/$OUTPATH/bin:$SOLARENV/bin:/usr/local/gcc-3.2.3/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/games:/usr/local/sbin:/usr/local/bin:/usr/X11R6/bin:/home/pavel/bin The variable PATHEXTRA is set to: unset The variable SOLARLIB is set to: -L../lib -L$SOLARENV/$OUTPATH/lib -L$SOLARVER/$UPD/$INPATH/lib -L$SOLARENV/$OUTPATH/lib -L$JAVA_HOME/lib -L$JAVA_HOME/jre/lib/i386 -L$JAVA_HOME/jre/lib/i386/client -L$JAVA_HOME/jre/lib/i386/native_threads -L/usr/X11R6/lib The variable SOLARINC is set to: -I. -I$SOLARVER/$UPD/$INPATH/inc/stl -I$SOLARVER/$UPD/$INPATH/inc/external -I$SOLARVER/$UPD/$INPATH/inc -I$SOLARENV/$OUTPATH/inc -I$SOLARENV/inc -I$SRC_ROOT/res -I/home/pavel/BuildDir/ooo_1.1.1_src/solver/645/unxfbsd.pro/inc/stl -I$SOLARENV/inc/Xp31 -I$JAVA_HOME/include -I$JAVA_HOME/include/freebsd -I$JAVA_HOME/include/bsd -I$JAVA_HOME/include/native_threads/include -I/usr/X11R6/include The variable COMP_ENV is set to: unset The variable JAVAHOME is set to: unset The variable CC is set to: gcc The variable CXX is set to: g++ The variable LINK is set to: gcc The variable ENABLE_SYMBOLS is set to: The variable ENABLE_CRASHDUMP is set to: The variable VC_STANDARD is set to: The variable WITH_GPC is set to: YES The variable WITH_LIBART is set to: NO The variable LIBART_CFLAGS is set to: The variable LIBART_LIBS is set to: The variable WITH_LIBSN is set to: NO The variable LIBSN_CFLAGS is set to: The variable LIBSN_LIBS is set to: The variable WITH_MOZILLA is set to: NO The variable WITH_FONTS is set to: YES The variable SYSTEM_ZLIB is set to: NO The variable BUILD_DMAKE is set to: YES The variable GXX_INCLUDE_PATH is set to: /usr/local/gcc-3.2.3/lib/gcc-lib/i386-portbld-freebsd4.9/3.2.3/include/g++-v3 The variable COMMON_BUILD_TOOLS is set to: $SRC_ROOT/external/common The variable TEMP is set to: unset The variable TMP is set to: unset The variable SOLARSRC is set to: $SRC_ROOT The variable DELIVER is set to: deliver.pl The variable MKOUT is set to: mkout.pl The variable ZIPDEP is set to: zipdep.pl The variable GCCINSTLIB is set to: gccinstlib.pl The variable USE_SHELL is set to: tcsh The variable PYTHONPATH is set to: .:$SOLARVER/$UPD/$INPATH/lib:$SOLARVER/$UPD/$INPATH/lib/python:$SOLARVER/$UPD/$INPATH/lib/python/lib-dynload The variable PYTHONHOME is set to: $SOLARVER/$UPD/$INPATH # # Aliases. # The alias mkout is set to: "perl $SOLARENV/bin/mkout.pl" The alias deliver is set to: "perl $SOLARENV/bin/deliver.pl" The alias build is set to: "perl $SOLARENV/bin/build.pl" The alias zipdep is set to: "perl $SOLARENV/bin/zipdep.pl" The alias nmake is set to: "dmake" The variable GNUPATCH is set to: /usr/bin/patch The variable GNUCOPY is set to: /usr/local/bin/gcp Build environment is properly set up. **************************************************************************** * * OpenOffice.org 645 configuration. * * * Configuration part of OpenOffice.org 645 build is finished. * * NB! Be aware that you might not be able to build OpenOffice.org if you * ignore any warning message that were generated during this configuration * process. * * Any interactive values you have given have not been version checked. * * USAGE: * Source FreeBSDEnv.Set (in tcsh) or FreeBSDEnv.Set.sh (in sh) * in order to set up the build-environment variables. * * **************************************************************************** Configure completed You may now run /home/pavel/BuildDir/ooo_1.1.1_src/bootstrap in /home/pavel/BuildDir/ooo_1.1.1_src pavel@leda:~/BuildDir/ooo_1.1.1_src> echo $PATH .:/home/pavel/BuildDir/ooo_1.1.1_src/solver/645/unxfbsd.pro/bin:/home/pavel/BuildDir/ooo_1.1.1_src/solenv/unxfbsd/bin:/home/pavel/BuildDir/ooo_1.1.1_src/solenv/bin:/usr/local/gcc-3.2.3/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/games:/usr/local/sbin:/usr/local/bin:/usr/X11R6/bin:/home/pavel/bin pavel@leda:~/BuildDir/ooo_1.1.1_src> which java pavel@leda:~/BuildDir/ooo_1.1.1_src> I do not know if this bug is the one which affected this, but I do not see anything similar right now, sorry.
Ok; this is silly - we are substituting a literal '$JAVA_HOME' in the path; which is why the if ( -x $path/$cmd ) was failing; we now continue even if that fails, and get the right element in the path. Unfortunately, this rather circumvents some of the checking we do - which is a shame, but ...
Created attachment 12454 [details] java fix committed to branch
The original change broke the build on Windows: xcacek@DROGO ~/p/BuildDir/ooo_1.1.1_src/config_office $ echo $TOUCH /usr/touch.exe xcacek@DROGO ~/p/BuildDir/ooo_1.1.1_src/config_office $ which touch /usr/bin/touch Before changes (I do not know if your change is exactly the change which broke the build, but I'm 95% sure): The variable CYGWIN is set to: /usr/bin right now: The variable CYGWIN is set to: /usr Thus The variable GREP is set to: $CYGWIN/grep.exe The variable FIND is set to: $CYGWIN/find.exe The variable LS is set to: $CYGWIN/ls.exe The variable GNUCOPY is set to: $CYGWIN/cp.exe The variable TOUCH is set to: $CYGWIN/touch.exe are all bad. Raising prio to P1 because fix2 is not buildable on Windows at all.
This is different issue between user and his keyboard ;-) Sorry for confusion. Configure detected (see http://tmp.janik.cz/OpenOffice.org/log.diff) e.g.: checking for bash... /usr/bin Thus CYGWIN was set to: The variable CYGWIN is set to: /usr instead of The variable CYGWIN is set to: /usr/bin Etc. Fixed.
verifying.
closing