[TIMOB-23956] Hyperloop: Improve error handling for non-default Xcode installations
GitHub Issue | n/a |
---|---|
Type | Improvement |
Priority | Medium |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2017-09-29T12:22:22.000+0000 |
Affected Version/s | hyperloop 1.2.7 |
Fix Version/s | Hyperloop 2.2.0 |
Components | Hyperloop, Tooling |
Labels | n/a |
Reporter | Jan Vennemann |
Assignee | Jan Vennemann |
Created | 2016-09-28T07:34:14.000+0000 |
Updated | 2017-10-06T23:48:24.000+0000 |
Description
Currently we solely rely on the user having the correct Xcode Version under
/Applications/Xcode.app
as stated in the [Enabling Hyperloop](https://wiki.appcelerator.org/display/guides2/Enabling+Hyperloop). This can easily lead to unexpected behaviour when different Xcode versions are installed. We should evaluate if it is possible to detected the libclang version that is loaded and then require a minimum version to avoid wrong metabase generation. Also when the user does not have Xcode installed in the above default directory the metebase generation will fail due to the hardcoded rpath. We should catch this error and tell the user what to do to fix it.
I thought the Hyperloop CLI plugin was getting the correct path from
builder.xcodeEnv.path
?Yes it is, but the runpath to the libclang library is hardcorded at compile time in the metabase executable. So if anyone has a non-default xcode install location the metabase generation will fail or use the wrong library when different xcode versions are installed.
Possible approach to allow different Xcode locations: We might be able to check the result of
xcode-select -p
, compare the path with the one in the binary withotool -l
and then fix it usinginstall_name_tool
. A version check inside the metabase binary would be required then to see if we can use the libclang version of the currently selected Xcode.