Skip to content

Evaluate making the _RunRidSpecificBuild target run the rid-specific builds in parallel #23409

@rolfbjarne

Description

@rolfbjarne

Evaluate making the _RunRidSpecificBuild target run the rid-specific builds in parallel

The inner MSBuild task in the _RunRidSpecificBuild for reference:

<!-- Execute the inner builds -->
<!-- We force AppendRuntimeIdentifierToOutputPath=true because otherwise the inner builds might end up writing to the same directory -->
<MSBuild
Projects="$(MSBuildProjectFile)"
Targets="_BuildRidSpecificAppBundle"
Properties="
AppendRuntimeIdentifierToOutputPath=true;
RuntimeIdentifier=%(_RuntimeIdentifiersAsItems.Identity);
_CodesignItemsPath=%(_RuntimeIdentifiersAsItems.RidSpecificCodesignItemsPath);
_MtouchSymbolsList=%(_RuntimeIdentifiersAsItems.RidSpecificSymbolsListPath);
_UserFrameworksWithoutDebugSymbolsPath=%(_RuntimeIdentifiersAsItems.RidSpecificUserFrameworksWithoutDebugSymbolsPath);
$(_RidSpecificProperties);
">
<Output TaskParameter="TargetOutputs" ItemName="_AssemblyPublishDirectories" />
</MSBuild>

We could make this task run the inner MSBuild tasks in parallel.

Potential pros:

  • Faster build due to parallelization.
  • Find bugs due to logic errors / double writes, etc.

Potential cons:

  • If it's not safe to run rid-specific builds in parallel, any bugs are likely to be random and hard to diagnose.
  • Slower build due to CPU/memory thrashing (we already AOT-compilation for instance to max out the CPU, doing it twice will make the build slower).

Things to consider:

  • Only release builds are multi-rid, and we don't care as much about speed for release builds as we do for debug builds.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementThe issue or pull request is an enhancementmsbuildIssues affecting our msbuild tasks/targets

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions