Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-13372] Build error: /bin/sh: bad interpreter: Operation not permitted problem

GitHub Issuen/a
TypeBug
PriorityCritical
StatusClosed
ResolutionWon't Fix
Resolution Date2013-07-30T21:33:36.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsTooling
Labelsbuild, defect, ios, simulator
ReporterSimon Giles
AssigneeChris Barber
Created2013-02-20T02:41:03.000+0000
Updated2017-03-22T17:24:04.000+0000

Description

Project which used to build just fine refuses to build. Brand new sample project also refuses to build. iPhone simulator is the build target. The error is "/bin/sh: bad interpreter: Operation not permitted" here are the last few entries from the build log: [TRACE] : setenv YACC yacc [TRACE] : /bin/sh -c /Volumes/Source/Demo/build/iphone/build/Demo.build/Debug-iphonesimulator/Demo.build/Script-241EAF36118E30260081A5BE.sh [TRACE] : /bin/sh: /Volumes/Source/Demo/build/iphone/build/Demo.build/Debug-iphonesimulator/Demo.build/Script-241EAF36118E30260081A5BE.sh: /bin/sh: bad interpreter: Operation not permitted [TRACE] : Command /bin/sh failed with exit code 126 [ERROR] : ** BUILD FAILED ** [ERROR] : The following build commands failed: [ERROR] : PhaseScriptExecution Pre-Compile build/Demo.build/Debug-iphonesimulator/Demo.build/Script-241EAF36118E30260081A5BE.sh [ERROR] : (1 failure) (Searching the web indicated that this might be a problem with the com.apple.quarantine attribute, but I have checked and there are no cases of that attribute being anywhere - ran xattr to remove them regardless with no change in result) If I manually run the build sh script from terminal with the following command line it gives the error: /bin/sh -c /Volumes/Source/Demo/build/iphone/build/Demo.build/Debug-iphonesimulator/Demo.build/Script-241EAF36118E30260081A5BE.sh But if instead I run it without the -c it builds just fine. e.g. /bin/sh /Volumes/Source/Demo/build/iphone/build/Demo.build/Debug-iphonesimulator/Demo.build/Script-241EAF36118E30260081A5BE.sh

Comments

  1. Carter Lathrop 2013-02-21

    Is this problem happening with just iOS simulator when you try to build? As in can you build to device? Can you get any projects to run on the simulator or is it just these two? Have you tried reinstalling xCode to see if the problem is there? Can you provide the sample case you used so that I may test for myself and see if I can reproduce? Thank you Carter
  2. Carter Lathrop 2013-02-21

    Did this happen after you upgraded to 3.0.2? I had a similar issue actually. Try deleting the project from your workspace (in studio) and re-importing it. Let me know of the results.
  3. Chris Barber 2013-02-21

    @Simon, you need to make sure you have "/bin" in your PATH.
  4. Simon Giles 2013-02-22

    Sorry for the delay in responding - busy week. @Chris - /bin is in the path. Also, the full /bin/sh path appears to be explicit in the command - it was when I entered the commands in the two examples cases above in terminal. My setup is relatively vanilla - the full path from terminal (echo $PATH) is: /usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/git/bin @Carter No it happened prior to upgrading to 3.0.2. I tried deleting the workspace and creating a brand new one with a brand new default project, and it still happens. I have done a little more investigation and it appears to be related to the volume. If I create a workspace on a new volume I am able to create a new project (on the new volume) and compile it successfully. No projects created on the problem volume appear to compile. I haven't tried building for the device instead of the simulator yet, I'll reply with the results when I've had a chance to do so. On the "broken" volume I've tried chmod 775 and xattr -d com.apple.quarantine for the entire volume with no change. I am reluctant to uninstall xcode, and as it builds in xcode if I load the project manually, and via terminal if I omit the -c, and via titanium if the project is on a different volume, I suspect the problem is elsewhere. Thanks for all your suggestions.
  5. Simon Giles 2013-03-15

    ok I've done a lot more testing with this. It appears to be triggered by copying a file in which has the quarantine attribute and then building the project. After the build the entire volume is somehow marked and the build script fails for any project on the volume. I can't discern anything in particular about the volume where that attribute might be being applied (to the entire volume) but my OSX-FileSystem-Fu is still pretty novice. I'd say close this issue, as it can be avoided by being rigorous about not placing quarantine marked files in a project. Though it's very annoying, and reverting to an old image of the volume is the only way I've discovered so far to fix the problem.
  6. Chris Barber 2013-07-30

    Resolving as won't fix (for now) since Simon has identified a workaround and only affects users that have quarantined files in their project directory. This may only be a problem with users running Mac OS X Lion. I'm thinking this might be outside the scope of Titanium. Besides, I'm scared to test this on my laptop. :)
  7. Lee Morris 2017-03-22

    Closing ticket as the issue will not fix and with reference to the above comments.

JSON Source