Azure-pipelines-tasks: sh macosx - cannot execute binary file

Created on 2 Nov 2016  路  3Comments  路  Source: microsoft/azure-pipelines-tasks

I have a build definition in Visual Studio Online which is integrated with MacInCloud, I'm encountering an issue regarding to 010_add_platform_class.js file permissions.

According to Microsoft's article I should run this command: chmod +x hooks/after_prepare/010_add_platform_class.js

Troubleshooting Tip: If you encounter a spawn EACCES error when building on a Mac or Linux, be sure all files in the hooks folder to have an "execute bit" set as this a requirement for Cordova. To resolve, add an execute bit to the files in source control or add the following using the Command Line task: chmod +x hooks/after_prepare/010_add_platform_class.js

Therefore I have the following build definition for iOS:

ios_builddefinition

but the build fails at the 2nd step (sh), as described in below screen-shot:
Option with chmod +x
shell_error_x

Option with chmod 777
shell_error_777

I have checked the OS (MAC OS capabilities) and it has the sh tool in order to run that command:
mac-capabilities

But it doesn't works / passes because of the 126 error (which supposes to mean: not an executable)

Please note that running this command on local MAC it works.

  1. What would be the proper solution for the permission error of: hooks/after_prepare/010_add_platform_class.js ?

  2. How I'd be able to solve the 126 error which the second step is returning to me?

All 3 comments

Have you tried command line task:
Tool: chmod
Arguments: +ux ...

@bryanmacfarlane : thanks, that solved.

Bryan's answer might possibly have once been correct,but not when the installer creates a symlink:

lrwxr-xr-x 1 robbiemu admin 55 Apr 30 11:12 /usr/local/bin/vsts-npm-auth -> ../lib/node_modules/vsts-npm-auth/bin/vsts-npm-auth.exe

and chmod'ing the 'exe' does not work either (in case that is not obvious)

Was this page helpful?
0 / 5 - 0 ratings