diff options
author | Manish Godse <61718172+mangod9@users.noreply.github.com> | 2020-09-28 07:22:59 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-28 07:22:59 +0300 |
commit | 244d93906c7fb7eae0757d18364dcc8539f3afc3 (patch) | |
tree | 19f9a2025a5044d18624e47f99d7f1f6f11a3602 /src/coreclr | |
parent | ae1b1be2ba3147758345062f9e78afb8cc2ff39b (diff) |
Get builds working when paths contain whitespaces and utf8 chars (#42671)
* Fix to get builds working for paths with whitespaces
Currently builds clr+libs when space exists in repo folder. non-ascii should also be supported.
Validated only of windows
mono is still failing.
* fix midl to not emit full path in generated headers
* avoid full filenames in python source generator
* Fix ilasm target to support folders with spaces.
* update targets for ILDASM
Diffstat (limited to 'src/coreclr')
-rw-r--r-- | src/coreclr/build-runtime.cmd | 42 | ||||
-rw-r--r-- | src/coreclr/crossgen-corelib.cmd | 2 | ||||
-rw-r--r-- | src/coreclr/src/.nuget/Microsoft.NET.Sdk.IL/targets/Microsoft.NET.Sdk.IL.targets | 6 | ||||
-rw-r--r-- | src/coreclr/src/ToolBox/SOS/DacTableGen/CMakeLists.txt | 2 | ||||
-rw-r--r-- | src/coreclr/src/inc/CMakeLists.txt | 2 | ||||
-rw-r--r-- | src/coreclr/src/scripts/genEventPipe.py | 8 |
6 files changed, 31 insertions, 31 deletions
diff --git a/src/coreclr/build-runtime.cmd b/src/coreclr/build-runtime.cmd index b867df93290..d7fbc1f1275 100644 --- a/src/coreclr/build-runtime.cmd +++ b/src/coreclr/build-runtime.cmd @@ -10,7 +10,7 @@ echo %__MsgPrefix%Starting Build at %TIME% set __ThisScriptFull="%~f0" set __ThisScriptDir="%~dp0" -call "%__ThisScriptDir%"\setup_vs_tools.cmd +call %__ThisScriptDir%\setup_vs_tools.cmd if NOT '%ERRORLEVEL%' == '0' goto ExitWithError if defined VS160COMNTOOLS ( @@ -301,8 +301,8 @@ if not exist "%__IntermediatesDir%" md "%__IntermediatesDir%" if not exist "%__LogsDir%" md "%__LogsDir%" if not exist "%__MsbuildDebugLogsDir%" md "%__MsbuildDebugLogsDir%" -if not exist "%__RootBinDir%\Directory.Build.props" copy %__ProjectDir%\EmptyProps.props %__RootBinDir%\Directory.Build.props -if not exist "%__RootBinDir%\Directory.Build.targets" copy %__ProjectDir%\EmptyProps.props %__RootBinDir%\Directory.Build.targets +if not exist "%__RootBinDir%\Directory.Build.props" copy "%__ProjectDir%\EmptyProps.props" "%__RootBinDir%\Directory.Build.props" +if not exist "%__RootBinDir%\Directory.Build.targets" copy "%__ProjectDir%\EmptyProps.props" "%__RootBinDir%\Directory.Build.targets" REM Set up the directory for MSBuild debug logs. set MSBUILDDEBUGPATH=%__MsbuildDebugLogsDir% @@ -343,9 +343,9 @@ REM ============================================================================ if %__SkipGenerateVersion% EQU 0 ( echo %__MsgPrefix%Generating native version headers - set "__BinLog=%__LogsDir%\GenerateVersionHeaders_%__TargetOS%__%__BuildArch%__%__BuildType%.binlog" + set "__BinLog=\"%__LogsDir%\GenerateVersionHeaders_%__TargetOS%__%__BuildArch%__%__BuildType%.binlog\"" powershell -NoProfile -ExecutionPolicy ByPass -NoLogo -File "%__RepoRootDir%\eng\common\msbuild.ps1" /clp:nosummary %__ArcadeScriptArgs%^ - %__RepoRootDir%\eng\empty.csproj /t:GenerateRuntimeVersionFile /restore^ + "%__RepoRootDir%\eng\empty.csproj" /t:GenerateRuntimeVersionFile /restore^ /p:NativeVersionFile="%__RootBinDir%\obj\coreclr\_version.h"^ /p:RuntimeVersionFile="%__RootBinDir%\obj\coreclr\runtime_version.h"^ %__CommonMSBuildArgs% %__UnprocessedBuildArgs% /bl:!__BinLog! @@ -365,9 +365,9 @@ REM ============================================================================ set OptDataProjectFilePath=%__ProjectDir%\src\.nuget\optdata\optdata.csproj if %__RestoreOptData% EQU 1 ( echo %__MsgPrefix%Restoring the OptimizationData Package - set "__BinLog=%__LogsDir%\OptRestore_%__TargetOS%__%__BuildArch%__%__BuildType%.binlog" + set "__BinLog=\"%__LogsDir%\OptRestore_%__TargetOS%__%__BuildArch%__%__BuildType%.binlog\"" powershell -NoProfile -ExecutionPolicy ByPass -NoLogo -File "%__RepoRootDir%\eng\common\msbuild.ps1" /clp:nosummary %__ArcadeScriptArgs%^ - %OptDataProjectFilePath% /t:Restore^ + "%OptDataProjectFilePath%" /t:Restore^ %__CommonMSBuildArgs% %__UnprocessedBuildArgs%^ /nodereuse:false /bl:!__BinLog! if not !errorlevel! == 0 ( @@ -378,8 +378,8 @@ if %__RestoreOptData% EQU 1 ( ) set __PgoOptDataPath= if %__PgoOptimize% EQU 1 ( - set PgoDataPackagePathOutputFile="%__IntermediatesDir%\optdatapath.txt" - set "__BinLog=%__LogsDir%\PgoVersionRead_%__TargetOS%__%__BuildArch%__%__BuildType%.binlog" + set PgoDataPackagePathOutputFile=%__IntermediatesDir%\optdatapath.txt + set "__BinLog=\"%__LogsDir%\PgoVersionRead_%__TargetOS%__%__BuildArch%__%__BuildType%.binlog\"" REM Parse the optdata package versions out of msbuild so that we can pass them on to CMake powershell -NoProfile -ExecutionPolicy ByPass -NoLogo -File "%__RepoRootDir%\eng\common\msbuild.ps1" /clp:nosummary %__ArcadeScriptArgs%^ @@ -460,7 +460,7 @@ if %__BuildCrossArchNative% EQU 1 ( if /i "%__CrossArch2%" == "x86" ( set __VCBuildArch=x86 ) if /i "%__CrossArch2%" == "x64" ( set __VCBuildArch=x86_amd64 ) - set __CMakeBinDir=%__CrossComponent2BinDir% + set __CMakeBinDir="%__CrossComponent2BinDir%" set "__CMakeBinDir=!__CMakeBinDir:\=/!" set __ExtraCmakeArgs=%__CMakeClrBuildSubsetArgs% "-DCLR_CROSS_COMPONENTS_BUILD=1" "-DCLR_CMAKE_TARGET_ARCH=%__BuildArch%" "-DCLR_CMAKE_TARGET_OS=%__TargetOS%" "-DCLR_CMAKE_PGO_INSTRUMENT=0" "-DCLR_CMAKE_OPTDATA_PATH=%__PgoOptDataPath%" "-DCLR_CMAKE_PGO_OPTIMIZE=0" "-DCMAKE_SYSTEM_VERSION=10.0" "-DCLR_ENG_NATIVE_DIR=%__RepoRootDir%/eng/native" "-DCLR_REPO_ROOT_DIR=%__RepoRootDir%" %__CMakeArgs% call "%__SourceDir%\pal\tools\gen-buildsys.cmd" "%__ProjectDir%" "%__CrossComp2IntermediatesDir%" %__VSVersion% %__CrossArch2% !__ExtraCmakeArgs! @@ -491,10 +491,10 @@ if %__BuildCrossArchNative% EQU 1 ( if defined __ConfigureOnly goto SkipCrossCompBuild set __BuildLogRootName=Cross - set "__BuildLog=%__LogsDir%\!__BuildLogRootName!_%__TargetOS%__%__BuildArch%__%__BuildType%.log" - set "__BuildWrn=%__LogsDir%\!__BuildLogRootName!_%__TargetOS%__%__BuildArch%__%__BuildType%.wrn" - set "__BuildErr=%__LogsDir%\!__BuildLogRootName!_%__TargetOS%__%__BuildArch%__%__BuildType%.err" - set "__BinLog=%__LogsDir%\!__BuildLogRootName!_%__TargetOS%__%__BuildArch%__%__BuildType%.binlog" + set "__BuildLog="%__LogsDir%\!__BuildLogRootName!_%__TargetOS%__%__BuildArch%__%__BuildType%.log"" + set "__BuildWrn="%__LogsDir%\!__BuildLogRootName!_%__TargetOS%__%__BuildArch%__%__BuildType%.wrn"" + set "__BuildErr="%__LogsDir%\!__BuildLogRootName!_%__TargetOS%__%__BuildArch%__%__BuildType%.err"" + set "__BinLog="%__LogsDir%\!__BuildLogRootName!_%__TargetOS%__%__BuildArch%__%__BuildType%.binlog"" set "__MsbuildLog=/flp:Verbosity=normal;LogFile=!__BuildLog!" set "__MsbuildWrn=/flp1:WarningsOnly;LogFile=!__BuildWrn!" set "__MsbuildErr=/flp2:ErrorsOnly;LogFile=!__BuildErr!" @@ -502,7 +502,7 @@ if %__BuildCrossArchNative% EQU 1 ( set "__Logging=!__MsbuildLog! !__MsbuildWrn! !__MsbuildErr! !__MsbuildBinLog! !__ConsoleLoggingParameters!" REM We pass the /m flag directly to MSBuild so that we can get both MSBuild and CL parallelism, which is fastest for our builds. - "%CMakePath%" --build %__CrossCompIntermediatesDir% --target install --config %__BuildType% -- /nologo /m !__Logging! + "%CMakePath%" --build "%__CrossCompIntermediatesDir%" --target install --config %__BuildType% -- /nologo /m !__Logging! if not !errorlevel! == 0 ( set __exitCode=!errorlevel! @@ -526,7 +526,7 @@ if %__BuildCrossArchNative% EQU 1 ( set "__Logging=!__MsbuildLog! !__MsbuildWrn! !__MsbuildErr! !__MsbuildBinLog! !__ConsoleLoggingParameters!" REM We pass the /m flag directly to MSBuild so that we can get both MSBuild and CL parallelism, which is fastest for our builds. - "%CMakePath%" --build %__CrossComp2IntermediatesDir% --target install --config %__BuildType% -- /nologo /m !__Logging! + "%CMakePath%" --build "%__CrossComp2IntermediatesDir%" --target install --config %__BuildType% -- /nologo /m !__Logging! if not !errorlevel! == 0 ( set __exitCode=!errorlevel! @@ -599,10 +599,10 @@ if %__BuildNative% EQU 1 ( if defined __ConfigureOnly goto SkipNativeBuild set __BuildLogRootName=CoreCLR - set "__BuildLog=%__LogsDir%\!__BuildLogRootName!_%__TargetOS%__%__BuildArch%__%__BuildType%.log" - set "__BuildWrn=%__LogsDir%\!__BuildLogRootName!_%__TargetOS%__%__BuildArch%__%__BuildType%.wrn" - set "__BuildErr=%__LogsDir%\!__BuildLogRootName!_%__TargetOS%__%__BuildArch%__%__BuildType%.err" - set "__BinLog=%__LogsDir%\!__BuildLogRootName!_%__TargetOS%__%__BuildArch%__%__BuildType%.binlog" + set "__BuildLog="%__LogsDir%\!__BuildLogRootName!_%__TargetOS%__%__BuildArch%__%__BuildType%.log"" + set "__BuildWrn="%__LogsDir%\!__BuildLogRootName!_%__TargetOS%__%__BuildArch%__%__BuildType%.wrn"" + set "__BuildErr="%__LogsDir%\!__BuildLogRootName!_%__TargetOS%__%__BuildArch%__%__BuildType%.err"" + set "__BinLog="%__LogsDir%\!__BuildLogRootName!_%__TargetOS%__%__BuildArch%__%__BuildType%.binlog"" set "__MsbuildLog=/flp:Verbosity=normal;LogFile=!__BuildLog!" set "__MsbuildWrn=/flp1:WarningsOnly;LogFile=!__BuildWrn!" set "__MsbuildErr=/flp2:ErrorsOnly;LogFile=!__BuildErr!" @@ -610,7 +610,7 @@ if %__BuildNative% EQU 1 ( set "__Logging=!__MsbuildLog! !__MsbuildWrn! !__MsbuildErr! !__MsbuildBinLog! !__ConsoleLoggingParameters!" REM We pass the /m flag directly to MSBuild so that we can get both MSBuild and CL parallelism, which is fastest for our builds. - "%CMakePath%" --build %__IntermediatesDir% --target install --config %__BuildType% -- /nologo /m !__Logging! + "%CMakePath%" --build "%__IntermediatesDir%" --target install --config %__BuildType% -- /nologo /m !__Logging! if not !errorlevel! == 0 ( set __exitCode=!errorlevel! diff --git a/src/coreclr/crossgen-corelib.cmd b/src/coreclr/crossgen-corelib.cmd index 64957d7757e..c153745ea91 100644 --- a/src/coreclr/crossgen-corelib.cmd +++ b/src/coreclr/crossgen-corelib.cmd @@ -8,7 +8,7 @@ set "__MsgPrefix=CROSSGEN-CORELIB: " echo %__MsgPrefix%Starting Build at %TIME% set __ThisScriptFull="%~f0" -set __ThisScriptDir="%~dp0" +set __ThisScriptDir=%~dp0 :: Note that the msbuild project files (specifically, dir.proj) will use the following variables, if set: :: __BuildArch -- default: x64 diff --git a/src/coreclr/src/.nuget/Microsoft.NET.Sdk.IL/targets/Microsoft.NET.Sdk.IL.targets b/src/coreclr/src/.nuget/Microsoft.NET.Sdk.IL/targets/Microsoft.NET.Sdk.IL.targets index 3389fc58149..4cbdc29d821 100644 --- a/src/coreclr/src/.nuget/Microsoft.NET.Sdk.IL/targets/Microsoft.NET.Sdk.IL.targets +++ b/src/coreclr/src/.nuget/Microsoft.NET.Sdk.IL/targets/Microsoft.NET.Sdk.IL.targets @@ -79,7 +79,7 @@ Copyright (c) .NET Foundation. All rights reserved. <Error Condition="'@(ILResourceReference->Count())' != '1'" Text="Only one ILResourceReference can be specified" /> <PropertyGroup> <_ilResourceReference>%(ILResourceReference.FullPath)</_ilResourceReference> - <_IldasmCommand>$(_IldasmDir)ildasm</_IldasmCommand> + <_IldasmCommand>"$(_IldasmDir)ildasm"</_IldasmCommand> <_IldasmCommand>$(_IldasmCommand) "$(_ilResourceReference)"</_IldasmCommand> <_IldasmCommand>$(_IldasmCommand) /OUT="$(IntermediateOutputPath)/$(MSBuildProjectName).ref.il"</_IldasmCommand> @@ -132,10 +132,10 @@ Copyright (c) .NET Foundation. All rights reserved. <_IlasmSwitches Condition="'$(DebugType)' == 'Impl'">$(_IlasmSwitches) -DEBUG=IMPL</_IlasmSwitches> <_IlasmSwitches Condition="'$(DebugType)' == 'PdbOnly'">$(_IlasmSwitches) -DEBUG=OPT</_IlasmSwitches> <_IlasmSwitches Condition="'$(Optimize)' == 'True'">$(_IlasmSwitches) -OPTIMIZE</_IlasmSwitches> - <_IlasmSwitches Condition="'$(IlasmResourceFile)' != ''">$(_IlasmSwitches) -RESOURCES=$(IlasmResourceFile)</_IlasmSwitches> + <_IlasmSwitches Condition="'$(IlasmResourceFile)' != ''">$(_IlasmSwitches) -RESOURCES="$(IlasmResourceFile)"</_IlasmSwitches> </PropertyGroup> - <Exec Command="$(_IlasmDir)ilasm $(_IlasmSwitches) $(_OutputTypeArgument) $(IlasmFlags) -OUTPUT="@(IntermediateAssembly)" $(_KeyFileArgument) @(Compile, ' ')"> + <Exec Command=""$(_IlasmDir)ilasm" $(_IlasmSwitches) $(_OutputTypeArgument) $(IlasmFlags) -OUTPUT="@(IntermediateAssembly)" $(_KeyFileArgument) @(Compile, ' ')"> <Output TaskParameter="ExitCode" PropertyName="_ILAsmExitCode" /> </Exec> diff --git a/src/coreclr/src/ToolBox/SOS/DacTableGen/CMakeLists.txt b/src/coreclr/src/ToolBox/SOS/DacTableGen/CMakeLists.txt index 98cc178b8a3..a38e6a6be3a 100644 --- a/src/coreclr/src/ToolBox/SOS/DacTableGen/CMakeLists.txt +++ b/src/coreclr/src/ToolBox/SOS/DacTableGen/CMakeLists.txt @@ -11,7 +11,7 @@ FIND_PROGRAM(TLBIMP tlbimp.exe) FIND_PROGRAM(MIDL midl.exe) add_custom_command( OUTPUT "${DIALib}" - COMMAND ${MIDL} /I "${DIASDK_DIR}/include" "${DIASDK_DIR}/idl/dia2.idl" /tlb "${CMAKE_CURRENT_BINARY_DIR}/dia2.tlb" + COMMAND ${MIDL} /no_stamp /I "${DIASDK_DIR}/include" "${DIASDK_DIR}/idl/dia2.idl" /tlb "${CMAKE_CURRENT_BINARY_DIR}/dia2.tlb" COMMAND ${TLBIMP} dia2.tlb /out:"${DIALib}" ) add_custom_target(gen_dialib DEPENDS "${DIALib}") diff --git a/src/coreclr/src/inc/CMakeLists.txt b/src/coreclr/src/inc/CMakeLists.txt index 4f75d3a882d..456cdf90965 100644 --- a/src/coreclr/src/inc/CMakeLists.txt +++ b/src/coreclr/src/inc/CMakeLists.txt @@ -29,7 +29,7 @@ if(CLR_CMAKE_HOST_WIN32) set(OUT_NAME ${CMAKE_CURRENT_BINARY_DIR}/idls_out/${IDLNAME}_i.c) list(APPEND CORGUIDS_SOURCES ${OUT_NAME}) add_custom_command(OUTPUT ${OUT_NAME} - COMMAND ${MIDL} ${MIDL_INCLUDE_DIRECTORIES} /h ${CMAKE_CURRENT_BINARY_DIR}/idls_out/${IDLNAME}.h ${MIDL_DEFINITIONS} /out ${CMAKE_CURRENT_BINARY_DIR}/idls_out ${CMAKE_CURRENT_SOURCE_DIR}/${GENERATE_IDL} + COMMAND ${MIDL} ${MIDL_INCLUDE_DIRECTORIES} /no_stamp /h ${CMAKE_CURRENT_BINARY_DIR}/idls_out/${IDLNAME}.h ${MIDL_DEFINITIONS} /out ${CMAKE_CURRENT_BINARY_DIR}/idls_out ${CMAKE_CURRENT_SOURCE_DIR}/${GENERATE_IDL} DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${GENERATE_IDL} COMMENT "Compiling ${GENERATE_IDL}") endforeach(GENERATE_IDL) diff --git a/src/coreclr/src/scripts/genEventPipe.py b/src/coreclr/src/scripts/genEventPipe.py index 86d0dfea4a8..d8c6cdca24f 100644 --- a/src/coreclr/src/scripts/genEventPipe.py +++ b/src/coreclr/src/scripts/genEventPipe.py @@ -392,10 +392,10 @@ def generateEventPipeImplFiles( eventpipeImpl.write(stdprolog_cpp) header = """ -#include "{root:s}/vm/common.h" -#include "{root:s}/vm/eventpipeprovider.h" -#include "{root:s}/vm/eventpipeevent.h" -#include "{root:s}/vm/eventpipe.h" +#include <common.h> +#include <eventpipeprovider.h> +#include <eventpipeevent.h> +#include <eventpipe.h> #if defined(TARGET_UNIX) #define wcslen PAL_wcslen |