incorrect syntax for -include_lib ("wf.hrl"). in nitrogen_core

43 views
Skip to first unread message

Roman.Shestakov

unread,
Sep 30, 2012, 8:07:05 AM9/30/12
to nitro...@googlegroups.com
hello,

all the erl files in nitrogen_core reference wf.hrl with incorrect -include_lib ("wf.hrl").

I think it should be -include_lib ("nitrogen_core/include/wf.hrl").

this is causing the following errors during autocompile (with sync:go()) :

=INFO REPORT==== 30-Sep-2012::12:31:38 ===
/Users/romanshestakov/Development/temp/tt/ec_web/deps/nitrogen_core/src/actions/action_add_class.erl:6: Error: can't find include lib "wf.hrl"
/Users/romanshestakov/Development/temp/tt/ec_web/deps/nitrogen_core/src/actions/action_add_class.erl:9: Warning: variable 'Record' is unused


though the path to nitrogen_core is available :

(ec_...@rs.home)2> code:get_path().
[".",
 "/Users/romanshestakov/Development/temp/tt/ec_web/deps/sync/ebin",
 "/Users/romanshestakov/Development/temp/tt/ec_web/deps/simple_bridge/ebin",
 "/Users/romanshestakov/Development/temp/tt/ec_web/deps/resource_discovery/ebin",
 "/Users/romanshestakov/Development/temp/tt/ec_web/deps/nprocreg/ebin",
 "/Users/romanshestakov/Development/temp/tt/ec_web/deps/nitrogen_core/ebin",

what is the best way to fix this?

Regards, Roman

Jesse Gumm

unread,
Sep 30, 2012, 9:09:14 AM9/30/12
to nitro...@googlegroups.com

Hi Roman,

The syntax should be fine, in that nitrogen_core is itself a lib, and as such, is one of the directories being searched for includes.

I would check to make sure you're launching Nitrogen with tyre following line in your etc/vm.args

-sync sync_mode nitrogen

Please let me know if this fixes it for you.

--
Jesse Gumm
Owner, Sigma Star Systems
414.940.4866 || sigma-star.com || @jessegumm

--
You received this message because you are subscribed to the Google Groups "Nitrogen Project / The Nitrogen Web Framework for Erlang" group.
To view this discussion on the web visit https://groups.google.com/d/msg/nitrogenweb/-/9dINFx4v9cQJ.
To post to this group, send email to nitro...@googlegroups.com.
To unsubscribe from this group, send email to nitrogenweb...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/nitrogenweb?hl=en.

Roman Shestakov

unread,
Sep 30, 2012, 9:56:24 AM9/30/12
to nitro...@googlegroups.com
hi Jesse,

thanks for replying… 

you are correct - sync seems to treat nitrogen differently:

I found this comment in sync_utils, which seems to be explaining the issue

%% Normal method is smarter and returns exactly any path that has .erl or .hrl files in it
%% With Nitrogen, or any structure in which -include("something.hrl") specifies an implied directory, this will give "unable to find include file" errors

i included the following into my config file and it did the trick:
 {sync, [{sync_mode, nitrogen}]},

many thanks!

Regards, Roman


On 30 Sep 2012, at 14:09, Jesse Gumm wrote:

Hi Roman,

The syntax should be fine, in that nitrogen_core is itself a lib, and as such, is one of the directories being searched for includes.

I would check to make sure you're launching Nitrogen with tyre following line in your etc/vm.args

-sync sync_mode nitrogen

Please let me know if this fixes it for you.

--
Jesse Gumm
Owner, Sigma Star Systems
414.940.4866 || sigma-star.com || @jessegumm

On Sep 30, 2012 7:07 AM, "Roman.Shestakov" <roman.s...@gmail.com> wrote:

--
You received this message because you are subscribed to the Google Groups "Nitrogen Project / The Nitrogen Web Framework for Erlang" group.

Jesse Gumm

unread,
Sep 30, 2012, 10:07:30 AM9/30/12
to nitro...@googlegroups.com

Hi Roman,

Excellent!

Glad that helped. It took me a while to track down the cause of that error after Rusty changed the default behavior in sync. And for life of me, I could not rectify the differences between his improvement, and the use of include files in implied directories. Hence the configuration option.

It would be nice to render the configuration option unnecessary. Maybe one day I'll sit down and give that another shot. But not today :)

Anyway, cheers,

-Jesse

--
Jesse Gumm
Owner, Sigma Star Systems
414.940.4866 || sigma-star.com || @jessegumm

Reply all
Reply to author
Forward
0 new messages