An error in building researchr trunk with WebDSL (java).


[ Main | info ] stage 9: code generationMain: rewriting failed, trace:
webdslc_main_0_0
xtc_io_wrap_5_0
option_wrap_5_0
xtc_io_1_0
xtc_temp_files_1_0
restore_always_2_0
xtc_webdslc_0_0
stage_1_1
dr_scope_1_1
log_timed_1_1
core_to_java_servlet_0_1
log_time_1_1
generate_code_java_servlet_0_0
generate_code_java_servlet_0_0
dr_scope_1_1
dr_scope_1_1
dr_scope_1_1
dr_scope_1_1
dr_scope_1_1
dr_scope_1_1
dr_scope_1_1
scope_local_emit_1_1
dr_scope_1_1
dr_scope_1_1
dr_scope_1_1
log_time_1_1
GenerateCodeJavaServlet_0_0
log_time_1_1
handle_actions_java_servlet_template_0_0
map_handle_actions_to_java_servlet_0_0
collect_om_1_0
collect_om_2_0
foldr_3_0
collect_om_2_0
handle_actions_to_java_servlet_0_0
handle_actions_to_java_servlet_0_0_fragment_0
handle_actions_to_java_servlet_submit_0_4
action_args_to_java_exp_list_0_2
zip_1_0
genzip_4_0
_2_0
call_arg_ref_resolve_helper_0_0
pass_on_ref_arg_exp_0_0
is_ref_type_0_0
fetch_elem_1_0
[ Main | critical ] Internal error: with clause failed unexpectedly in rule ‘call-arg-ref-resolve-helper’
(SimpleSort(“Person”){IsRefSort,ImmutableReference},Var(“pers0”{OriginalNameAnno(“pers”)}){TypeAnno(SimpleSort(“Person”){EntityAnno(“key”,“key”,True),DefValueAnno(Null),ImmutableReference})})

Submitted by Eelco Visser on 11 April 2011 at 00:27

On 11 April 2011 at 14:31 Danny Groenewegen commented:

try the webdsl trunk: http://hydra.nixos.org/build/1037745


On 24 February 2012 at 14:40 Elmer van Chastelet commented:

I currently have the exact same problem after reinstalling Ubuntu. I don’t have problems building other webdsl apps. It builds successfully on my old Ubuntu installation with the same revision of WebDSL (head) and same researchr source code. Very strange…


On 24 February 2012 at 14:40 Elmer van Chastelet closed this issue.

On 24 February 2012 at 14:43 Elmer van Chastelet reopened this issue.

On 24 February 2012 at 15:05 Elmer van Chastelet commented:

Using the webdsl compiler created on my old ubuntu installation, researchr builds successfully on my new ubuntu installation. So it should be something during compilation of the WebDSL compiler which is causing this behavior.


On 24 February 2012 at 15:29 Elmer van Chastelet commented:

This template, and other (probably similar) templates, cause the ‘pass-on-ref-arg-exp’ rule to fail:

define span selectCoauthorFromList(pers : Person, alias : Alias) {
  define span selectPersonFromList(alias : Alias, coauthor : Person) {
    action("Select", action{
      var a : Affiliation := null;
      pers.identifyCoauthor(coauthor, alias, a);
      return profile(pers, "coauthors", "", "");
    })
  }
  define span selectPersonAffiliationFromList(alias : Alias, coauthor : Person, affil : Affiliation) {
    action("Select", action{ 
      pers.identifyCoauthor(coauthor, alias, affil);
      return profile(pers, "coauthors", "", ""); 
    })
  }
  selectPersonFromList(alias)
}

On 24 February 2012 at 22:31 Elmer van Chastelet commented:

The variable pers probably gets transformed (desugared?) differently in the failing environment. There is no call to pass-on-ref-arg-exp in the succeeding environment, where it fails in the failing environment.


On 24 February 2012 at 22:57 Elmer van Chastelet commented:

Failing:
call-arg-ref-resolve-helper: (SimpleSort(“Person”){ImmutableReference},Var(“pers0”{OriginalNameAnno(“pers”)}){TypeAnno(SimpleSort(“Person”){EntityAnno(“id”,None,False),DefValueAnno(Null),ImmutableReference})})

Succeeding:
call-arg-ref-resolve-helper:(SimpleSort(“Person”){IsRefSort,ImmutableReference},Var(“pers0”{OriginalNameAnno(“pers”)}){TypeAnno(SimpleSort(“Person”){EntityAnno(“id”,None,False),DefValueAnno(Null),ImmutableReference})})


On 25 February 2012 at 00:52 Elmer van Chastelet commented:

Getting closer..

Turns out that the dr TopLevelDefineName returns different values in the context of the rule desugar-inline-action-call

Failing:

selectCoauthorFromListPerson__Alias_selectPersonFromList0$l$Alias__Person__Alias__Person

Succeeding:

selectCoauthorFromListPerson__Alias

On 25 February 2012 at 01:45 Elmer van Chastelet commented:

During model-to-model, the input/output of the rule with-toplevel-name(s):

1st time
input:

