![]() |
Project Builder path problem
I'm having trouble getting started developing software with Project Builder on the Mac and sure could use some help! In particular, when trying to build even the simplest app (just an empty window), the build fails because it can't even find "/bin/rm" or "/bin/mktemp".
I am able to compile the project from a terminal window (tcsh shell) with the "pbxbuild" command, and afterwards I can run from Project Builder. It looks to me like some of the system variables are hosed; ~10 yrs. programming under SunOS and linux, but a complete newbie in Mac's OS-X and at a loss of how to troubleshoot. Any help greatly appreciated! Thanks, Jon _____________________ /Developer/Private/jam -d1 -j2 JAMBASE=/Developer/Makefiles/pbx_jamfiles/ProjectBuilderJambase JAMFILE=- build ACTION=build _DEFAULT_GCC_VERSION=3.1 BUILD_STYLE=Development CPP_HEADERMAP_FILE=/Users/owenj/Nothing/build/Nothing.build/Nothing.build/Nothing.hmap SRCROOT=/Users/owenj/Nothing OBJROOT=/Users/owenj/Nothing/build SYMROOT=/Users/owenj/Nothing/build DSTROOT=/tmp/Nothing.dst Mkdir /Users/owenj/Nothing/build/Nothing.app /bin/mkdir -p /Users/owenj/Nothing/build/Nothing.app Mkdir /Users/owenj/Nothing/build/Nothing.build/Nothing.build/PrefixHeaders /bin/mkdir -p /Users/owenj/Nothing/build/Nothing.build/Nothing.build/PrefixHeaders Mkdir /Users/owenj/Nothing/build/Nothing.app/Contents/Resources /bin/mkdir -p /Users/owenj/Nothing/build/Nothing.app/Contents/Resources MakePFEFile /Users/owenj/Nothing/build/Nothing.build/Nothing.build/PrefixHeaders/Nothing_Prefix-ppc.pfe for _c_dialect in objective-c ; do if [ ${_c_dialect} == c -o ${_c_dialect} == objective-c ] ; then dummy_file=`mktemp /tmp/.null-XXXXXXXX`; /usr/bin/gcc3 -c -x ${_c_dialect} -F/Users/owenj/Nothing/build -I/Users/owenj/Nothing/build/include -arch ppc -fno-common -fpascal-strings -O0 -Wmost -Wno-four-char-constants -Wno-unknown-pragmas -mdynamic-no-pic -pipe "-fmessage-length=0" -g -Wp,-header-mapfile,/Users/owenj/Nothing/build/Nothing.build/Nothing.build/Nothing.hmap -I/Users/owenj/Nothing /Users/owenj/Nothing/Nothing_Prefix.h -o ${dummy_file} --dump-pch /Users/owenj/Nothing/build/Nothing.build/Nothing.build/PrefixHeaders/Nothing_Prefix-ppc.pfe ; exit_code=$? ; rm ${dummy_file} ; if [ ${exit_code} != 0 ] ; then rm -r /Users/owenj/Nothing/build/Nothing.build/Nothing.build/PrefixHeaders/Nothing_Prefix-ppc.pfe ; exit ${exit_code} ; fi ; fi ; done /bin/sh: mktemp: command not found gcc3: cannot specify -o with -c or -S and multiple compilations /bin/sh: rm: command not found /bin/sh: rm: command not found Mkdir /Users/owenj/Nothing/build/Nothing.app/Contents/Resources/English.lproj /bin/mkdir -p /Users/owenj/Nothing/build/Nothing.app/Contents/Resources/English.lproj PBXCp /Users/owenj/Nothing/build/Nothing.app/Contents/Resources/English.lproj/MainMenu.nib /Developer/Tools/pbxcp -exclude .DS_Store -exclude CVS -resolve-src-symlinks English.lproj/MainMenu.nib /Users/owenj/Nothing/build/Nothing.app/Contents/Resources/English.lproj PBXCp /Users/owenj/Nothing/build/Nothing.app/Contents/Resources/English.lproj/InfoPlist.strings /Developer/Tools/pbxcp -exclude .DS_Store -exclude CVS -resolve-src-symlinks English.lproj/InfoPlist.strings /Users/owenj/Nothing/build/Nothing.app/Contents/Resources/English.lproj ...failed MakePFEFile /Users/owenj/Nothing/build/Nothing.build/Nothing.build/PrefixHeaders/Nothing_Prefix-ppc.pfe ... |
That's odd...first things first, which version of the OS and which version of PB?
|
tar heel,
Are you sure you installed the BSD Subsystem when installing OSX? Code:
Sao @ ~ $ grepbom mktemp |
sao, that's what I thought at first, but the error about rm (which is in Base) is what confused me...
|
sao and bib,
I'm not familiar wit the "grepbom" command, and it doesn't seem to be installed (or in my path)... Should this be installed by default? The target machine is a dual 1Ghz G4 tower (Jan 03), currently running 10.2.6 with Project Builder version 2.1. From the terminal command line, there is no problem finding rm or mktemp from either the tcsh (my default shell) or from the sh shell: tcsh% which rm /bin/rm tcsh% which mktemp /usr/bin/mktemp tcsh% printenv PATH /bin:/sbin:/usr/bin:/usr/sbin:/usr/local/teTeX/bin/powerpc-apple-darwin-current:/usr/local/bin tcsh% sh sh-2.05a$ which rm /bin/rm sh-2.05a$ which mktemp /usr/bin/mktemp sh-2.05a$ printenv PATH /bin:/sbin:/usr/bin:/usr/sbin:/usr/local/teTeX/bin/powerpc-apple-darwin-current:/usr/local/bin My only guess is that the PATH environment variable being used by Project Builder doesn't include /usr/bin, but I don't know how to check that (or where to fix if neeed). Thanks, Jon |
ProjectBuilderJambase file
The file that governs the build process is ProjectBuilderJambase in the directory /Developer/Makefiles/pbx_jamfiles
I would try editing that file to add some debugging commands (e.g. echo $PATH) at the start of the "actions MakePFEFile". Of course, save a copy of this file before editing it. |
Also, are you setting PATH in ~/.MacOSX/environment.plist ?
|
Following hayne's suggestion, I echoed the PATH from "actions MakePFEFile", and it looks like the only directory in the path is /usr/local/bin.
Q: When the sh shell is launched from a GUI app, how does it build it's path? The path in /etc/profile is more complete but doesn't include /usr/local/bin: > PATH="/bin:/sbin:/usr/bin:/usr/sbin" Also, I don't have a .MacOSX subdirectory in my homedir; should this have been automatically created? (I'm fumbling my way around OS X, and haven't figured out all of the differences with other UNIX environments). Thanks, Jon |
shell startup files
Quote:
But what I have said above only applies to "login shells" - a shell started up outside the context of another shell. (e.g. the shell started by Project Builder). For shells started by invoking their name inside an already running shell (e.g. in Terminal when you type 'sh'), the environment is inherited from the parent shell. The tcsh shell reads /etc/csh.cshrc and ~/.tcshrc or ~/.cshrc But the Bourne shell (sh) does not read any files in this case unless you have the variable ENV set - in which case it reads from the file pointed to by that variable. Note: for debugging purposes, I recommend inserting an 'echo' command in each of the above named startup files so you can see when they get executed and in what order. E.g. "echo now executing /etc/profile" All of which leads to the question: Do you have a file ~/.profile and what is in it? I suspect there is a line setting the PATH to /usr/local/bin Quote:
|
No ".profile" in my home directory, just a .cshrc (which diesn't set the path, only my prompt and a few aliases).
Any other ideas? Thanks, Jon |
Create yourself a .login in your home directory. You can specify what you want your paths to be whenever a new xterm (not in Apple's X11 beta oddly)/Terminal is opened. I'd comment out your fink sourcing in your .tcshrc/.cshrc if you follow what I've got.
Mine looks like this: Code:
setenv PATH "/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin" |
Re: shell startup files
Quote:
Code:
$ echo $ENV |
which sh ?
Well, I don't know how your 'sh' in PB is getting its bad path.
One more thing you could do is to put in more debugging statements in the PB jam file to echo things like 'which sh' to tell you what shell you are using. But if PATH is /usr/local/bin as you have said, then presumably it is finding a 'sh' in that directory. ?? Is there a /usr/local/bin/sh ? There shouldn't be. |
ktrace
If you have exhausted all easier suggestions, here is one more idea. It is rather heavyweight, but you could try using 'ktrace' to look at exactly what PB is doing, especially what files it is reading.
You run 'ktrace' from the command-line, giving it the name of the executable you want to run - in this case: /Developer/Applications/Project\ Builder.app/Contents/MacOS/Project\ Builder It writes a file "ktrace.out" in the current directory. You read this file using 'kdump' - e.g. 'kdump | more' or 'kdump > some_file' Look for the files that are opened by PB - their contents will be listed as part of the output. But I don't know if ktrace will trace what is done by sub-processes like the 'sh' in this case. Maybe have a look at 'man ktrace' to see. |
Re: Project Builder path problem
Quote:
|
ktrace doesn't seem to be much help, as it seems to be inheriting my PATH from the terminal.
Launching Project Builder via GUI yields > ====================================================================== > [JHO] echo PATH: > /usr/local/bin > ====================================================================== > /bin/sh: mktemp: command not found > gcc3: cannot specify -o with -c or -S and multiple compilations > /bin/sh: rm: command not found > /bin/sh: rm: command not found while launching via a terminal window (w/ or w/out ktrace) works fine: > ====================================================================== > [JHO] echo PATH: > /bin:/sbin:/usr/bin:/usr/sbin:/usr/local/teTeX/bin/powerpc-apple-darwin-current:/usr/local/bin:/usr/local/bin > ====================================================================== |
Re: Re: Project Builder path problem
Quote:
But that doesn't say anything about the PATH - I think backticks may be hardcoded to run /bin/sh. And mktemp is in /usr/bin |
bash versus sh
Quote:
Evidently /bin/bash runs a different set of startup files (even though the executables /bin/sh & /bin/bash are identical - it looks at what name it is invoked with). Indeed 'ktrace /bin/bash' shows it trying to open the file ~/.bashrc. |
Re: bash versus sh
Quote:
|
[yellow != coder/scripter]
Err... I think I have a (the?) solution to this.. what don't you have the absolute paths in the code? You're getting errors on mktemp and rm because the command isn't found, but in the code it's not /usr/bin/mktemp and /bin/rm, it's just mktemp and rm. Wouldn't putting absolute paths take care of this? I know I always do in any shell scripts I am forced (at gun point) to write. |
| All times are GMT -5. The time now is 05:47 AM. |
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.
Site design © IDG Consumer & SMB; individuals retain copyright of their postings
but consent to the possible use of their material in other areas of IDG Consumer & SMB.