Fixed a few issues around bootstrapping

- Work aronud coreconsole issue in the bootstrap.cmd
- Use msbuild 14 roslyn csc until we have it
- Remove quoting args when building project refs, it wasn't working
- Fixed logic that launched exe's directly
This commit is contained in:
David Fowler 2015-10-16 04:21:40 -07:00
parent cbb8414b16
commit 64f539e100
4 changed files with 12 additions and 20 deletions

View file

@ -14,14 +14,6 @@ set STAGE1_DIR=%REPOROOT%\artifacts\stage1
set STAGE2_DIR=%REPOROOT%\artifacts\stage2 set STAGE2_DIR=%REPOROOT%\artifacts\stage2
set DOTNET_PUBLISH=%REPOROOT%\scripts\dnxhost\dotnet-publish.cmd set DOTNET_PUBLISH=%REPOROOT%\scripts\dnxhost\dotnet-publish.cmd
REM TEMPORARY!
if not defined DOTNET_CORE_CONSOLE_PATH (
if exist "%REPOROOT%\..\coreclr" (
set DOTNET_CORE_CONSOLE_PATH=%REPOROOT%\..\coreclr\bin\Product\Windows_NT.x64.Debug\CoreConsole.exe
)
)
if not exist "%DOTNET_CORE_CONSOLE_PATH%" goto missing_coreconsole
where dnvm >nul 2>nul where dnvm >nul 2>nul
if %errorlevel% == 0 goto have_dnvm if %errorlevel% == 0 goto have_dnvm
@ -69,6 +61,13 @@ set PATH=%STAGE1_DIR%;%PATH%
if exist %STAGE2_DIR% rd /s /q %STAGE2_DIR% if exist %STAGE2_DIR% rd /s /q %STAGE2_DIR%
REM This works around the coreconsole bug where the path to the exe can't be found
pushd
cd %STAGE1_DIR%
REM Work around for not having the latest CSC yet
set PATH=%ProgramFiles(x86)%\MSBuild\14.0\Bin;%PATH%
echo Building stage2 dotnet.exe ... echo Building stage2 dotnet.exe ...
dotnet publish --framework dnxcore50 --runtime win7-x64 --output "%STAGE2_DIR%" "%REPOROOT%\src\Microsoft.DotNet.Cli" dotnet publish --framework dnxcore50 --runtime win7-x64 --output "%STAGE2_DIR%" "%REPOROOT%\src\Microsoft.DotNet.Cli"
if errorlevel 1 goto fail if errorlevel 1 goto fail
@ -82,6 +81,7 @@ dotnet publish --framework dnxcore50 --runtime win7-x64 --output "%STAGE2_DIR%"
if errorlevel 1 goto fail if errorlevel 1 goto fail
echo Bootstrapped dotnet to %STAGE2_DIR% echo Bootstrapped dotnet to %STAGE2_DIR%
popd
goto end goto end
@ -89,12 +89,4 @@ goto end
echo Bootstrapping failed... echo Bootstrapping failed...
exit /B 1 exit /B 1
:missing_coreconsole
echo Bootstrapping temporarily requires a patched CoreConsole to workaround
echo this issue: https://github.com/dotnet/coreclr/issues/1771
echo Either clone dotnet/coreclr to a sibling directory of this repo called
echo "coreclr" and build it, or put the path to the patched version of
echo CoreConsole in the DOTNET_CORE_CONSOLE_PATH environment variable
exit /B 1
:end :end

View file

@ -3,7 +3,7 @@ SETLOCAL
SET ERRORLEVEL= SET ERRORLEVEL=
REM makes testing easier for now REM makes testing easier for now
set PATH=%PATH%;%~dp0 set PATH=%ProgramFiles(x86)%\MSBuild\14.0\Bin;%PATH%;%~dp0
dnx %DOTNET_OPTIONS% -p %~dp0..\..\src\Microsoft.DotNet.Tools.Compiler run %* dnx %DOTNET_OPTIONS% -p %~dp0..\..\src\Microsoft.DotNet.Tools.Compiler run %*

View file

@ -77,9 +77,9 @@ namespace Microsoft.DotNet.Cli.Utils
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
{ {
var extension = Path.GetExtension(executable); var extension = Path.GetExtension(executable);
if (!string.IsNullOrEmpty(executable)) if (!string.IsNullOrEmpty(extension))
{ {
return string.Equals(executable, ".exe", StringComparison.Ordinal); return !string.Equals(extension, ".exe", StringComparison.Ordinal);
} }
else if (executable.Contains(Path.DirectorySeparatorChar)) else if (executable.Contains(Path.DirectorySeparatorChar))
{ {

View file

@ -82,7 +82,7 @@ namespace Microsoft.DotNet.Tools.Compiler
var projectDependency = dependency.Library as ProjectDescription; var projectDependency = dependency.Library as ProjectDescription;
if (projectDependency != null && !string.Equals(projectDependency.Identity.Name, context.RootProject.Identity.Name, StringComparison.Ordinal)) if (projectDependency != null && !string.Equals(projectDependency.Identity.Name, context.RootProject.Identity.Name, StringComparison.Ordinal))
{ {
var compileResult = Command.Create("dotnet-compile", $"--framework \"{projectDependency.Framework}\" --configuration \"{configuration}\" {projectDependency.Project.ProjectDirectory}") var compileResult = Command.Create("dotnet-compile", $"--framework {projectDependency.Framework} --configuration {configuration} {projectDependency.Project.ProjectDirectory}")
.ForwardStdOut() .ForwardStdOut()
.ForwardStdErr() .ForwardStdErr()
.RunAsync() .RunAsync()