Define([TemplateModSpan],"selectCoauthorFromList"{"selectCoauthorFromList0"},[Arg("pers"{"selectCoauthorFromListPerson__Alias_pers0"},SimpleSort("Person")){IsTemplateArg},Arg("alias"{"selectCoauthorFromListPerson__Alias_alias0"},SimpleSort("Alias")){IsTemplateArg}],None,[Define([Local,TemplateModSpan],"selectPersonFromList"{"selectCoauthorFromListPerson__Alias_selectPersonFromList0"},[Arg("alias"{"selectCoauthorFromListPerson__Alias_alias1"},SimpleSort("Alias")){IsTemplateArg},Arg("coauthor"{"selectCoauthorFromListPerson__Alias_coauthor0"},SimpleSort("Person")){IsTemplateArg}],None,[Submit(String("\"Select\""),InlineAction(Block([VarDeclInit("a"{"selectCoauthorFromListPerson__Alias_a0"},SimpleSort("Affiliation"),Null),Stat(Call(Var("pers"{"selectCoauthorFromListPerson__Alias_pers0"}),"identifyCoauthor",[Var("coauthor"{"selectCoauthorFromListPerson__Alias_coauthor0"}),Var("alias"{"selectCoauthorFromListPerson__Alias_alias1"}),Var("a"{"selectCoauthorFromListPerson__Alias_a0"})]))])){ClosureInAnno([Var("coauthor"{"selectCoauthorFromListPerson__Alias_coauthor0"}),Var("alias"{"selectCoauthorFromListPerson__Alias_alias1"}),Var("alias"{"selectCoauthorFromListPerson__Alias_alias0"}),Var("pers"{"selectCoauthorFromListPerson__Alias_pers0"})])},[])]){EnclosingDefine(("selectCoauthorFromList"{"selectCoauthorFromList0"},[SimpleSort("Person"),SimpleSort("Alias")]),"selectCoauthorFromList"{"selectCoauthorFromList0"},[Arg("pers"{"selectCoauthorFromListPerson__Alias_pers0"},SimpleSort("Person")){IsTemplateArg,At("../nested-template-override-action.app",30,36)},Arg("alias"{"selectCoauthorFromListPerson__Alias_alias0"},SimpleSort("Alias")){IsTemplateArg,At("../nested-template-override-action.app",30,51)}],False),ClosureInAnno([Var("alias"{"selectCoauthorFromListPerson__Alias_alias0"}),Var("pers"{"selectCoauthorFromListPerson__Alias_pers0"})]),At("../nested-template-override-action.app",31,3)}]){At("../nested-template-override-action.app",30,1)}

output:

 selectCoauthorFromListPerson__Alias

2nd time
input:

Define([TemplateDefineNameBeforeLifting("selectPersonFromList"{"selectCoauthorFromListPerson__Alias_selectPersonFromList0"}),TemplateModSpan],"selectCoauthorFromListPerson__Alias_selectPersonFromList0$l$",[Arg("alias"{"selectCoauthorFromListPerson__Alias_alias1"},SimpleSort("Alias")){IsTemplateArg},Arg("coauthor"{"selectCoauthorFromListPerson__Alias_coauthor0"},SimpleSort("Person")){IsTemplateArg},Arg("alias"{"selectCoauthorFromListPerson__Alias_alias0"},RefSort(SimpleSort("Alias"){ImmutableReference})),Arg("pers"{"selectCoauthorFromListPerson__Alias_pers0"},RefSort(SimpleSort("Person"){ImmutableReference}))],None,[AccessControlImportRules("selectCoauthorFromList"{"selectCoauthorFromList0"},[Var("pers"{"selectCoauthorFromListPerson__Alias_pers0"}),Var("alias"{"selectCoauthorFromListPerson__Alias_alias0"})]),Submit(String("Select"),InlineAction(Block([VarDeclInit("a"{"selectCoauthorFromListPerson__Alias_a0"},SimpleSort("Affiliation"),Null),Stat(Call(Var("pers"{"selectCoauthorFromListPerson__Alias_pers0"}),"identifyCoauthor",[Var("coauthor"{"selectCoauthorFromListPerson__Alias_coauthor0"}),Var("alias"{"selectCoauthorFromListPerson__Alias_alias1"}),Var("a"{"selectCoauthorFromListPerson__Alias_a0"})]))])){ClosureInAnno([Var("coauthor"{"selectCoauthorFromListPerson__Alias_coauthor0"}),Var("alias"{"selectCoauthorFromListPerson__Alias_alias1"}),Var("alias"{"selectCoauthorFromListPerson__Alias_alias0"}),Var("pers"{"selectCoauthorFromListPerson__Alias_pers0"})])},[])]){At("../nested-template-override-action.app",31,3)}

output:

selectCoauthorFromListPerson__Alias_selectPersonFromList0$l$Alias__Person__Alias__Person

On 27 February 2012 at 15:25 Elmer van Chastelet closed this issue.

On 27 February 2012 at 15:25 Elmer van Chastelet commented:

Fixed in r4948. We now assure that inline actions are first lifted before desugaring local template definitions, which was causing this error.

Log in to post comments