Enable crossgen of Stage 1 compiler

Eliminate differences between compiling stage 1 and stage 2 to reduce complexity
This commit is contained in:
piotrp 2016-01-04 14:17:15 -08:00
parent 20205c4f02
commit ef4f62c87d
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 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"""

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