I think I have nailed this down and it appears to be a bug of some sort.

I noticed that all the syntax errors I had followed a similar form, and the
problem is repeatable.

Create a new project:

<pre>
make app PROJECT=bug_test
</pre>

Then create a controller/bug_test_test_controller.erl with content of

<pre>
1   -module(bug_test_test_controller, [Req, SessionId]).
2   -compile(export_all).
3
4   index('GET',[]) ->
5      Rslt = 1 - length([1,2,3]),
6     {output, "Hello, world!"}.
</pre>

Then make gives the following:
<pre>
     |
     |
Compiled src/boss/boss_web_test.erl
Compiled src/boss/boss_html_doc_template.dtl
Compiled src/boss/boss_html_errors_template.dtl
Compiled src/boss/boss_html_error_template.dtl
==> bug_test (pre_compile)
16:37:49.843 [error] Compile Error,
"src/controller/bug_test_test_controller.erl" ->
[{"/home/graeme/projects/egolf/dev/bug_test/src/controller/bug_test_test_controller.erl",[{6,erl_parse,["syntax
error before: ","length"]}]}]
16:37:49.843 [error] Load Module Error controller_modules :
[[{"/home/graeme/projects/egolf/dev/bug_test/src/controller/bug_test_test_controller.erl",[{6,erl_parse,["syntax
error before: ","length"]}]}]]
./rebar boss c=compile
==> bug_test (boss)
16:37:51.184 [error] CRASH REPORT Process <0.155.0> with 0 neighbours
exited with reason: call to undefined function elixir:start(normal, []) in
application_master:init/4 line 134
16:37:51.350 [error] Compile Error,
"src/controller/bug_test_test_controller.erl" ->
[{"/home/graeme/projects/egolf/dev/bug_test/src/controller/bug_test_test_controller.erl",[{6,erl_parse,["syntax
error before: ","length"]}]}]
16:37:51.350 [error] Load Module Error controller_modules :
[[{"/home/graeme/projects/egolf/dev/bug_test/src/controller/bug_test_test_controller.erl",[{6,erl_parse,["syntax
error before: ","length"]}]}]]
:~/projects/egolf/dev/bug_test$
</pre>

I have not checked all my syntax errors yet, but the first few are all like
this - arithmetic expressions ending in a minus sign followed by a function
call. Interestingly if I wrap the function call in brackets the problems
seem to go away.

I will check the rest of my errors, but this is at least one common
pattern. It looks like there may be a parsing problem.

. . . or did I miss something here?  Hahaha

Cheers,

graeme




On 27 November 2015 at 16:08, Graeme Defty <[email protected]> wrote:

> Sorry all - I spotted my deliberate mistake from my last message in the
> boss.config file  (I had ../deps/boss instead of ./deps/boss) Apologies for
> the false alarm.
>
> BUT . . . . now I am back to my original problem - strange syntax errors
> in compiling.
>
> As an example, my code looks like this:
>
> <pre>
> 124    NewGood = Good + case Stab >= 36 +
> 125                  (Rh:teeset()):total_par() -
> 126                  (Rh:teeset()):rating(EntryPlayer:gender()) -
> 127
> hcap_congu_lib:cat_category(((Rh:entity()):player()):exact()) of
> 128                        true    ->  1;
> 129                        false   ->  0
> 130                     end,
> </pre>
>
> and the compiler objects thus:
>
> <pre>
> ==> cb-prodfix (pre_compile)
> 16:02:27.995 [error] Compile Error, "src/lib/hcap_congu.erl" ->
> [{"/home/graeme/projects/egolf/dev/cb-prodfix/src/lib/hcap_congu.erl",[{127,erl_parse,["syntax
> error before: ","hcap_congu_lib"]}]}]
> </pre>
>
> I have looked with a hex editor and made sure there is nothing but blanks
> in the file, and as I mentioned before, I can erlc the file and create a
> .beam file with no problems, so . . . well - I dont know.
>
> Any thoughts anyone?
>
> g
>
>
>
>
>
>
>
> On 27 November 2015 at 15:48, Graeme Defty <[email protected]> wrote:
>
>> HELLLLLLLLLPPPppppppppppppp!
>>
>> just to set the scene . . . I have been supporting my CB application for
>> some years now (where some > 3), so it has undergone a number of CB version
>> changes. However, these have all been done on a fairly ad-hoc basis, and I
>> am certainly not using all the new features in CB. Updating boss.config has
>> been on an as-needed basis, and very piecemeal. Using this process I had
>> got up to CB 0.8.14. I think Erlang R17 was the last time I compiled a CB
>> release, but it could have been R16.
>>
>> OK - so in the battle to get to R18 I pulled the latest CB release from
>> Github and got-dep and made it all successfully.
>>
>> I then generated a new app so I would have a model to compare against.
>>
>> I copied the new version of boss.config from the model app to my app and
>> modified it so that it matched my original.
>>
>> I also copied the new rebar (incl .cmd and .config) from the model app to
>> mine.
>>
>> When I tried to compile my app I got some very strange compiler syntax
>> errors where there were none before. Moving to my src/lib directory I was
>> able to run erlc and compile one of the offending modules perfectly OK, so
>> there was nothing wrong with the source. Aside from anything I had not
>> changed it!
>>
>> One of the things I have been doing for a long time now is keeping CB out
>> of my application directories. Instead I point my boss.config to a
>> directory which sits beside my applications
>>
>> e.g.
>> <pre>
>>    |
>>
>> [{boss, [
>>     {path, "../ChicagoBoss-0.8.14"},
>>     {applications, ... ,
>>   |
>> </pre>
>>
>> This allows me to have multiple applications with only 1 instance of CB
>> and also means it is reasonably simple to change to another CB release when
>> they come along, and has worked successfully for a while.
>>
>> This time though, I wondered whether my CB installation really was OK, so
>> I changed my boss.config back to pointing inside my applications directory
>> as it was in the model app:
>>
>> i.e.
>> <pre>
>>    |
>>
>> [{boss, [
>>     {path, "deps/boss"},
>>     {applications, ... ,
>>   |
>> </pre>
>>
>>
>> This time get deps worked fine and compiling ran through the deps OK
>> until it came to my application when it failed with:
>>
>> <pre>
>> ==> simple_bridge (pre_compile)
>> ==> simple_bridge (compile)
>> Generating crypto compatibility for simple_bridge...
>> ...Using: "crypto:hash(sha, Data)"
>> ...no changes needed to "include/crypto_compat.hrl". Skipping writing new
>> file
>> ==> boss (pre_compile)
>> ==> boss (compile)
>> ==> cb-prodfix (pre_compile)
>> ERROR: pre_compile failed while processing
>> /home/graeme/projects/egolf/dev/cb-prodfix: {'EXIT',
>>     {undef,
>>         [{boss_rebar,init_conf,
>>              [[{boss,
>>                    [{path,"../deps/boss"},
>>                     {applications,[egolf]},
>>                     {assume_locale,"en"},
>>                     {vm_name,"egolf@testhost"},
>>                        |
>>
>> </pre>
>>
>> I am sure this is something else I should have changed or copied from
>> somewhere in the config of the model app to replace an old version in my
>> app, but I can't for the life of me find the durned thing.
>>
>> Can someone suggest what I might have missed?
>>
>> Thanks
>>
>> graeme
>>
>>
>> PS
>> Sorry for the slightly rambling description of the problem - brain
>> fatigue, I think.  :-)
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> On 19 November 2015 at 18:04, Graeme Defty <[email protected]>
>> wrote:
>>
>>> For me, it would be worth having a new release just to get R18 support.
>>>
>>> I run Ubuntu and can no longer (easily) run an older version of Erlang.
>>> I tried the esl-erlang (version 17), but that was missing erl_anno, and
>>> installing the erlang-parsetools package from Ubuntu caused apt-get to
>>> un-install esl-erlang and then when I tried to . . . well you get the
>>> picture.
>>>
>>> Since I am trying to replace my UAT environment, any changes I make will
>>> have to be flowed backward into DEVelopment and forward into PRODuction so
>>> I am reluctant to run on "the latest HEAD". I would very much like to have
>>> a stable, fixed version to run on.
>>>
>>> Any chance we could have a release soon?
>>>
>>> (Alternatively, of course, if I am being dumb and  am missing something
>>> obvious that makes this all very easy, please do let me know. :-) )
>>>
>>> Cheers,
>>>
>>> Graeme
>>>
>>>
>>>
>>>
>>> >matt
>>>
>>>
>>>
>>>
>>> On 15 August 2015 at 21:51, Dmitry Polyanovsky <
>>> [email protected]> wrote:
>>>
>>>> Big changes are coming!
>>>> There is newly released v0.8.16 of CB working on R16 and 17.
>>>>
>>>> Also, both ChicagoBoss and boss_db has two development branches from
>>>> now: 'legacy' - with support for R16 & 17 and 'master' - with support for
>>>> Erlang 17 and 18.
>>>>
>>>> Both branches compiling on versions supported and v0.9 will be released
>>>> from master branch, as soon as some valued PRs will be merged. So, your
>>>> commits are highly welcome.
>>>>
>>>> Please note, Riak support dropped on master branch, because problems
>>>> compiling on Erlang 18, awaiting for more recent version. And mongodb
>>>> should be enabled manually in rebar.config, cause it has different
>>>> dependencies for different Erlang versions.
>>>> If you don't use Riak or Mongodb, there is nothing to care about and in
>>>> any case - download latest version and start coding!
>>>>
>>>> https://github.com/ChicagoBoss/ChicagoBoss
>>>>
>>>> --
>>>> 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 [email protected].
>>>> 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/1c5df079-e34c-48d9-80b2-953ef496679e%40googlegroups.com
>>>> <https://groups.google.com/d/msgid/chicagoboss/1c5df079-e34c-48d9-80b2-953ef496679e%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>> .
>>>> For more options, visit https://groups.google.com/d/optout.
>>>>
>>>
>>>
>>
>

-- 
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 [email protected].
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/CAKF5fiC_N5AqSsGPAwq6N6ZdTDmu_qsYVpbEKs7%3DFftK60w2gA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to