Order of assembly references in Phalanger.CompilerTask

Discussion about the open-source Phalanger [?] project.

Order of assembly references in Phalanger.CompilerTask

Postby weirdan » January 9th, 2016, 2:48 am

It seems msbuild compiler task, unlike command-line compiler, is sensitive to the order in which references are specified in the <ItemGroup>. For example, the following build snippet builds fine:
Code: Select all
    <ItemGroup Condition="'$(AppType)' == 'Gtk'">
        <Compile Include="src/View/Gtk/App.php"/>
        <!-- ....... -->
        <Reference Include="ICSharpCode.NRefactory">
            <Private>true</Private>
        </Reference>
        <Reference Include="Mono.TextEditor">
            <Private>true</Private>
        </Reference>
        <!-- ....... -->
    </ItemGroup>

while the following fails (note the order):
Code: Select all
    <ItemGroup Condition="'$(AppType)' == 'Gtk'">
        <Compile Include="src/View/Gtk/App.php"/>
        <!-- ....... -->
        <Reference Include="Mono.TextEditor">
            <Private>true</Private>
        </Reference>
        <Reference Include="ICSharpCode.NRefactory">
            <Private>true</Private>
        </Reference>
        <!-- ....... -->
    </ItemGroup>


Is this expected behavior? Am I supposed to do topological sort based on the dependencies myself?

'strace xbuild' shows that when the build fails, NRefactory assembly is searched in weird places like xbuild directories, even though the exact path to the assembly is specified in References parameter to the compiler task, albeit after the assembly that requires it (Mono.TextEditor).
weirdan
 
Posts: 17
Joined: June 4th, 2013, 1:11 am

Return to Phalanger project

Who is online

Users browsing this forum: No registered users and 5 guests

cron

User Control Panel

Login

Who is online

In total there are 5 users online :: 0 registered, 0 hidden and 5 guests (based on users active over the past 5 minutes)
Most users ever online was 151 on December 6th, 2020, 7:46 am

Users browsing this forum: No registered users and 5 guests