Hi all,
fyi, just in case others are interested in the Xcode build failure thread that are copystrings related. I sent a response, but I responded directly to Michael and didn't include the list. Anyway, here is my response. I haven't fixed the problem yet, but I at least understand where in copystrings is failing. -- Jim Date: July 14, 2008 9:11:16 PM PDT Subject: Re: Xcode 3.1 builds fails for OS X Cocoa apps (copystrings)
Hi Michael, On Jul 14, 2008, at 2:14 PM, Michael Rawdon wrote: Hi Jim - On Jul 13, 2008, at 2:41 PM, Jim Fridlund wrote: Hi all. I just joined the list in hope that someone can help me with my Xcode problem. I am using a MacBook Pro with Xcode 3.1 installed (I tried iphone_sdk_final.dmg and xcode31_2199_developerdvd.dmg). Previously, I had Xcode 3.1 beta versions for iPhone development. I am able to build for iPhone apps just fine, but I would also like to build Cocoa apps for OS X using Xcode.
As a simple example, I create a new project as a Cocoa application. When I click on 'Build and Go', I get the following errors from the build output:
[...]
copystrings is a script which invokes a tool named iconv, but it does so by looking for it via the user's PATH environment variable. We've gotten at least one report of it finding a different iconv in a different directory than the default one in /usr/bin, and that other copy doesn't work as Xcode expects. It's entirely possible that the PATH in your GUI environment is different from the one in your shell, and that's what's happening.
In that case, you have two alternatives:
1) You could hack your copy of copystrings to explicitly invoke /usr/bin/iconv, or 2) You could see if there's an extra copy of iconv lying around and remove it.
(This issue will be fixed in a future release of Xcode.)
Of course, this might not actually explain your issue, but it's my best guess!
I thought about that last night. I do have MacPorts installed since there are some commands in Unix that I just can't live without. I noticed that I had a version of iconv in /opt/local/bin. I thought this would certainly cause some unwanted side effects. So, I moved /opt/local -> /opt/local.ugh and tried building. It still failed the same way though.
Then, I started looking at the copystrings script. I don't speak ruby at the moment, but it looked similar enough to other scripts that I could figure out what it was trying to do or at least sprinkle enough debug to see how far it was getting in the copystrings script. What I learned was it was entering the rescue exception path in the following code (~line 88):
# ARGV now just contains the input files. We process each one in turn. for path in ARGV do # Read the file contents. begin f = open(path) fileContents = f.read() f.close() rescue puts "#{path}: #{$!.message[/[^-]*/]}" system('echo yyz >> /tmp/xxx') exit 1 end
copystrings is jumping in the rescue path and exits. It looks to be permission related? Why would it fail to open/read/close? This is pretty basic operation. The following command output is what is displayed in the Build Results window.
CopyStringsFile /Users/jim/Test/build/Debug/Test.app/Contents/Resources/English.lproj/InfoPlist.strings English.lproj/InfoPlist.strings mkdir /Users/jim/Test/build/Debug/Test.app/Contents/Resources/English.lproj cd /Users/jim/Test /Developer/Library/Xcode/Plug-ins/CoreBuildTasks.xcplugin/Contents/Resources/copystrings --validate --inputencoding UTF-16 --outputencoding UTF-16 English.lproj/InfoPlist.strings --outdir /Users/jim/Test/build/Debug/Test.app/Contents/Resources/English.lproj English.lproj/InfoPlist.strings: Insecure operation
-- Michael Rawdon Apple Inc., Cupertino CA
Thanks again! -- Jim
|