Merge pull request #701 from piotrpMSFT/piotrpMSFT/698/BuildPerformance

Improve build performance

After making this change, the following improvements were observed. All values in minutes.

| Build Flavor    | Previous (3 build avg) | Current | Improvement |
|-----------------|------------------------|---------|-------------|
| CentOS Debug    | 29.66667               | 22      | 7.666667    |
| CentOS Release  | 25.33333               | 17      | 8.333333    |
| Ubuntu Debug    | 29.66667               | 23      | 6.666667    |
| Ubuntu Release  | 29.66667               | 24      | 5.666667    |
| OS X Debug      | 31.66667               | 25      | 6.666667    |
| OS X Release    | 31.33333               | 30      | 1.333333    |
| Windows Debug   | 22.33333               | 20      | 2.333333    |
| Windows Release | 22.33333               | 20      | 2.333333    |12345678910
This commit is contained in:
Piotr Puszkiewicz 2016-01-04 22:52:08 -08:00
commit 7b59c580d0
5 changed files with 43 additions and 46 deletions

View file

@ -11,7 +11,4 @@ $env:PATH = "$env:DOTNET_INSTALL_DIR\cli\bin;$StartPath"
_ "$RepoRoot\scripts\compile\compile-stage.ps1" @("$Tfm","$Rid","$Configuration","$Stage1Dir","$RepoRoot","$HostDir")
# Copy in the dotnet-restore script
cp "$RepoRoot\scripts\dotnet-restore.cmd" "$Stage1Dir\bin\dotnet-restore.cmd"
$env:PATH=$StartPath

View file

@ -12,19 +12,4 @@ $env:PATH = "$Stage1Dir\bin;$env:PATH"
# Compile
_ "$RepoRoot\scripts\compile\compile-stage.ps1" @("$Tfm","$Rid","$Configuration","$Stage2Dir","$RepoRoot","$HostDir")
# Crossgen Roslyn
header "Crossgening Roslyn compiler ..."
_cmd "$RepoRoot\scripts\crossgen\crossgen_roslyn.cmd ""$Stage2Dir"""
# Copy dnx into stage 2
cp -rec "$DnxRoot\" "$Stage2Dir\bin\dnx\"
# Copy in the dotnet-restore script
cp "$RepoRoot\scripts\dotnet-restore.cmd" "$Stage2Dir\bin\dotnet-restore.cmd"
# Copy in AppDeps
$env:PATH = "$Stage2Dir\bin;$StartPath"
header "Acquiring Native App Dependencies"
_cmd "$RepoRoot\scripts\build\build_appdeps.cmd ""$Stage2Dir"""
$env:PATH=$StartPath

View file

@ -21,35 +21,9 @@ export StartPath=$PATH
export DOTNET_TOOLS=$STAGE1_DIR
export PATH=$STAGE1_DIR/bin:$PATH
# Build Stage 2
header "Building stage2 dotnet using just-built stage1 ..."
# Compile Stage 2
header "Compiling stage2 dotnet using just-built stage1 ..."
OUTPUT_DIR=$STAGE2_DIR $REPOROOT/scripts/compile/compile-stage.sh
echo "Crossgenning Roslyn compiler ..."
$REPOROOT/scripts/crossgen/crossgen_roslyn.sh "$STAGE2_DIR/bin"
# Make Stage 2 Folder Accessible
chmod -R a+r $REPOROOT
# Copy DNX in to stage2
cp -R $DNX_ROOT $STAGE2_DIR/bin/dnx
# Copy and CHMOD the dotnet-restore script
cp $REPOROOT/scripts/dotnet-restore.sh $STAGE2_DIR/bin/dotnet-restore
chmod a+x $STAGE2_DIR/bin/dotnet-restore
# No compile native support in centos yet
# https://github.com/dotnet/cli/issues/453
if [ "$OSNAME" != "centos" ]; then
# Copy in AppDeps
header "Acquiring Native App Dependencies"
DOTNET_HOME=$STAGE2_DIR DOTNET_TOOLS=$STAGE2_DIR $REPOROOT/scripts/build/build_appdeps.sh "$STAGE2_DIR/bin"
fi
# Stamp the output with the commit metadata
COMMIT=$(git rev-parse HEAD)
echo $COMMIT > $STAGE2_DIR/.version
echo $DOTNET_BUILD_VERSION >> $STAGE2_DIR/.version
export DOTNET_HOME=$STAGE2_DIR
export DOTNET_TOOLS=$STAGE2_DIR

View file

@ -85,3 +85,18 @@ $BinariesForCoreHost | ForEach-Object {
mv $OutputDir\bin\$_.exe $OutputDir\bin\$_.dll
cp $OutputDir\bin\corehost.exe $OutputDir\bin\$_.exe
}
# Crossgen Roslyn
header "Crossgening Roslyn compiler ..."
_cmd "$RepoRoot\scripts\crossgen\crossgen_roslyn.cmd ""$OutputDir"""
# Copy dnx into stage OutputDir
cp -rec "$DnxRoot\" "$OutputDir\bin\dnx\"
# Copy in the dotnet-restore script
cp "$RepoRoot\scripts\dotnet-restore.cmd" "$OutputDir\bin\dotnet-restore.cmd"
# Copy in AppDeps
$env:PATH = "$OutputDir\bin;$StartPath"
header "Acquiring Native App Dependencies"
_cmd "$RepoRoot\scripts\build\build_appdeps.cmd ""$OutputDir"""

View file

@ -92,3 +92,29 @@ cd $OUTPUT_DIR
# Fix up permissions. Sometimes they get dropped with the wrong info
find . -type f | xargs chmod 644
$REPOROOT/scripts/build/fix-mode-flags.sh
info "Crossgenning Roslyn compiler ..."
$REPOROOT/scripts/crossgen/crossgen_roslyn.sh "$OUTPUT_DIR/bin"
# Make OUTPUT_DIR Folder Accessible
chmod -R a+r $OUTPUT_DIR
# Copy DNX in to OUTPUT_DIR
cp -R $DNX_ROOT $OUTPUT_DIR/bin/dnx
# Copy and CHMOD the dotnet-restore script
cp $REPOROOT/scripts/dotnet-restore.sh $OUTPUT_DIR/bin/dotnet-restore
chmod a+x $OUTPUT_DIR/bin/dotnet-restore
# No compile native support in centos yet
# https://github.com/dotnet/cli/issues/453
if [ "$OSNAME" != "centos" ]; then
# Copy in AppDeps
header "Acquiring Native App Dependencies"
DOTNET_HOME=$OUTPUT_DIR DOTNET_TOOLS=$OUTPUT_DIR $REPOROOT/scripts/build/build_appdeps.sh "$OUTPUT_DIR/bin"
fi
# Stamp the output with the commit metadata
COMMIT=$(git rev-parse HEAD)
echo $COMMIT > $OUTPUT_DIR/.version
echo $DOTNET_BUILD_VERSION >> $OUTPUT_DIR/.version