Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-25576] Ensuring usage of macros bundled core utilities and shells when adding to iOS buildPhases

GitHub Issuen/a
TypeBug
PriorityCritical
StatusClosed
ResolutionFixed
Resolution Date2017-12-15T21:08:06.000+0000
Affected Version/sRelease 5.5.1, Release 6.3.0
Fix Version/sRelease 7.0.2
ComponentsiOS
Labelsn/a
ReporterRichard Lustemberg
AssigneeHans Knöchel
Created2017-11-28T17:39:55.000+0000
Updated2018-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.

Comments

  1. Richard Lustemberg 2017-11-29

    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.
  2. Richard Lustemberg 2017-11-29

    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
       		};
       
  3. Sharif AbuDarda 2017-11-29

    Hello, Please create a PR and assign in here. Our engineers will look into it. Thanks.
  4. Richard Lustemberg 2017-11-30

    Here is the PR, [https://github.com/appcelerator/titanium_mobile/pull/9639](https://github.com/appcelerator/titanium_mobile/pull/9639)
  5. Hans Knöchel 2017-12-07

    Backport for 7_0_X: https://github.com/appcelerator/titanium_mobile/pull/9663
  6. Abir Mukherjee 2017-12-14

    [~jvennemann] Can you please provide guidance on how to validate the fix?
  7. Abir Mukherjee 2017-12-15

    FR passed.

JSON Source