Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-23668] iOS: Hyperloop - Differential build not working

GitHub Issuen/a
TypeBug
PriorityHigh
StatusOpen
ResolutionUnresolved
Affected Version/sn/a
Fix Version/sn/a
ComponentsHyperloop, iOS, Tooling
Labelsn/a
ReporterChee Kiat Ng
AssigneeJan Vennemann
Created2016-07-21T08:24:43.000+0000
Updated2017-08-09T15:57:02.000+0000

Description

It looks like differential build is not working when hyperloop is used.

Steps to reproduce

1. Create a simple app with hyperloop enabled 2. appc run -p ios 3. change app.js 4. appc run -p ios

Expected Result

trace will show "Skipping Xcodebuild"

Actual Result

trace shows "invoking xcodebuild" " Forcing rebuild: Xcode project has changed since last build"

Comments

  1. Jan Vennemann 2016-07-28

    What's happening here is that before Hyperloop kicks in, there is a step during the build that triggers the creation of a new Xcode project (Not sure yet where exactly this happens). Hyperloop then changes the project and adds the required files. On subsequent builds this happens over and over again and Hyperloop always starts altering a fresh Xcode project, thus forcing a rebuild.
  2. Chee Kiat Ng 2016-07-28

    [~cbarber] any advice on this? [~jvennemann] I thought Hyperloop has a check to see if new metabase needs to be generated. If it determines that metabase generation can be skipped, can't we assume that we can skip hyperloop changing the Xcode project and adding required files?
  3. Chris Barber 2016-07-28

    If Hyperloop is going to modify the generated Xcode project, it should do it during the build.ios.xcodeproject hook.
  4. Jan Vennemann 2016-08-02

    Just for the record, here is a summary about my findings regarding this issue. Hyperloop only uses the build.ios.xcodeproject hook to store the Xcode project data. The actual changes to the project are made during the build.pre.build hook. So the normal Titanium iOS builder has no idea of the changes Hyperloop made and overwrites the Xcode project without any Hyperloop generated files included on the next build. I thought about changing the order when Hyperloop generates its metabase but it relies on the build.ios.copyResource hook to detect if any relevant files were required and only then triggers a metabase generation. And this hook happens after build.ios.xcodeproject so it would require some (major?) refactoring to the whole hyperloop metabase workflow. If at all viable (how do we get the js files before the copyResource hook?). Also our current strategy to decide if we need to invoke a build with xcode is quite trivial. Xcode project file changed? Rebuild! Assuming we can fix the differential build issue, another one would arise. If we use custom Swift or Objective-C code and would change something there, neither the sdk or hyperloop would trigger a rebuild simply because the file is already in the xcode project. => file monitor or something like that is needed.
  5. Chris Barber 2016-08-02

    So what changed? This used to work, albeit not great. Because Allow does not support differential builds, the iOS build was always recompiling, but I personally made the Hyperloop CLI plugin support differential builds. You may need to do your file operations during the build.ios.xcodeproject hook, which is not ideal. I don't want more file I/O that we need. If we're VERY careful, we could write the Xcode project later in the build, possibly after the resources have been copied, but we must call xcodebuild "clean" because we use schemes now and we don't nuke the derived data like we used to.
  6. Hans Knöchel 2017-03-14

    [~jvennemann] status on this? Didn't see this bug for a long time and it's scheduled for 6.1.0.
  7. Jan Vennemann 2017-03-14

    This is still happening. The CLI writes the Xcode project, then Hyperloop adds stuff which CLI isn't aware of. On the next build the CLI will replace the Xcode project again without any Hyperloop related changes, forcing constant rebuilds. I can spend time on this as soon as i got the Android AAR stuff sorted out.
  8. Chris Barber 2017-03-14

    Hyperloop should be making changes to the Xcode project during the build.ios.xcodeproject hook.

JSON Source