Skip to content

Windows Build update #18

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 1, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,6 @@ sandbox
linker

# Arcade files
/artifacts/toolset
/artifacts
/.packages
/.dotnet
6 changes: 1 addition & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ include(clrdefinitions.cmake)
#-------------------------------------
# Include the basic prebuilt headers - required for getting fileversion resource details.
include_directories("src/pal/prebuilt/inc")
include_directories("artifacts/bin/obj")
include_directories("artifacts/obj")

if(FEATURE_STANDALONE_GC)
add_definitions(-DFEATURE_STANDALONE_GC)
Expand All @@ -221,10 +221,6 @@ if (CLR_CMAKE_PLATFORM_UNIX)
include_directories("src/pal/src/safecrt")
endif (CLR_CMAKE_PLATFORM_UNIX)

# Microsoft.Dotnet.BuildTools.Coreclr version
set(BuildToolsVersion "1.0.4-prerelease")
set(BuildToolsDir "${CLR_CMAKE_PACKAGES_DIR}/Microsoft.DotNet.BuildTools.CoreCLR/${BuildToolsVersion}")

#------------------------------
# Add Product Directory
#------------------------------
Expand Down
6 changes: 3 additions & 3 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
<!-- ToolSetCommonDirectory: Set a restore location for the sdk's tools -->
<!-- this will be used by package creation -->
<PropertyGroup>
<BaseOutputPath>$(MSBuildThisFileDirectory)/artifacts/Product/$(BuildOS)/</BaseOutputPath>
<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)' == ''">$(RootArtifactsDir)obj/$(BuildOS)/$(BuildArch)/$(BuildType)/$(MSBuildProjectName)/</BaseIntermediateOutputPath>
<BaseOutputPath>$(MSBuildThisFileDirectory)/artifacts/Product/$(BuildOS)/</BaseOutputPath>
<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)' == ''">$(RootArtifactsDir)/obj/$(BuildOS)/$(BuildArch)/$(BuildType)/$(MSBuildProjectName)/</BaseIntermediateOutputPath>
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the / should be unnecessary here

<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
<ToolSetCommonDirectory>$(MSBuildThisFileDirectory)artifacts\toolset\Common\</ToolSetCommonDirectory>
</PropertyGroup>
Expand Down Expand Up @@ -92,7 +92,7 @@

<!-- Output paths -->
<PropertyGroup>
<IntermediateOutputPathNonMangled Condition="'$(IntermediateOutputPathNonMangled)' == ''">$(RootArtifactsDir)obj/$(BuildOS)/$(BuildArch)/$(BuildType)/$(MSBuildProjectName)/</IntermediateOutputPathNonMangled>
<IntermediateOutputPathNonMangled Condition="'$(IntermediateOutputPathNonMangled)' == ''">$(RootArtifactsDir)/obj/$(BuildOS)/$(BuildArch)/$(BuildType)/$(MSBuildProjectName)/</IntermediateOutputPathNonMangled>
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above / should be unnecessary

<OutputPath Condition="'$(OutputPath)' == ''">$(BinDir)</OutputPath>
</PropertyGroup>

Expand Down
1 change: 0 additions & 1 deletion build-packages.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ if NOT '%ERRORLEVEL%' == '0' exit /b 1

