Ported custom build rule doesn't take into account dependencies

Proposed Ported custom build rule doesn't take into account dependencies

  • Wednesday, September 05, 2012 8:49 AM
     
     

    After porting project from VC 2005 to VC 2010 we faced with dependency problem in converted custom build rule. There is an excerpt:

    <CustomBuildRule
                Name="OmgIdl"
                DisplayName="OMG IDL compilers (tao_idl and IDLtoCLS)"
                CommandLine="tao_idl -I$(ACE_ROOT)/TAO -I$(ACE_ROOT)/TAO/orbsvcs/orbsvcs -I$(CIS_HOME)/InfraServer_IDL -I$(PRIM_HOME) [IncludeTaoIdl] [GenerateAMI] [GenerateAMH] [SuppressThruPoaCollocatedStubs] [ExportMacro] [ExportInclude] [StubExportMacro] [StubExportInclude] [SkelExportMacro] [SkelExportInclude] -o $(InputDir) $(InputPath)&#x0D;&#x0A;$(IIOPNET_HOME)\IDLToCLSCompiler\IDLCompiler\bin\IDLToCLSCompiler -d IIOP_NET_IDL -idir $(ACE_ROOT)\TAO\orbsvcs\orbsvcs -idir $(ACE_ROOT)\TAO [IncludeIdlToCls] [ReferenceIdlToCls] -o $(OutBinDir) $(InputName)_cs $(InputPath)&#x0D;&#x0A;$(IIOPNET_HOME)\IDLToCLSCompiler\IDLCompiler\bin\IDLToCLSCompiler -d IIOP_NET_IDL -idir $(ACE_ROOT)\TAO\orbsvcs\orbsvcs -idir $(ACE_ROOT)\TAO [IncludeIdlToCls] [ReferenceIdlToCls] -mapAnyToCont -o $(OutBinDir) $(InputName)_ac_cs $(InputPath)"
                Outputs="$(InputDir)/$(InputName)C.h;$(InputDir)/$(InputName)C.cpp;$(InputDir)/$(InputName)C.inl;$(InputDir)/$(InputName)S.h;$(InputDir)/$(InputName)S.cpp;$(InputDir)/$(InputName)S.inl;$(OutBinDir)/$(InputName)_cs.dll;$(OutBinDir)/$(InputName)_ac_cs.dll"
                FileExtensions="*.idl"
                ExecutionDescription="Processing IDL file $(InputName)..."
                ShowOnlyRuleProperties="false"
                >

    ....

    As you can notice, command line contains a few steps.

    1) First step generates bundle *.h and .*cpp files. It does command: tao_idl -I$(ACE_ROOT)/TAO -I$(ACE_ROOT)/TAO/orbsvcs/orbsvcs -I$(CIS_HOME)/InfraServer_IDL -I$(PRIM_HOME) [IncludeTaoIdl] [GenerateAMI] [GenerateAMH] [SuppressThruPoaCollocatedStubs] [ExportMacro] [ExportInclude] [StubExportMacro] [StubExportInclude] [SkelExportMacro] [SkelExportInclude] -o $(InputDir) $(InputPath)

    2) Second step generates (from output files from first step) *_cs.dll with command:

    $(IIOPNET_HOME)\IDLToCLSCompiler\IDLCompiler\bin\IDLToCLSCompiler -d IIOP_NET_IDL -idir $(ACE_ROOT)\TAO\orbsvcs\orbsvcs -idir $(ACE_ROOT)\TAO [IncludeIdlToCls] [ReferenceIdlToCls] -o $(OutBinDir) $(InputName)_cs $(InputPath)

    3) Third step generates (from output files from first step) *_ac_cs.dll with command:

    $(IIOPNET_HOME)\IDLToCLSCompiler\IDLCompiler\bin\IDLToCLSCompiler -d IIOP_NET_IDL -idir $(ACE_ROOT)\TAO\orbsvcs\orbsvcs -idir $(ACE_ROOT)\TAO [IncludeIdlToCls] [ReferenceIdlToCls] -mapAnyToCont -o $(OutBinDir) $(InputName)_ac_cs $(InputPath)

    Please pay attention to option [ReferenceIdlToCls]. It option can link to *_cs.dll generated on second step. Below is problem description:

    There is A.idl and B.idl. Second step A.idl processing have B_cs.dll in [ReferenceIdlToCls]. But processing does in alphabetic order and build failed on A processing, so B_cs.dll doesn't exist in that moment. Is there any solution for this dependency problem?

All Replies

  • Thursday, September 06, 2012 6:19 AM
     
     

    I think you can refer to:

    http://victorsergienko.com/project-dependencies-of-visual-studio-2008-broken-in-msbuild/

  • Thursday, September 06, 2012 6:55 AM
     
     
    Disley, thanks for answer. But i think that is not my problem.  By the way, property pages for .idl files contain "Additional Dependencies" field and information in it is correct, but it doesn't affect custom build step :(.  Where you are, MSBuild guru?
  • Thursday, September 06, 2012 8:07 AM
    Moderator
     
     

    Hi Vashme,

    Thank you for your question.

    I am trying to involve someone familiar with this topic to further look at this issue. There might be some time delay. Appreciate your patience.

    Thank you for your understanding and support.

    Best regards,


    Ego [MSFT]
    MSDN Community Support | Feedback to us

  • Thursday, September 06, 2012 8:19 AM
     
     

    I'm not guru. I just a tyro. I'm so sorry for my unhelpful reply. I read some articles about custom build. Here is an article I think is helpful to you:

    http://blogs.msdn.com/b/vcblog/archive/2010/04/21/quick-help-on-vs2010-custom-build-rule.aspx

  • Monday, September 10, 2012 11:50 AM
     
     
    Still interested in the answer...
  • Wednesday, September 12, 2012 5:18 PM
    Owner
     
     
    Can we see your rules, props and targets files for the CustomBuildRule? You can mail to TREVORH at MICROSOFT.

    Trevor Hancock (Microsoft)
    Please remember to "Mark As Answer" the replies that help.

  • Friday, September 14, 2012 7:48 AM
     
     
    Hi, Trevor. Thank you for help. Send requested file to you.
  • Friday, September 14, 2012 2:24 PM
    Owner
     
     
    Received. We will reply ASAP.

    Trevor Hancock (Microsoft)
    Please remember to "Mark As Answer" the replies that help.

  • Friday, September 28, 2012 9:27 PM
    Owner
     
     
    We are still looking into this. I am sorry for the delay. If this is urgent, please consider opening a support case with us. Visit this link to see the various support options that are available to better meet your needs:  http://support.microsoft.com/default.aspx?id=fh;en-us;offerprophone.

    Trevor Hancock (Microsoft)
    Please remember to "Mark As Answer" the replies that help.

  • Friday, October 05, 2012 6:58 AM
     
     
    It is not very urgent. We can wait a while (2 weeks approximately).  I hope that the problem has a solution.
  • Friday, October 05, 2012 2:09 PM
    Owner
     
     Proposed

    This blog (http://blogs.msdn.com/b/vcblog/archive/2010/04/21/quick-help-on-vs2010-custom-build-rule.aspx?PageIndex=2#comments)  talks about changes of C++ Custom Build Rules, which should help.

    In the blog comments, a customer was reporting similar issue, which was probably fixed in VS 2012.

    If this does not resolve it, please consider opening a support case with us. Visit this link to see the various support options that are available to better meet your needs:  http://support.microsoft.com/default.aspx?id=fh;en-us;offerprophone.


    Trevor Hancock (Microsoft)
    Please remember to "Mark As Answer" the replies that help.