[TIMOB-25576] Ensuring usage of macros bundled core utilities and shells when adding to iOS buildPhases
| GitHub Issue | n/a |
|---|---|
| Type | Bug |
| Priority | Critical |
| Status | Closed |
| Resolution | Fixed |
| Resolution Date | 2017-12-15T21:08:06.000+0000 |
| Affected Version/s | Release 5.5.1, Release 6.3.0 |
| Fix Version/s | Release 7.0.2 |
| Components | iOS |
| Labels | n/a |
| Reporter | Richard Lustemberg |
| Assignee | Hans Knöchel |
| Created | 2017-11-28T17:39:55.000+0000 |
| Updated | 2018-01-20T11:14:25.000+0000 |
Description
Either running from CLI ('appc run -p ios -T dist-appstore') or from Studio, building an xcarchive using the build scripts delivers a sort of corrupted build.
The problem is that all assets are copied from the ArchiveStaging build directory into a directory of the same name in the xcarchive directory.
{noformat}
DEBUG] Copying /Users/richard/Code/Inzdr/inzdr_app/src/Inzdr/build/iphone/iNZDR.xcarchive/Products/Applications/iNZDR.app/ArchiveStaging/progress => /Users/richard/Library/Developer/Xcode/Archives/2017-11-28/iNZDR 2017-11-28 18-02-52.xcarchive/Products/
{noformat}
As a result all the assets are copied to the incorrect directory , 'ArchiveStaging' instead of the root of the xcarchive directory.
The problem only happens on AppStore or Ad Hoc builds, but not on device builds. The computer in question has a relatively recent clean installation of High Sierra.
It looks like the build phase 'Copy resources to archive' is not executed. It should run
cp -rf "$PROJECT_DIR/ArchiveStaging"/ "$TARGET_BUILD_DIR/$PRODUCT_NAME.app/"but it doesn't seem to be executed.I found the cause. I had the homebrew package 'coreutils' installed, which has a different version of cp, which will copy the whole directory recursively , including itself. The macos bundled version has a different behaviour, which is copying the directory contents recursively , but not itself. Shall I send a pr? Modifying
//line 3149 of _build.js xobjs.PBXShellScriptBuildPhase[buildPhaseUuid] = { isa: 'PBXShellScriptBuildPhase', buildActionMask: 2147483647, files: [], inputPaths: [], name: '"' + name + '"', outputPaths: [], runOnlyForDeploymentPostprocessing: 0, shellPath: '/bin/sh', shellScript: '"cp -rf \\"$PROJECT_DIR/ArchiveStaging\\"/ \\"$TARGET_BUILD_DIR/$PRODUCT_NAME.app/\\""', showEnvVarsInLog: 0 }; } // to xobjs.PBXShellScriptBuildPhase[buildPhaseUuid] = { isa: 'PBXShellScriptBuildPhase', buildActionMask: 2147483647, files: [], inputPaths: [], name: '"' + name + '"', outputPaths: [], runOnlyForDeploymentPostprocessing: 0, shellPath: '/bin/sh', shellScript: '"/bin/cp -rf \\"$PROJECT_DIR/ArchiveStaging\\"/ \\"$TARGET_BUILD_DIR/$PRODUCT_NAME.app/\\""', showEnvVarsInLog: 0 };Hello, Please create a PR and assign in here. Our engineers will look into it. Thanks.
Here is the PR, [https://github.com/appcelerator/titanium_mobile/pull/9639](https://github.com/appcelerator/titanium_mobile/pull/9639)
Backport for 7_0_X: https://github.com/appcelerator/titanium_mobile/pull/9663
[~jvennemann] Can you please provide guidance on how to validate the fix?
FR passed.