From ef4f62c87d72af6d10b5d0451a18a4e6a47cfa32 Mon Sep 17 00:00:00 2001 From: piotrp Date: Mon, 4 Jan 2016 14:17:15 -0800 Subject: [PATCH 1/2] Enable crossgen of Stage 1 compiler Eliminate differences between compiling stage 1 and stage 2 to reduce complexity --- scripts/compile/compile-stage-1.ps1 | 3 --- scripts/compile/compile-stage-2.ps1 | 15 --------------- scripts/compile/compile-stage-2.sh | 30 ++--------------------------- scripts/compile/compile-stage.ps1 | 15 +++++++++++++++ scripts/compile/compile-stage.sh | 26 +++++++++++++++++++++++++ 5 files changed, 43 insertions(+), 46 deletions(-) diff --git a/scripts/compile/compile-stage-1.ps1 b/scripts/compile/compile-stage-1.ps1 index 7ee5cc7b1..7224bd5db 100644 --- a/scripts/compile/compile-stage-1.ps1 +++ b/scripts/compile/compile-stage-1.ps1 @@ -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 \ No newline at end of file diff --git a/scripts/compile/compile-stage-2.ps1 b/scripts/compile/compile-stage-2.ps1 index 0c211c3c2..ba272ea62 100644 --- a/scripts/compile/compile-stage-2.ps1 +++ b/scripts/compile/compile-stage-2.ps1 @@ -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 \ No newline at end of file diff --git a/scripts/compile/compile-stage-2.sh b/scripts/compile/compile-stage-2.sh index df9e22c88..521d1ae22 100755 --- a/scripts/compile/compile-stage-2.sh +++ b/scripts/compile/compile-stage-2.sh @@ -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 \ No newline at end of file diff --git a/scripts/compile/compile-stage.ps1 b/scripts/compile/compile-stage.ps1 index 06756bea4..9c4b7f4ee 100644 --- a/scripts/compile/compile-stage.ps1 +++ b/scripts/compile/compile-stage.ps1 @@ -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 2 +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""" \ No newline at end of file diff --git a/scripts/compile/compile-stage.sh b/scripts/compile/compile-stage.sh index 0e91a377f..a91208e49 100755 --- a/scripts/compile/compile-stage.sh +++ b/scripts/compile/compile-stage.sh @@ -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 \ No newline at end of file From f4b31b80d9582dd5adc18152867ba820b858c281 Mon Sep 17 00:00:00 2001 From: piotrp Date: Mon, 4 Jan 2016 14:30:52 -0800 Subject: [PATCH 2/2] Fix comment --- scripts/compile/compile-stage.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/compile/compile-stage.ps1 b/scripts/compile/compile-stage.ps1 index 9c4b7f4ee..a20d38370 100644 --- a/scripts/compile/compile-stage.ps1 +++ b/scripts/compile/compile-stage.ps1 @@ -90,7 +90,7 @@ $BinariesForCoreHost | ForEach-Object { header "Crossgening Roslyn compiler ..." _cmd "$RepoRoot\scripts\crossgen\crossgen_roslyn.cmd ""$OutputDir""" -# Copy dnx into stage 2 +# Copy dnx into stage OutputDir cp -rec "$DnxRoot\" "$OutputDir\bin\dnx\" # Copy in the dotnet-restore script