sukima / ti_coffee_plugin

A build-time CoffeeScript compiler plugin for Titanium build scripts - Reborn
http://sukima.github.io/ti_coffee_plugin
Other
1 stars 0 forks source link

Plugin fails in build, cli works fine #7

Open simonrand opened 10 years ago

simonrand commented 10 years ago

Hi,

I've been struggling with this one for a while today, the plugin works when I use the cli version (by running node plugins/ti.coffee/cli.js . from the project root), all .coffee files are checked and built (or not) as expected.

I can't get this working with in the build process however. The hooks are correctly loaded:

...
[DEBUG] :  Detecting plugins in <project-dir>/plugins
[DEBUG] :  Detected plugin: ti.coffee @ <project-dir>/plugins/ti.coffee
[DEBUG] :  Detecting plugins in /Users/<user>/Library/Application Support/Titanium/plugins
[DEBUG] :  Looking for Titanium plugin id=ti.coffee version=latest
[INFO] :   Found Titanium plugin id=ti.coffee version=latest 
[INFO] :   [ti.coffee] Loaded plugin
[DEBUG] :  [ti.coffee] Added build.pre.compile hook
[DEBUG] :  [ti.coffee] Added clean.post hook
[DEBUG] :  Loaded plugin hooks:
[DEBUG] :  /Users/<user>/.nvm/v0.10.24/lib/node_modules/titanium/hooks/tisdk3fixes.js
[DEBUG] :  /Users/<user>/Library/Application Support/Titanium/mobilesdk/osx/3.2.0.GA/android/cli/hooks/package.js
[DEBUG] :  /Users/<user>/Library/Application Support/Titanium/mobilesdk/osx/3.2.0.GA/android/cli/hooks/run.js
[DEBUG] :  <project-dir>/plugins/ti.coffee/hooks/plugin.js`
...

However the build simply then exits, rather unhelpfully:

...
[INFO] :   Forcing rebuild: <project-dir>/build/android/build-manifest.json does not exist
[ERROR] :  Project failed to build after 100ms

[ERROR] Application Installer abnormal process termination. Process exit value was 1

Taking ti.coffee out of the build process allows the app to build successfully.

I've been trying to figure this out (need to upgrade a Ti 2 app to Ti 3), the only clue that I have is that the findCoffeeFiles function runs, but waitingForCoffeeFileInstances never fulfils it's promise (or fail, or fin for that matter).

Just to mention again, the cli version works correctly.

I'll keep digging here, but any help would be much appreciated.

sukima commented 10 years ago

Curious, There were many changes in the titanium CLI hook system over the past few versions. I wonder if an upgrade of the titanium build tool would help. I use version 3.1.2 right now.

I vaguely remember that there was some odd interaction with titanium at one point and I think a fix was to upgrade to a newer SDK but I'm not 100% sure. Let me know how that goes. If not maybe we could hook up and pair on it at some point.

simonrand commented 10 years ago

Ah, I should have mentioned I'm using SDK 3.2, so there may may be something there, we need 3.2 for one particular fix in that release, but I'll try 3.1.2 and see if that might give more to work with.

sukima commented 10 years ago

Yes, You reminded me. This happened on 3.2 and my projects are all 3.1.3.

This is most definitely a bug. I will leave this issue open til I can get to a point of upgrading a project to 3.2 and investigate the problem.

simonrand commented 10 years ago

Have been travelling the last couple of days so haven't been able to look at this properly, but as suspected 3.1.X works fine.

Looks like there's been some relatively major changes to the build system in 3.2.0 (for Android at least - https://github.com/appcelerator/titanium_mobile/commit/a17e4df9ce774b068cf467a7e0b026b5eb9645d7), but I'm struggling to find reports of other problems.. Will try and investigate further myself..

sukima commented 10 years ago

The changes are so significant there is no way of following them. Take a look at this one commit: https://github.com/appcelerator/titanium/commit/86abaf3a11bcce52c84c3bd1ae9a98ed4d0d959b And there are many like it. The commits are not atomic so I can't reliably use git bisect to determine the root cause for the failure.

I need some other way of diagnosing the problem and it will take a lot longer then I had thought.

simonrand commented 10 years ago

Yes, it's all a bit more difficult than it should be, will keep trying from my side also.