Topic
6 replies Latest Post - ‏2012-10-09T07:23:08Z by IdanAdar
SystemAdmin
SystemAdmin
570 Posts
ACCEPTED ANSWER

Pinned topic [Solved]error "buildtime.sh: Permission denied"

‏2012-03-29T20:24:24Z |
Hi,

Running a Worklight app from within Xcode (so that I can run it in
the iOS simulator or on an iOS device), I'm getting this error:

Running a custom build phase script: buildtime.sh
/Users/haible/Library/Developer/Xcode/DerivedData/MyProjectMyAppIpad-esxuznsvaaxiytezluyjbanoligf/Build/Intermediates/MyProjectMyAppIpad.build/Debug-iphonesimulator/MyProjectMyAppIpad.build/Script-427B829D1393724500F223DC.sh: line 7: /Users/haible/worklight/simple-workspace/MyProject/apps/MyApp/ipad/native/buildtime.sh: Permission denied
DONE with script: buildtime.sh (exitStatus=126)\\n\\n

How to reproduce:
1) Create a working app using Worklight Studio on a Linux machine.
Configure it for the environments 'android' and 'ipad'.
Build and Deploy it.
2) Export the Worklight project, using "File > Export... > General > Archive File".
3) Copy the resulting zip file to the Mac machine.
4) On the Mac machine, in Worklight Studio: Import the worklight project, using "File > Import... > General > Existing Projects into Workspace".
5) Build and deploy the app.
6) Right-click on the 'ipad' folder of the app, select "Run As... > Xcode project".
7) In Xcode, click the "Run" button.

What happened is:
  • Step 1 creates, in particular, the file MyProject/apps/MyApp/ipad/native/buildtime.sh, with permissions r-xr--r--, that is, executable for the owner. (The same would also happen for permission r-xr-xr-x.)
  • In step 2, the zip file contains the MyProject/apps/MyApp/ipad/native/buildtime.sh, but without execute permissions. Although zip files can contain permissions when created by the Unix 'zip' program, the "Export" wizard apparently drops the execute permissions.
  • After step 4, on the Mac, the file has permissions rw-r--r-- or rw-------, depending on the umask. It is not executable.
  • Step 5 doesn't change that.
  • In step 7, the Xcode build attempts to execute the file buildtime.sh, but this fails because the permissions don't contain the execute bit.

The workaround is to manually do a "chmod a+x" of the buildtime.sh file.

But it would be nice if the Worklight build (step 5) would do this.

--slowhand
  • IdanAdar
    IdanAdar
    288 Posts
    ACCEPTED ANSWER

    Re: [Solved]error "buildtime.sh: Permission denied"

    ‏2012-03-29T22:06:25Z  in response to SystemAdmin
    That is quite an old bug. It is fixed.
    Can you tell me more about your particular setup, such as which Worklight Server and Studio version you have installed on the machines?
  • SystemAdmin
    SystemAdmin
    570 Posts
    ACCEPTED ANSWER

    Re: [Solved]error "buildtime.sh: Permission denied"

    ‏2012-03-29T22:16:06Z  in response to SystemAdmin
    > It is fixed.

    Thanks, good to hear that!

    +> Can you tell me more about your particular setup, such as
    > which Worklight Server and Studio version you have installed on the machines?+

    I'm using Version 4.2.2 of the server and studio on both machines (Linux and Mac).
    The Eclipse version is Eclipse 3.7.1 JEE on Linux, Eclipse 3.7.2 JEE on Mac OS X 10.7.

    --slowhand
  • IdanAdar
    IdanAdar
    288 Posts
    ACCEPTED ANSWER

    Re: [Solved]error "buildtime.sh: Permission denied"

    ‏2012-03-30T15:55:02Z  in response to SystemAdmin
    So maybe it is not fixed ... if you say it is happening to you with Worklight Studio 4.2.2(.1283).
    Could be it is happening with Linux only; with Windows and Mac it does not (then again, shouldn't happen in Linux if it's not happening in Mac).

    1. Note that Linux is not certified for development (production only)
    2. I will verify this on Sunday regardless
  • IdanAdar
    IdanAdar
    288 Posts
    ACCEPTED ANSWER

    Re: [Solved]error "buildtime.sh: Permission denied"

    ‏2012-04-01T12:21:23Z  in response to SystemAdmin
    Okay, this seems to be a bug in build 1283. It will happen in Mac as well.
    New project >> application >> iOS environment >> Run Aas >> Xcode project >> Run >> Build failed

    The buildtime.sh script is missing the Execute permission.
    Anyway, fixed in later builds indeed.
    • DG1M_Harry_Ho
      DG1M_Harry_Ho
      1 Post
      ACCEPTED ANSWER

      Re: [Solved]error "buildtime.sh: Permission denied"

      ‏2012-10-05T20:27:09Z  in response to IdanAdar
      I dont mean to bring up a an old thread, but I am actually having this issue on a Mac running Mountain Lion. I am using the latest indigo build, updated version of xcode, and latest version of IBM Worklight developers plugin (5.0.3). I am getting the buildtime.sh permission denied error on run. I reinstalled everything today from scratch and am still getting issues.
      • IdanAdar
        IdanAdar
        288 Posts
        ACCEPTED ANSWER

        Re: [Solved]error "buildtime.sh: Permission denied"

        ‏2012-10-09T07:23:08Z  in response to DG1M_Harry_Ho
        Please open a new thread with complete reproduction steps in the Worklight 5 development forum, so that we could continue this there.

        Idan Adar
        QA Engineer
        IBM Worklight Mobile Platform