Titanium JIRA Archive
Appcelerator Daemon (DAEMON)

[DAEMON-144] iOS Plugin: Pointing xcode-select to a different xcode install causes the daemon to become unstable

GitHub Issuen/a
TypeBug
PriorityCritical
StatusResolved
ResolutionFixed
Resolution Date2017-11-17T15:58:28.000+0000
Affected Version/sAppc Daemon 1.0.0
Fix Version/sAppc Daemon 1.0.0
Componentsappcd-plugin-ios, ioslib
Labelsn/a
ReporterEwan Harris
AssigneeChris Barber
Created2017-11-15T11:52:48.000+0000
Updated2017-11-17T15:58:28.000+0000

Description

Description

I have two Xcodes on my machine one at /Applications and the other at /Users/eharris/Desktop/Xcode.app/Contents/Developer, pointing xcode-select at the version in Desktop causes the daemon to become unstable (spawning process multiple times, freezes etc)

Steps to repro

Run sudo xcode-select -s <new path>, then appcd start && appcd exec /ios/latest/info

Attachments

FileDateSize
dump.txt2017-11-15T21:15:04.000+000061036
output.txt2017-11-15T21:15:01.000+0000463351

Comments

  1. Ewan Harris 2017-11-15

    [~cbarber] Attached dump.txt which is an appc dump, and output which is an appcd logcat during reproducing this
  2. Ewan Harris 2017-11-16

    Adding some more information for fun. I have 3 xcodes on my system - 8.3.2:8E2002 located in Desktop/Xcode8.3.2 - 8.3.3:8E3004b located in Applications/Xcode (Daemon will always find this, so it is our constant variable) - 9.0.1:9A1004 located in Desktop/Xcode If I set xcode-select to 9.0.1:9A1004 then I get this problem. If I set xcode-select to 8.3.2:8E2002 then this doesn't happen, trying to download some more 9.X xcodes to test Edit: -Download 9.1:9B55, setting xcode-select to that causes no issues.- Ignore, xcode eulas... Awaiting my xcode beta 9.2 beta to unzip It looks like this issue lies with having an xcode 8 and 9 install detected at the same time. The code below (run with node test.js && diff before2 after2 shows that the xcode 8 instance is modified when it is passed into the getSimulators call
       const ioslib = require('./dist');
       const fs = require('fs');
       
       const xcode = new ioslib.xcode.Xcode('/Users/eharris/Downloads/Xcode-beta.app/Contents/Developer/');
       const xcode2 = new ioslib.xcode.Xcode('/Applications/Xcode.app/');
       
       fs.writeFile('before1', JSON.stringify(xcode, null, 2), () => { });
       fs.writeFile('before2', JSON.stringify(xcode2, null, 2), () => { });
       // 8.3.2 /Users/eharris/Desktop/Xcode8.3.2/Contents/Developer/
       // 8.3.3:8E3004b /Applications/Xcode.app/
       // 9.0.1:9A1004 /Users/eharris/Desktop/Xcode/Contents/Developer/
       // 9.1:9B55 /Users/eharris/Downloads/Xcode.app/Contents/Developer/
       // 9.2:9C34b /Users/eharris/Downloads/Xcode-beta.app/Contents/Developer/
       ioslib.simulator.getSimulators({  '9.2:9C34b': xcode, '8.3.3:8E3004b': xcode2 })
       	.then(foo => {
       		fs.writeFile('after1', JSON.stringify(xcode, null, 2), () => { });
       		fs.writeFile('after2', JSON.stringify(xcode2, null, 2), () => { });
       		// console.log(foo);
       		return ioslib.simulator.getSimulators({ '9.2:9C34b': xcode, '8.3.3:8E3004b': xcode2 })
       			.then(foo => {
       				console.log(foo);
       			});
       	})
       
  3. Ewan Harris 2017-11-16

    [~cbarber] I was able to stop this issue with the following commit https://github.com/ewanharris/ioslib/commit/5c7a8e105677b904bee25643d098aad9f73c9953 which really just proves what we knew and is disguising the real bug where the xcode 8 instance is being modified
  4. Ewan Harris 2017-11-17

    Latest changes to ioslib and appc-daemon fix this issue for me. Would like to test a successful cli build before closing out

JSON Source