LinkAssemblies task is _really_ slow over a Samba share

mcleodiamcleodia ✭✭GBMember ✭✭
edited October 2012 in Xamarin.Android

We have a multi project solution that I build on Windows.
It's quite big but it does build reasonably quickly when done from local files (a minute or so).
However I have noticed that it takes orders of magnitude slower (>20 minute builds) when built over a Samba share. It appears to take forever on the _LinkAssemblies task when outputting the list of resolved assemblies.

Perhaps there's an obvious optimisation that can be done here? Perhaps not.

It's not a show stopper, just a bit inconvenient as I'd prefer to kick off cross platform builds from a common location, but I thought I'd mention it here anyway.

Cheers
Iain

Posts

  • mcleodiamcleodia ✭✭ GBMember ✭✭
    edited October 2012

    And while I'm on the subject of build system problems, we keep our source files in a separate location to our project files and link to these files in visual studio. We also autogenerate msbuild files and invoke these via scons. Therefore there can be both absolute and relative paths within the file paths. This mostly works but unfortunately I couldn't get this to work with the AndroidManifest.xml file.

    I mentioned it previously in the mailing list, can't remember the exact error message but basically there is some kind of assumption that the AndroidManifest.xml is located in a folder relative to the csproj file, whereas we would ideally generate an absolute path for this.

    I did a quick search of Novell.Monodroid.Common.targets and I suspect it's the $(ProjectDir) string in the _ValidateAndroidPackageProperties that is at fault:

    <Target Name="_ValidateAndroidPackageProperties"        DependsOnTargets="_ResolveMonoAndroidSdks">
        <CreateProperty Value="$(ProjectDir)$(AndroidManifest)" Condition="'$(AndroidManifest)' != ''">
            <Output TaskParameter="Value" PropertyName="_AndroidManifestAbs"/>
        </CreateProperty>
        <Error Text="AndroidManifest file does not exist" Condition="'$(_AndroidManifestAbs)'!='' And !Exists ('$(_AndroidManifestAbs)')"/>
    

    I tried to my workaround for this recently (2 copies of the same file kicking about), testing this on the 4.2.7 alpha and it was still broken... Not a showstopper either, just making sure you are aware of the problem.

    Cheers
    Iain

  • JonathanPryorJonathanPryor Xamurai USXamarin Team Xamurai

    However I have noticed that it takes orders of magnitude slower (>20 minute builds) when built over a Samba share. It appears to take forever on the _LinkAssemblies task when outputting the list of resolved assemblies.

    Out of curiosity, are you building within Visual Studio or with MSBuild on the command line? If you're building within Visual Studio, does the timing change if you use MSBuild on the command line?

    Offhand, short of (somehow) seeing if $(ProjectDir) is on a network share and copying everything into some local directory (%TEMP%?), I'm not sure what we can do here.

    Therefore there can be both absolute and relative paths within the file paths. This mostly works but unfortunately I couldn't get this to work with the AndroidManifest.xml file.

    Please file a feature request at https://bugzilla.xamarin.com.

  • mcleodiamcleodia ✭✭ GBMember ✭✭

    Both. Our Scons build system generates project files and uses msbuild to run them, but we also build and deploy manually using visual studio projects.

    MSBuild is the 20+ minute build, but I saw a big slowdown doing a vs2010 build and deploy to device in visual studio too. I'd say it was in the order of a few minutes, but not as slow as MSBuild... I only tend to do clean builds from scons though prior to commiting changes, so it could be a similar build time in VS if I cleaned all?
    Would need to experiment to say for sure... Do you want me to?

    Will file a feature request on Monday for the other issue...

    Thanks for the swift response and have a nice weekend.

    Cheers
    Iain

  • JonathanPryorJonathanPryor Xamurai USXamarin Team Xamurai

    Would need to experiment to say for sure... Do you want me to?

    No, it was just idle curiosity.

    As mentioned above, I'm not sure what we (Xamarin) can do to solve this. Would it be possible for you to alter your build process to copy the solution into a local dir and build locally instead of over Samba?

Sign In or Register to comment.