Development mode automatic recompile of source... the rules?

57 views
Skip to first unread message

Emacs the Viking

unread,
Jan 11, 2015, 5:46:29 AM1/11/15
to chica...@googlegroups.com
Whilst investing a route related problem I have noticed that one error I had:

 Unhandled Error: error:undef. Stacktrace: [{utils,no_auth,[[

Seems to be caused by the fact that files "src/controller" seem to be ercompiled on a save from Emacs but when I changed the code in a file in the "src/lib" folder, the change was not detected and so my new function was not present.

Can somebody state clearly what folders are subject to auto-rebuild of their content?

Thanks.

Sean.


emacstheviking

unread,
Jan 11, 2015, 5:54:19 AM1/11/15
to chica...@googlegroups.com
Even odder: I have two controller files, both in "src/controller" and one of them does not recompile when I make changes and one of them does.

Sigh. I hate stuff like this!

If I add three blank lines to the end of "smsengine_inbound_controller.erl" nothing happens but adding three blank lines to "smsengine_web_controller.erl" gives:

    Reloading smsengine_web_controller ... fail: nofile.

What gives? Ironically this is the *same* controller that doesn't work in "deploy" mode.


:(

Stopping because it is Sunday and I don't want the stress this early in the day!


--
You received this message because you are subscribed to the Google Groups "ChicagoBoss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chicagoboss...@googlegroups.com.
Visit this group at http://groups.google.com/group/chicagoboss.
To view this discussion on the web visit https://groups.google.com/d/msgid/chicagoboss/903de0c3-914a-4a2f-83ad-413087c6fdb2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Kai Janson

unread,
Jan 11, 2015, 2:18:25 PM1/11/15
to chica...@googlegroups.com
The nofile message means it's in development mode and just reloading the code.  Confusing, yes, but it is working.  Sort of.  I recall that at times it doesn't load the changed code.

But the main issue is that it is in development mode and not production.

--Kai

Sent from my non-google-device

Kai Janson

unread,
Jan 11, 2015, 2:19:30 PM1/11/15
to chica...@googlegroups.com
Also, show us the first few lines of the controller, please.  That will make troubleshooting a whole lot easier. 

Sent from my non-google-device

On Jan 11, 2015, at 05:53, emacstheviking <obj...@gmail.com> wrote:

Emacs the Viking

unread,
Jan 11, 2015, 4:26:22 PM1/11/15
to chica...@googlegroups.com
Ironically it seems to be consistently rebuilding both but only logging to the console...perhaps there is something up with lager configuration? Here are the first few lines of both controllers:

    -module(smsengine_inbound_controller, [Req]).
    -compile(export_all).
and:
    -module(smsengine_web_controller, [Req]).
    -compile(export_all).

I have spent more time digging around the boss source code to no avail. I even ran "observer:start()" and in development and deploy modes, the number of boss routes was the same (three) and looked to be correct.

Kai Janson

unread,
Jan 11, 2015, 4:37:54 PM1/11/15
to chica...@googlegroups.com
I just re-read your issues; the recompiling works ... as long as you don't add new functions.
If you perform a code change on ANYTHING existing, it works.

Controllers:
There is actually a ticket open to fix this very annoying bug.  I troubleshot this even with Evan and it's a pesky error.  I hope that someone in the core team fixes this very soon.
Elixir is able to recompile and pick up the newly added function(s), so it is not a short coming of the Erlang VM itself, it's ChicagoBoss dropping the ball somewhere in the modified compiler-chain(s).

Other code directories (lib and others):
The reloader doesn't pickup added functions up as well (see above).
Adding new modules works, but again, newly added functions are skipped/ignored.

Also, I think I had seen that you had referred to one of the controllers just by _web_controller and not smsengine_web:* ; if that's the case, that would be a user error.  That could also explain why it does not work in either mode, development as well as production.

Cheers,

--Kai

Sent from my non-google-device

Emacs the Viking

unread,
Jan 11, 2015, 4:45:05 PM1/11/15
to chica...@googlegroups.com


On Sunday, 11 January 2015 21:37:54 UTC, Kai Janson wrote:
I just re-read your issues; the recompiling works ... as long as you don't add new functions.
If you perform a code change on ANYTHING existing, it works.

Well, adding new functions is kind of what development mode is all about isn't it!

 

Controllers:
There is actually a ticket open to fix this very annoying bug.  I troubleshot this even with Evan and it's a pesky error.  I hope that someone in the core team fixes this very soon.
Elixir is able to recompile and pick up the newly added function(s), so it is not a short coming of the Erlang VM itself, it's ChicagoBoss dropping the ball somewhere in the modified compiler-chain(s).

Bummer.

 
Other code directories (lib and others):
The reloader doesn't pickup added functions up as well (see above).
Adding new modules works, but again, newly added functions are skipped/ignored.

Why is it apparently so complicated to just reload a changed file? I am also finding it hard to create debuggable BEAM files too. I think I may end up porting to yaws at this rate despite the great vibe CB ives me. :(



 
Also, I think I had seen that you had referred to one of the controllers just by _web_controller and not smsengine_web:* ; if that's the case, that would be a user error.  That could also explain why it does not work in either mode, development as well as production.


I spotted that and fixed it shortly after I posted but the problem persists.

 

Kai Janson

unread,
Jan 11, 2015, 4:49:33 PM1/11/15
to chica...@googlegroups.com
Hi,

Well, ChicagoBoss is nice and dandy _as far as it is_ ... Personally, I have started writing my new projects in Elixir / Ecto / Phoenix.  It is all Erlang based and one can access Erlang native functions and modules from within Elixir.  It's powerful and not just lipstick on the pig.

I have done several projects in ChicagoBoss in the past and it worked out okay.

Just my $0.02.


--Kai

Sent from my non-google-device
--
You received this message because you are subscribed to the Google Groups "ChicagoBoss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chicagoboss...@googlegroups.com.
Visit this group at http://groups.google.com/group/chicagoboss.

Kai Janson

unread,
Jan 11, 2015, 4:57:57 PM1/11/15
to chica...@googlegroups.com


Sent from my non-google-device

On Jan 11, 2015, at 16:45, Emacs the Viking <obj...@gmail.com> wrote:



On Sunday, 11 January 2015 21:37:54 UTC, Kai Janson wrote:
I just re-read your issues; the recompiling works ... as long as you don't add new functions.
If you perform a code change on ANYTHING existing, it works.

Well, adding new functions is kind of what development mode is all about isn't it!
Totally agree.  It should be a no-brainer, but I do recall that due to the parameterized modules (and Erlang's lack of support now) the compilation is a lot more taxing.
 That also explains why your code did not work when compiled from within Emacs. 
 All the magic is done in the ChicagoBoss compiler chain for the module to work.

Controllers:
There is actually a ticket open to fix this very annoying bug.  I troubleshot this even with Evan and it's a pesky error.  I hope that someone in the core team fixes this very soon.
Elixir is able to recompile and pick up the newly added function(s), so it is not a short coming of the Erlang VM itself, it's ChicagoBoss dropping the ball somewhere in the modified compiler-chain(s).

Bummer.
Yup, I'd say so.  See above, CB compilation is a non-trivial task.
 
Other code directories (lib and others):
The reloader doesn't pickup added functions up as well (see above).
Adding new modules works, but again, newly added functions are skipped/ignored.

Why is it apparently so complicated to just reload a changed file? I am also finding it hard to create debuggable BEAM files too. I think I may end up porting to yaws at this rate despite the great vibe CB ives me. :(

Yaws is great, but ... it's a tank!  I love yaws, but it might not fit your bill 100% either.  You will still need to add database support and the like.  But, performance-wise it is awesome and it offers a lot for the so inclined developer.  Your mileage might vary.

 
Also, I think I had seen that you had referred to one of the controllers just by _web_controller and not smsengine_web:* ; if that's the case, that would be a user error.  That could also explain why it does not work in either mode, development as well as production.


I spotted that and fixed it shortly after I posted but the problem persists.
Good call!
 

--
You received this message because you are subscribed to the Google Groups "ChicagoBoss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chicagoboss...@googlegroups.com.
Visit this group at http://groups.google.com/group/chicagoboss.

Emacs the Viking

unread,
Jan 12, 2015, 4:30:48 AM1/12/15
to chica...@googlegroups.com
 That also explains why your code did not work when compiled from within Emacs. 
A misunderstanding: I used Emacs to edit the code but when I "saved" the file it was not recompiled. I didn't actually invoke a compiler from inside Emacs.
 
Yaws is great, but ... it's a tank!  I love yaws, but it might not fit your bill 100% either.  You will still need to add database support and the like.  But, performance-wise it is awesome and it offers a lot for the so inclined developer.  Your mileage might vary.
Well, I have used Yaws before and like it. I am a 7-8 year Erlang developer, I've rolled OTP applications without too many fancy tools so I may well go hardcore on this project anyway. I've used the RabbitMQ, redis ad MongoDB libraries and they are fine. I just thought that CB looked really really good. It is. But just not production ready yet but nobody has claimed that it was, after all it is still heading for 1.0.

I will try to "fix" the routes-in-deply when I absolutely need to but just not today...

Thanks everybody.

Reply all
Reply to author
Forward
0 new messages