microsoft / vsts-cordova-tasks

Streamline CI setup for your Apache Cordova, PhoneGap, Ionic, or Cordova CLI compatible app using a set of useful pre-defined build steps for VS Team Services or TFS
http://go.microsoft.com/fwlink/?LinkID=691188
Other
25 stars 27 forks source link

Mac agent - issue with xcode-task-utils.js:45:31 #79

Open andreasbotsikas opened 7 years ago

andreasbotsikas commented 7 years ago

Hi team,

I have installed vsts agent on macOs

$ sw_vers 
ProductName:    Mac OS X
ProductVersion: 10.12.6
BuildVersion:   16G29

$ node -v
v8.1.3

I am trying to build a Cordova application by defining the dev cert and the provision profile on the task level.

I got the following error:

2017-10-27T05:51:47.4357040Z TypeError: "file" argument must be a non-empty string
2017-10-27T05:51:47.4377320Z     at normalizeSpawnArguments (child_process.js:380:11)
2017-10-27T05:51:47.4396480Z     at spawnSync (child_process.js:507:38)
2017-10-27T05:51:47.4417520Z     at /Users/user/vstsagent/_work/_tasks/CordovaBuild_70e94267-15dc-434d-8973-023d766825d7/1.3.11/lib/xcode-task-utils.js:47:31
2017-10-27T05:51:47.4440720Z     at _fulfilled (/Users/user/vstsagent/_work/_tasks/CordovaBuild_70e94267-15dc-434d-8973-023d766825d7/1.3.11/node_modules/q/q.js:854:54)
2017-10-27T05:51:47.4464210Z     at self.promiseDispatch.done (/Users/user/vstsagent/_work/_tasks/CordovaBuild_70e94267-15dc-434d-8973-023d766825d7/1.3.11/node_modules/q/q.js:883:30)
2017-10-27T05:51:47.4487720Z     at Promise.promise.promiseDispatch (/Users/user/vstsagent/_work/_tasks/CordovaBuild_70e94267-15dc-434d-8973-023d766825d7/1.3.11/node_modules/q/q.js:816:13)
2017-10-27T05:51:47.4511190Z     at /Users/user/vstsagent/_work/_tasks/CordovaBuild_70e94267-15dc-434d-8973-023d766825d7/1.3.11/node_modules/q/q.js:877:14
2017-10-27T05:51:47.4532530Z     at runSingle (/Users/user/vstsagent/_work/_tasks/CordovaBuild_70e94267-15dc-434d-8973-023d766825d7/1.3.11/node_modules/q/q.js:137:13)
2017-10-27T05:51:47.4554160Z     at flush (/Users/user/vstsagent/_work/_tasks/CordovaBuild_70e94267-15dc-434d-8973-023d766825d7/1.3.11/node_modules/q/q.js:125:13)
2017-10-27T05:51:47.4572500Z     at _combinedTickCallback (internal/process/next_tick.js:95:7)

I added console log in xcode-task-utils.js to observe the createKeychain variable which should have been a string pointing to "/bin/bash" and I noticed that it is an object

2017-10-27T05:40:16.5173330Z { [String: '/bin/bash']
2017-10-27T05:40:16.5191890Z   stdout: '/bin/bash',
2017-10-27T05:40:16.5210530Z   stderr: null,
2017-10-27T05:40:16.5227300Z   code: 0,
2017-10-27T05:40:16.5244320Z   cat: [Function: bound ],
2017-10-27T05:40:16.5261770Z   exec: [Function: bound ],
2017-10-27T05:40:16.5279030Z   grep: [Function: bound ],
2017-10-27T05:40:16.5298050Z   head: [Function: bound ],
2017-10-27T05:40:16.5316760Z   sed: [Function: bound ],
2017-10-27T05:40:16.5333810Z   sort: [Function: bound ],
2017-10-27T05:40:16.5350420Z   tail: [Function: bound ],
2017-10-27T05:40:16.5367270Z   to: [Function: bound ],
2017-10-27T05:40:16.5383490Z   toEnd: [Function: bound ],
2017-10-27T05:40:16.5399830Z   uniq: [Function: bound ] }

In order to make it work I had to modify line 45 to:

            var spawnResult = spawn(createKeychain.stdout, createKeychainArgs, { stdio: "inherit" });

Have you seen this issue before? The version of shelljs is 0.7.7 in the node_modules folder.

chazguerrero commented 6 years ago

I get the same issue running the TACO Cordova Build Task when specifying node 8.x or node 9.x. I have to keep the project on node 7.x until this is fixed. Anyone get around this issue?

MrRobWad commented 6 years ago

@chazguerrero I filed an issue at https://github.com/Microsoft/cordova-plugin-vs-taco-support/issues/3 and was able to bypass the issue by removing the cordova-plugin-vs-taco-support plugin (auto installed by taco team build) prior to each build.

Dimigergo commented 6 years ago

I have the same issue, any solution?

drewgillies commented 6 years ago

One issue to check here is the Cordova version--our only supported version (in Visual Studio and by extension vsts-cordova-tasks) is 6.3.1, along with the versions of node etc that come in the box with our installation. Is this a 6.3.1 (+ standard other versions) scenario?