`open foo.xcodeproj` breaks environment.
| Originator: | jkerr | ||
| Number: | rdar://11345474 | Date Originated: | 30-Apr-2012 |
| Status: | Open | Resolved: | |
| Product: | Xcode | Product Version: | 4.3.2 |
| Classification: | Other Bug | Reproducible: | always |
Summary: Running from the command line `open foo.xcodeproj` opens the project, but breaks some environment settings so that it is inconsistent with opening via: double clicking the .xcodeproj, or "File >Open Recent" Steps to Reproduce: Create a new iPhone project. Build, notice it builds successfully. Open the build messages, click all messages, click on Precompile Project/Project-Prefix.pch, copy the command information to a text file: click_open_pch. Quit Xcode Go to command file and navigate to where your project lives. Execute `open Project.xcodeproj`. Build and notice that it fails. Again go to the build messages, click all messages, click on Precompile Project/Project-Prefix.pch, copy the command information to a text file: commandline_open_pch. run `opendiff click_open_pch commandline_open_pch` and notice the command that is run is different. The PATH variable is also different. Expected Results: Environment should be the same whether project is opened via click, or opened via `open` command. Actual Results: The environment differs. On my machine open via click generates the command: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -x objective-c-header <...snip> Open via `open` command gives: /usr/bin/gcc -x objective-c-header <...snip> Notes: I don't know if this will necessarily break on all configurations depending on where the users's /usr/bin/gcc points, but regardless, the precompile command should be the same either way. I don't know what other parts of the environment may be inconsistent since pch compilation is the first failure and the build stops there.
Comments
Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!