call %__ProjectDir%/dotnet.cmd msbuild /nologo /verbosity:minimal /clp:Summary /nodeReuse:false^
/p:__BuildOS=Windows_NT /flp:v=detailed;Append;LogFile=build-packages.log^
/l:BinClashLogger,Tools/Microsoft.DotNet.Build.Tasks.dll;LogFile=binclash.log^
/p:PortableBuild=true %__ProjectDir%\src\.nuget\packages.builds^
/p:FilterToOSGroup=Windows_NT %__MSBuildArgs% %unprocessedArgs%
if NOT [!ERRORLEVEL!]==[0] (
Expand Down
1 change: 0 additions & 1 deletion build-packages.sh
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,6 @@ fi

$__ProjectRoot/dotnet.sh msbuild /nologo /verbosity:minimal /clp:Summary \
/p:__BuildOS=$__BuildOS /flp:v=detailed\;Append\;LogFile=build-packages.log \
/l:BinClashLogger,Tools/Microsoft.DotNet.Build.Tasks.dll\;LogFile=binclash.log \
/p:PortableBuild=true src/.nuget/packages.builds \
/p:__DistroRid=$__DistroRid /p:BuildNugetPackage=false \
$buildArgs $unprocessedBuildArgs
Expand Down
49 changes: 17 additions & 32 deletions build.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -28,19 +28,8 @@ if defined VS160COMNTOOLS (
:: out the variables that might be too large.
set ghprbCommentBody=

:: Note that the msbuild project files (specifically, dir.proj) will use the following variables, if set:
:: __BuildArch -- default: x64
:: __BuildType -- default: Debug
:: __BuildOS -- default: Windows_NT
:: __ProjectDir -- default: directory of the Directory.Build.Props file
:: __SourceDir -- default: %__ProjectDir%\src\
:: __PackagesDir -- default: %__ProjectDir%\packages\
:: __RootBinDir -- default: %__ProjectDir%\bin\
:: __BinDir -- default: %__RootBinDir%\%__BuildOS%.%__BuildArch.%__BuildType%\
:: __IntermediatesDir
:: __PackagesBinDir -- default: %__BinDir%\.nuget
:: __TestWorkingDir -- default: %__RootBinDir%\tests\%__BuildOS%.%__BuildArch.%__BuildType%\
::
:: Note that the msbuild project files (specifically, dir.proj) will use the variables such as
:: __BuildArch, __ProjectDir, etc if set.
:: Thus, these variables are not simply internal to this script!

:: Set the default arguments for build
Expand All @@ -50,14 +39,15 @@ set __BuildOS=Windows_NT

:: Set the various build properties here so that CMake and MSBuild can pick them up
set "__ProjectDir=%~dp0"
set ArcadeBuild=true
:: remove trailing slash
if %__ProjectDir:~-1%==\ set "__ProjectDir=%__ProjectDir:~0,-1%"
set "__ProjectFilesDir=%__ProjectDir%"
set "__SourceDir=%__ProjectDir%\src"
set "__PackagesDir=%DotNetRestorePackagesPath%"
if [%__PackagesDir%]==[] set "__PackagesDir=%__ProjectDir%\packages"
set "__RootBinDir=%__ProjectDir%\bin"
set "__LogsDir=%__RootBinDir%\Logs"
set "__RootArtifactsDir=%__ProjectDir%\artifacts"
set "__LogsDir=%__RootArtifactsDir%\Logs\%__BuildType%"
set "__MsbuildDebugLogsDir=%__LogsDir%\MsbuildDebugLogs"

set __BuildAll=
Expand Down Expand Up @@ -271,7 +261,7 @@ if %__BuildTypeDebug%==1 set __BuildType=Debug
if %__BuildTypeChecked%==1 set __BuildType=Checked
if %__BuildTypeRelease%==1 set __BuildType=Release

set __CommonMSBuildArgs=/p:__BuildOS=%__BuildOS% /p:__BuildType=%__BuildType% /p:__BuildArch=%__BuildArch% !__SkipRestoreArg! !__OfficialBuildIdArg!
set __CommonMSBuildArgs=/p:__BuildOS=%__BuildOS% /p:__BuildType=%__BuildType% /p:__BuildArch=%__BuildArch% !__SkipRestoreArg! !__OfficialBuildIdArg! /p:ArcadeBuild=true /p:Platform=%__BuildArch%

if %__EnforcePgo%==1 (
if %__BuildArchArm%==1 (
Expand Down Expand Up @@ -303,9 +293,10 @@ if /i %__BuildType% NEQ Release set __RestoreOptData=0
REM REVIEW: why no System.Private.CoreLib NuGet package build for ARM64?
if /i "%__BuildArch%"=="arm64" set __SkipNugetPackage=0

set "__BinDir=%__RootBinDir%\Product\%__BuildOS%.%__BuildArch%.%__BuildType%"
set "__IntermediatesDir=%__RootBinDir%\obj\%__BuildOS%.%__BuildArch%.%__BuildType%"
if "%__NMakeMakefiles%"=="1" (set "__IntermediatesDir=%__RootBinDir%\nmakeobj\%__BuildOS%.%__BuildArch%.%__BuildType%")
set "__BinDir=%__RootArtifactsDir%\Product\%__BuildOS%\%__BuildArch%\%__BuildType%"
set "__IntermediatesDir=%__RootArtifactsDir%\obj\%__BuildOS%\%__BuildArch%\%__BuildType%"
set "__TestIntermediatesDir=%__RootArtifactsDir%\tests\obj\%__BuildOS%\%__BuildArch%\%__BuildType%"
if "%__NMakeMakefiles%"=="1" (set "__IntermediatesDir=%__RootArtifactsDir%\nmakeobj\%__BuildOS%\%__BuildArch%\%__BuildType%")
set "__PackagesBinDir=%__BinDir%\.nuget"
set "__CrossComponentBinDir=%__BinDir%"
set "__CrossCompIntermediatesDir=%__IntermediatesDir%\crossgen"
Expand Down Expand Up @@ -357,7 +348,6 @@ if not defined NumberOfCores (
set NumberOfCores=!TotalNumberOfCores!
)
echo %__MsgPrefix%Number of processor cores %NumberOfCores%

REM =========================================================================================
REM ===
REM === Start the build steps
Expand All @@ -367,10 +357,9 @@ REM ============================================================================
@if defined _echo @echo on

call %__ProjectDir%\dotnet.cmd msbuild /nologo /verbosity:minimal /clp:Summary /nodeReuse:false^
/l:BinClashLogger,Tools/Microsoft.DotNet.Build.Tasks.dll;LogFile=binclash.log^
/p:RestoreDefaultOptimizationDataPackage=false /p:PortableBuild=true^
/p:UsePartialNGENOptimization=false /maxcpucount^
%__ProjectDir%\build.proj /t:GenerateVersionHeader /p:GenerateVersionHeader=true /p:NativeVersionHeaderFile="%__RootBinDir%\obj\_version.h"^
%__ProjectDir%\build.proj /t:GenerateNativeVersionFile ^
%__CommonMSBuildArgs% %__UnprocessedBuildArgs%

REM =========================================================================================
Expand All @@ -381,7 +370,7 @@ REM ============================================================================

if %__RestoreOptData% EQU 1 (
echo %__MsgPrefix%Restoring the OptimizationData Package
call %__ProjectDir%\dotnet.cmd msbuild /nologo /verbosity:minimal /clp:Summary /nodeReuse:false^
call %__ProjectDir%\dotnet.cmd msbuild /nologo /verbosity:diag /clp:Summary /nodeReuse:false^
/p:RestoreDefaultOptimizationDataPackage=false /p:PortableBuild=true^
/p:UsePartialNGENOptimization=false /maxcpucount^
./build.proj /t:RestoreOptData^
Expand Down Expand Up @@ -522,8 +511,7 @@ if %__BuildNative% EQU 1 (
set __MsbuildErr=/flp2:ErrorsOnly;LogFile=!__BuildErr!
set __Logging=!__MsbuildLog! !__MsbuildWrn! !__MsbuildErr!

call %__ProjectDir%\cmake_msbuild.cmd /nologo /verbosity:minimal /clp:Summary /nodeReuse:false^
/l:BinClashLogger,Tools/net46/Microsoft.DotNet.Build.Tasks.dll;LogFile=binclash.log^
call %__ProjectDir%\cmake_msbuild.cmd /nologo /verbosity:diag /clp:Summary /nodeReuse:false^
/p:RestoreDefaultOptimizationDataPackage=false /p:PortableBuild=true^
/p:UsePartialNGENOptimization=false /maxcpucount %__IntermediatesDir%\install.vcxproj^
!__Logging! /p:Configuration=%__BuildType% /p:Platform=%__BuildArch% %__CommonMSBuildArgs% /m:2 %__UnprocessedBuildArgs%
Expand Down Expand Up @@ -589,8 +577,7 @@ if %__BuildCrossArchNative% EQU 1 (
set __MsbuildErr=/flp2:ErrorsOnly;LogFile=!__BuildErr!
set __Logging=!_MsbuildLog! !__MsbuildWrn! !__MsbuildErr!

call %__ProjectDir%\cmake_msbuild.cmd /nologo /verbosity:minimal /clp:Summary /nodeReuse:false^
/l:BinClashLogger,Tools/net46/Microsoft.DotNet.Build.Tasks.dll;LogFile=binclash.log^
call %__ProjectDir%\cmake_msbuild.cmd /nologo /verbosity:diag /clp:Summary /nodeReuse:false^
/p:RestoreDefaultOptimizationDataPackage=false /p:PortableBuild=true^
/p:UsePartialNGENOptimization=false /maxcpucount^
%__CrossCompIntermediatesDir%\install.vcxproj^
Expand Down Expand Up @@ -649,8 +636,7 @@ if %__BuildCoreLib% EQU 1 (
set __MsbuildErr=/flp2:ErrorsOnly;LogFile=!__BuildErr!
set __Logging=!__MsbuildLog! !__MsbuildWrn! !__MsbuildErr!

call %__ProjectDir%\dotnet.cmd msbuild /nologo /verbosity:minimal /clp:Summary /nodeReuse:false^
/l:BinClashLogger,Tools/Microsoft.DotNet.Build.Tasks.dll;LogFile=binclash.log^
call %__ProjectDir%\dotnet.cmd msbuild /nologo /verbosity:diag /clp:Summary /nodeReuse:false^
/p:RestoreDefaultOptimizationDataPackage=false /p:PortableBuild=true^
/p:UsePartialNGENOptimization=false /maxcpucount^
%__ProjectDir%\build.proj^
Expand Down Expand Up @@ -800,7 +786,7 @@ if %__BuildNativeCoreLib% EQU 1 (
set COMPlus_ContinueOnAssert=0
)

set NEXTCMD="%__CrossgenExe%" %__IbcTuning% /Platform_Assemblies_Paths "%__BinDir%"\IL /out "%__BinDir%\System.Private.CoreLib.dll" "%__BinDir%\IL\System.Private.CoreLib.dll"
set NEXTCMD="%__CrossgenExe%" %__IbcTuning% /Platform_Assemblies_Paths "%__BinDir%\IL" /out "%__BinDir%\System.Private.CoreLib.dll" "%__BinDir%\IL\System.Private.CoreLib.dll"
echo %__MsgPrefix%!NEXTCMD!
echo %__MsgPrefix%!NEXTCMD! >> "%__CrossGenCoreLibLog%"
!NEXTCMD! >> "%__CrossGenCoreLibLog%" 2>&1
Expand Down Expand Up @@ -848,8 +834,7 @@ if %__BuildPackages% EQU 1 (
set __Logging=!__MsbuildLog! !__MsbuildWrn! !__MsbuildErr!

REM The conditions as to what to build are captured in the builds file.
call %__ProjectDir%\dotnet.cmd msbuild /nologo /verbosity:minimal /clp:Summary /nodeReuse:false^
/l:BinClashLogger,Tools/Microsoft.DotNet.Build.Tasks.dll;LogFile=binclash.log^
call %__ProjectDir%\dotnet.cmd msbuild /nologo /verbosity:diag /clp:Summary /nodeReuse:false^
/p:RestoreDefaultOptimizationDataPackage=false /p:PortableBuild=true^
/p:UsePartialNGENOptimization=false /maxcpucount^
%__SourceDir%\.nuget\packages.builds^
Expand Down
4 changes: 2 additions & 2 deletions build.proj
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@

<Import Project="dir.traversal.targets" />

<Import Project="$(ToolsDir)clean.targets" Condition="'$(ArcadeBuild)' != 'true' " />
<Import Project="eng\Version.targets" />

<Import Project="generateversionsourcefile.targets" />
<Import Project="$(ToolsDir)clean.targets" Condition="'$(ArcadeBuild)' != 'true' " />

<!-- The following properties are in place to keep the behavior of build.cmd while we work on the dev workflow steps. -->
<PropertyGroup>
Expand Down
4 changes: 2 additions & 2 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ usage()
echo "-skipgenerateversion - disable version generation even if MSBuild is supported."
echo "-ignorewarnings - do not treat warnings as errors"
echo "-cmakeargs - user-settable additional arguments passed to CMake."
echo "-bindir - output directory (defaults to $__ProjectRoot/bin)"
echo "-bindir - output directory (defaults to $__ProjectRoot/artifacts)"
echo "-msbuildonunsupportedplatform - build managed binaries even if distro is not officially supported."
echo "-numproc - set the number of build processes."
echo "-portablebuild - pass -portablebuild=false to force a non-portable build."
Expand Down Expand Up @@ -994,7 +994,7 @@ __PackagesBinDir="$__BinDir/.nuget"
__ToolsDir="$__RootArtifactsDir/tools"
__TestWorkingDir="$__RootArtifactsDir/tests/$__BuildOS.$__BuildArch.$__BuildType"
export __IntermediatesDir="$__RootArtifactsDir/obj/${__BuildOS}/${__BuildArch}/${__BuildType}"
__TestIntermediatesDir="$__RootArtifactsDir/tests/obj/$__BuildOS.$__BuildArch.$__BuildType"
__TestIntermediatesDir="$__RootArtifactsDir/tests/obj/$__BuildOS/$__BuildArch/$__BuildType"
__isMSBuildOnNETCoreSupported=0
__CrossComponentBinDir="$__BinDir"

Expand Down
6 changes: 3 additions & 3 deletions dir.props
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@
<SourceDir Condition="'$(__SourceDir)'==''">$(ProjectDir)src\</SourceDir>

<BinDir>$(__BinDir)\</BinDir>
<BinDir Condition="'$(__BinDir)'==''">$(RootBinDir)Product\$(BuildOS)\$(BuildArch)\$(BuildType)\</BinDir>
<BinDir Condition="'$(__BinDir)'==''">$(__RootArtifactsDir)Product\$(BuildOS)\$(BuildArch)\$(BuildType)\</BinDir>

<__IntermediatesDir Condition="'$(__IntermediatesDir)' == ''">$(RootBinDir)obj\$(BuildOS)\$(BuildArch)\$(BuildType)</__IntermediatesDir>
<__IntermediatesDir Condition="'$(__IntermediatesDir)' == ''">$(__RootArtifactsDir)\obj\$(BuildOS)\$(BuildArch)\$(BuildType)</__IntermediatesDir>
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

\ should be unnecessary

<IntermediateOutputRootPath Condition="'$(IntermediateOutputRootPath)' == ''">$(__IntermediatesDir)\</IntermediateOutputRootPath>

<!-- We don't append back slash because this path is used by nuget.exe as output directory and it
Expand Down Expand Up @@ -73,7 +73,7 @@

<!-- Output paths -->
<PropertyGroup>
<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)' == ''">$(RootBinDir)obj\</BaseIntermediateOutputPath>
<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)' == ''">$(__RootArtifactsDir)obj\</BaseIntermediateOutputPath>
<IntermediateOutputPath Condition="'$(IntermediateOutputPath)' == ''">$(BaseIntermediateOutputPath)$(BuildOS)\$(BuildArch)\$(BuildType)\$(MSBuildProjectName)</IntermediateOutputPath>
<IntermediateOutputPathNonMangled Condition="'$(IntermediateOutputPathNonMangled)' == ''">$(RootBinDir)obj\$(BuildOS)\$(BuildArch)\$(BuildType)\$(MSBuildProjectName)\</IntermediateOutputPathNonMangled>
<OutputPath Condition="'$(OutputPath)' == ''">$(BinDir)</OutputPath>
Expand Down
Loading