Skip to content

Commit 69e114c

Browse files
authored
December infra rollout - remove duplicated 'src' from coreclr subrepo (src/coreclr/src becomes src/coreclr) (#44973)
* Move src/coreclr/src/Directory.Build.targets to src/coreclr Merge src/coreclr/src/CMakeLists.txt into src/coreclr/CMakeLists.txt * Mechanical move of src/coreclr/src to src/coreclr * Scripts adjustments to reflect the changed paths
1 parent 0ec0794 commit 69e114c

File tree

5,169 files changed

+207
-216
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

5,169 files changed

+207
-216
lines changed

.gitignore

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,9 @@ dlldata.c
8484
*.svclog
8585
*.scc
8686

87+
# Special file
88+
!src/coreclr/.nuget/_.pdb
89+
8790
# Chutzpah Test files
8891
_Chutzpah*
8992

@@ -133,9 +136,6 @@ AutoTest.Net/
133136
# Web workbench (sass)
134137
.sass-cache/
135138

136-
# BenchmarkDotNet
137-
BenchmarkDotNet.Artifacts/
138-
139139
# Installshield output folder
140140
[Ee]xpress/
141141

@@ -295,10 +295,10 @@ prime/
295295
stage/
296296

297297
# CLR prebuilt generated files
298-
!src/pal/prebuilt/idl/*_i.c
298+
!pal/prebuilt/idl/*_i.c
299299

300300
# Valid 'debug' folder, that contains CLR debugging code
301-
!src/debug
301+
!debug
302302

303303
# Ignore folders created by the CLR test build
304304
TestWrappers_x64_[d|D]ebug
@@ -313,7 +313,6 @@ TestWrappers_arm_[r|R]elease
313313
TestWrappers_arm64_[d|D]ebug
314314
TestWrappers_arm64_[c|C]hecked
315315
TestWrappers_arm64_[r|R]elease
316-
tests/src/common/test_runtime/project.json
317316

318317
Vagrantfile
319318
.vagrant
@@ -333,7 +332,7 @@ cross/android-rootfs/*
333332
*.pyc
334333

335334
# JIT32 files
336-
src/jit32
335+
jit32
337336

338337
# performance testing sandbox
339338
sandbox
@@ -344,17 +343,23 @@ linker
344343
# Symbolic link for the shared portion of CoreLib to make grep/findstr work for runtime devs
345344
#
346345
# On Windows, make your own by running these commands from the repo root:
347-
# mklink /D src\coreclr\src\System.Private.CoreLib\shared %CD%\src\libraries\System.Private.CoreLib\src
348-
# mklink /D src\coreclr\src\System.Private.CoreLib\common %CD%\src\libraries\Common\src
346+
# mklink /D src\coreclr\System.Private.CoreLib\shared %CD%\src\libraries\System.Private.CoreLib\src
347+
# mklink /D src\coreclr\System.Private.CoreLib\common %CD%\src\libraries\Common\src
349348
#
350349
# On Unix, make your own by running these commands from the repo root:
351-
# ln -s $(pwd)/src/libraries/System.Private.CoreLib/src src/coreclr/src/System.Private.CoreLib/shared
352-
# ln -s $(pwd)/src/libraries/Common/src src/coreclr/src/System.Private.CoreLib/common
353-
src/coreclr/src/System.Private.CoreLib/shared
354-
src/coreclr/src/System.Private.CoreLib/common
350+
# ln -s $(pwd)/src/libraries/System.Private.CoreLib/src src/coreclr/System.Private.CoreLib/shared
351+
# ln -s $(pwd)/src/libraries/Common/src src/coreclr/System.Private.CoreLib/common
352+
src/coreclr/System.Private.CoreLib/shared
353+
src/coreclr/System.Private.CoreLib/common
355354

356355
# The debug directory should not be ignored
357-
!src/coreclr/src/debug
356+
!src/coreclr/debug
357+
358+
# Exceptions to the exclusions
359+
!src/coreclr/.nuget/_.pdb
360+
!src/coreclr/inc/obj/
361+
!src/coreclr/vm/.vscode/
362+
!src/coreclr/vm/.vscode/c_cpp_properties.json
358363

359364
# Mono Wasm-specific excludes
360365
src/mono/wasm/emsdk/

Directory.Build.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747

4848
<!-- System.Private.CoreLib -->
4949
<CoreLibSharedDir>$([MSBuild]::NormalizeDirectory('$(LibrariesProjectRoot)', 'System.Private.CoreLib', 'src'))</CoreLibSharedDir>
50-
<CoreLibProject Condition="'$(RuntimeFlavor)' == 'CoreCLR'">$([MSBuild]::NormalizePath('$(CoreClrProjectRoot)', 'src', 'System.Private.CoreLib', 'System.Private.CoreLib.csproj'))</CoreLibProject>
50+
<CoreLibProject Condition="'$(RuntimeFlavor)' == 'CoreCLR'">$([MSBuild]::NormalizePath('$(CoreClrProjectRoot)', 'System.Private.CoreLib', 'System.Private.CoreLib.csproj'))</CoreLibProject>
5151
<CoreLibProject Condition="'$(RuntimeFlavor)' == 'Mono'">$([MSBuild]::NormalizePath('$(MonoProjectRoot)', 'netcore', 'System.Private.CoreLib', 'System.Private.CoreLib.csproj'))</CoreLibProject>
5252
</PropertyGroup>
5353

eng/Subsets.props

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -136,12 +136,12 @@
136136

137137
<!-- CoreClr sets -->
138138
<ItemGroup Condition="$(_subset.Contains('+clr.corelib+'))">
139-
<ProjectToBuild Include="$(CoreClrProjectRoot)src\System.Private.CoreLib\System.Private.CoreLib.csproj" Category="clr" />
139+
<ProjectToBuild Include="$(CoreClrProjectRoot)System.Private.CoreLib\System.Private.CoreLib.csproj" Category="clr" />
140140
</ItemGroup>
141141

142142
<ItemGroup Condition="'$(TargetOS)' == 'windows' and ($(_subset.Contains('+clr.dactools+')) or $(_subset.Contains('+clr.runtime+')))">
143-
<ProjectToBuild Include="$(CoreClrProjectRoot)src\ToolBox\SOS\DacTableGen\DacTableGen.csproj;
144-
$(CoreClrProjectRoot)src\ToolBox\SOS\DIALib\DIALib.ilproj"
143+
<ProjectToBuild Include="$(CoreClrProjectRoot)ToolBox\SOS\DacTableGen\DacTableGen.csproj;
144+
$(CoreClrProjectRoot)ToolBox\SOS\DIALib\DIALib.ilproj"
145145
Category="clr"/>
146146
</ItemGroup>
147147

@@ -166,7 +166,7 @@
166166
</ItemGroup>
167167

168168
<ItemGroup Condition="$(_subset.Contains('+clr.paltestlist+'))">
169-
<ProjectToBuild Include="$(CoreClrProjectRoot)src/pal/tests/palsuite/producepaltestlist.proj" />
169+
<ProjectToBuild Include="$(CoreClrProjectRoot)pal/tests/palsuite/producepaltestlist.proj" />
170170
</ItemGroup>
171171

172172
<ItemGroup Condition="$(_subset.Contains('+linuxdac+')) and $([MSBuild]::IsOsPlatform(Windows)) and '$(TargetArchitecture)' != 'x86'">
@@ -178,17 +178,17 @@
178178
</ItemGroup>
179179

180180
<ItemGroup Condition="$(_subset.Contains('+crossdacpack+'))">
181-
<ProjectToBuild Include="$(CoreClrProjectRoot)src\.nuget\Microsoft.CrossOsDiag.Private.CoreCLR\Microsoft.CrossOsDiag.Private.CoreCLR.proj" Category="clr" />
181+
<ProjectToBuild Include="$(CoreClrProjectRoot).nuget\Microsoft.CrossOsDiag.Private.CoreCLR\Microsoft.CrossOsDiag.Private.CoreCLR.proj" Category="clr" />
182182
</ItemGroup>
183183

184184
<ItemGroup Condition="$(_subset.Contains('+clr.tools+'))">
185-
<ProjectToBuild Include="$(CoreClrProjectRoot)src\tools\runincontext\runincontext.csproj;
186-
$(CoreClrProjectRoot)src\tools\r2rdump\R2RDump.csproj;
187-
$(CoreClrProjectRoot)src\tools\dotnet-pgo\dotnet-pgo.csproj;
188-
$(CoreClrProjectRoot)src\tools\r2rtest\R2RTest.csproj;
189-
$(CoreClrProjectRoot)src\tools\aot\crossgen2\crossgen2.csproj" Category="clr" />
185+
<ProjectToBuild Include="$(CoreClrProjectRoot)tools\runincontext\runincontext.csproj;
186+
$(CoreClrProjectRoot)tools\r2rdump\R2RDump.csproj;
187+
$(CoreClrProjectRoot)tools\dotnet-pgo\dotnet-pgo.csproj;
188+
$(CoreClrProjectRoot)tools\r2rtest\R2RTest.csproj;
189+
$(CoreClrProjectRoot)tools\aot\crossgen2\crossgen2.csproj" Category="clr" />
190190

191-
<ProjectToBuild Include="$(CoreClrProjectRoot)src\tools\aot\ILCompiler.TypeSystem.ReadyToRun.Tests\ILCompiler.TypeSystem.ReadyToRun.Tests.csproj"
191+
<ProjectToBuild Include="$(CoreClrProjectRoot)tools\aot\ILCompiler.TypeSystem.ReadyToRun.Tests\ILCompiler.TypeSystem.ReadyToRun.Tests.csproj"
192192
Test="true" Category="clr" Condition="'$(__DistroRid)' != 'linux-musl-x64'"/>
193193
</ItemGroup>
194194

@@ -197,7 +197,7 @@
197197
</ItemGroup>
198198

199199
<ItemGroup Condition="$(_subset.Contains('+clr.packages+'))">
200-
<ProjectToBuild Include="$(CoreClrProjectRoot)src\.nuget\coreclr-packages.proj" Pack="true" Category="clr" />
200+
<ProjectToBuild Include="$(CoreClrProjectRoot).nuget\coreclr-packages.proj" Pack="true" Category="clr" />
201201
</ItemGroup>
202202

203203
<!-- Mono sets -->
File renamed without changes.

src/coreclr/CMakeLists.txt

Lines changed: 117 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@ endif (MSVC)
1919

2020
# Set commonly used directory names
2121
set(CLR_DIR ${CMAKE_CURRENT_SOURCE_DIR})
22-
set(VM_DIR ${CMAKE_CURRENT_SOURCE_DIR}/src/vm)
23-
set(GENERATED_INCLUDE_DIR ${CMAKE_CURRENT_BINARY_DIR}/src/inc)
22+
set(VM_DIR ${CMAKE_CURRENT_SOURCE_DIR}/vm)
23+
set(GENERATED_INCLUDE_DIR ${CMAKE_CURRENT_BINARY_DIR}/inc)
2424
set(GENERATED_EVENTING_DIR ${CMAKE_CURRENT_BINARY_DIR}/Eventing)
2525
set(VERSION_FILE_PATH "${CMAKE_BINARY_DIR}/version.c")
26-
set(PAL_REDEFINES_FILE ${CMAKE_CURRENT_SOURCE_DIR}/src/dlls/mscordac/palredefines.S)
26+
set(PAL_REDEFINES_FILE ${CMAKE_CURRENT_SOURCE_DIR}/dlls/mscordac/palredefines.S)
2727

2828
# Avoid logging when skipping up-to-date copies
2929
set(CMAKE_INSTALL_MESSAGE LAZY)
@@ -79,24 +79,24 @@ if(CLR_CMAKE_HOST_UNIX)
7979
endif()
8080
endif()
8181

82-
add_subdirectory(src/pal)
83-
add_subdirectory(src/hosts)
82+
add_subdirectory(pal)
83+
add_subdirectory(hosts)
8484
else(CLR_CMAKE_HOST_UNIX)
8585
if(CLR_CMAKE_TARGET_UNIX)
86-
add_subdirectory(src/pal/src/libunwind)
86+
add_subdirectory(pal/src/libunwind)
8787
endif(CLR_CMAKE_TARGET_UNIX)
8888
endif(CLR_CMAKE_HOST_UNIX)
8989

9090
# Add this subdir. We install the headers for the jit.
91-
add_subdirectory(src/pal/prebuilt/inc)
91+
add_subdirectory(pal/prebuilt/inc)
9292

93-
add_subdirectory(src/debug/debug-pal)
93+
add_subdirectory(debug/debug-pal)
9494

9595
if(CLR_CMAKE_TARGET_WIN32 AND CLR_CMAKE_BUILD_SUBSET_RUNTIME)
96-
add_subdirectory(src/gc/sample)
96+
add_subdirectory(gc/sample)
9797
endif()
9898

99-
add_subdirectory(src/tools/aot/jitinterface)
99+
add_subdirectory(tools/aot/jitinterface)
100100

101101
# Above projects do not build with these compile options
102102
# All of the compiler options are specified in file compileoptions.cmake
@@ -116,23 +116,123 @@ include(clrdefinitions.cmake)
116116
# Include directory directives
117117
#-------------------------------------
118118
# Include the basic prebuilt headers - required for getting fileversion resource details.
119-
include_directories("src/pal/prebuilt/inc")
119+
include_directories("pal/prebuilt/inc")
120120
include_directories("../../artifacts/obj/coreclr")
121121

122122
if(FEATURE_STANDALONE_GC)
123123
add_definitions(-DFEATURE_STANDALONE_GC)
124124
if (CLR_CMAKE_BUILD_SUBSET_RUNTIME)
125-
add_subdirectory(src/gc)
125+
add_subdirectory(gc)
126126
endif (CLR_CMAKE_BUILD_SUBSET_RUNTIME)
127127
endif(FEATURE_STANDALONE_GC)
128128

129129
if (CLR_CMAKE_HOST_UNIX)
130-
include_directories("src/pal/inc")
131-
include_directories("src/pal/inc/rt")
132-
include_directories("src/pal/src/safecrt")
130+
include_directories("pal/inc")
131+
include_directories("pal/inc/rt")
132+
include_directories("pal/src/safecrt")
133133
endif (CLR_CMAKE_HOST_UNIX)
134134

135135
#------------------------------
136-
# Add Product Directory
136+
# Add Product Directories
137137
#------------------------------
138-
add_subdirectory(src)
138+
include_directories("inc")
139+
include_directories("debug/inc")
140+
include_directories("debug/inc/${ARCH_SOURCES_DIR}")
141+
include_directories("debug/inc/dump")
142+
include_directories("md/inc")
143+
include_directories("classlibnative/bcltype")
144+
include_directories("classlibnative/cryptography")
145+
include_directories("classlibnative/inc")
146+
include_directories("${GENERATED_INCLUDE_DIR}")
147+
include_directories("hosts/inc")
148+
149+
if(CLR_CMAKE_TARGET_WIN32 AND FEATURE_EVENT_TRACE)
150+
include_directories("${GENERATED_INCLUDE_DIR}/etw")
151+
endif(CLR_CMAKE_TARGET_WIN32 AND FEATURE_EVENT_TRACE)
152+
153+
add_subdirectory(debug/dbgutil)
154+
155+
if(CLR_CMAKE_HOST_UNIX)
156+
if(CLR_CMAKE_BUILD_SUBSET_RUNTIME)
157+
if(CLR_CMAKE_HOST_OSX OR (CLR_CMAKE_HOST_LINUX AND NOT CLR_CMAKE_HOST_UNIX_X86 AND NOT CLR_CMAKE_HOST_ANDROID))
158+
add_subdirectory(debug/createdump)
159+
endif(CLR_CMAKE_HOST_OSX OR (CLR_CMAKE_HOST_LINUX AND NOT CLR_CMAKE_HOST_UNIX_X86 AND NOT CLR_CMAKE_HOST_ANDROID))
160+
endif(CLR_CMAKE_BUILD_SUBSET_RUNTIME)
161+
162+
# Include the dummy c++ include files
163+
include_directories("pal/inc/rt/cpp")
164+
165+
# This prevents inclusion of standard C compiler headers
166+
add_compile_options(-nostdinc)
167+
168+
set (NATIVE_RESOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/nativeresources)
169+
include_directories(${NATIVE_RESOURCE_DIR})
170+
set (RC_TO_CPP ${NATIVE_RESOURCE_DIR}/rctocpp.awk)
171+
set (PROCESS_RC ${NATIVE_RESOURCE_DIR}/processrc.awk)
172+
set (RESOURCE_STRING_HEADER_DIR ${NATIVE_RESOURCE_DIR})
173+
174+
# Create a command to create a C++ source file containing an array of
175+
# NativeStringResource structs which represent the information from a
176+
# given Windows .rc file. The target C++ file path is returned in the
177+
# variable specified by the TARGET_FILE parameter.
178+
function(build_resources SOURCE TARGET_NAME TARGET_FILE)
179+
180+
set(PREPROCESSED_SOURCE ${CMAKE_CURRENT_BINARY_DIR}/${TARGET_NAME}.rc.i)
181+
182+
preprocess_file(${SOURCE} ${PREPROCESSED_SOURCE})
183+
184+
set(RESOURCE_ENTRY_ARRAY_CPP ${CMAKE_CURRENT_BINARY_DIR}/${TARGET_NAME}.cpp)
185+
186+
add_custom_command(
187+
OUTPUT ${RESOURCE_ENTRY_ARRAY_CPP}
188+
# Convert the preprocessed .rc file to a C++ file which will be used to make a static lib.
189+
COMMAND ${AWK} -v name=${TARGET_NAME} -f ${RC_TO_CPP} -f ${PROCESS_RC} ${PREPROCESSED_SOURCE} >${RESOURCE_ENTRY_ARRAY_CPP}
190+
DEPENDS ${PREPROCESSED_SOURCE} ${RC_TO_CPP} ${PROCESS_RC}
191+
)
192+
193+
include_directories(${RESOURCE_STRING_HEADER_DIR})
194+
set(${TARGET_FILE} ${RESOURCE_ENTRY_ARRAY_CPP} PARENT_SCOPE)
195+
196+
endfunction()
197+
198+
add_subdirectory(nativeresources)
199+
endif(CLR_CMAKE_HOST_UNIX)
200+
201+
if ((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 10.0))
202+
add_compile_options(-Wno-error=stringop-overflow=)
203+
endif()
204+
205+
add_subdirectory(utilcode)
206+
add_subdirectory(gcinfo)
207+
add_subdirectory(jit)
208+
add_subdirectory(inc)
209+
210+
if(CLR_CMAKE_HOST_UNIX)
211+
add_subdirectory(palrt)
212+
endif(CLR_CMAKE_HOST_UNIX)
213+
214+
add_subdirectory(vm)
215+
if (CLR_CMAKE_BUILD_SUBSET_RUNTIME)
216+
add_subdirectory(md)
217+
add_subdirectory(debug)
218+
add_subdirectory(binder)
219+
add_subdirectory(classlibnative)
220+
add_subdirectory(dlls)
221+
add_subdirectory(ToolBox)
222+
add_subdirectory(tools)
223+
add_subdirectory(unwinder)
224+
add_subdirectory(ildasm)
225+
add_subdirectory(ilasm)
226+
add_subdirectory(interop)
227+
228+
if(CLR_CMAKE_HOST_WIN32)
229+
add_subdirectory(hosts)
230+
endif(CLR_CMAKE_HOST_WIN32)
231+
else()
232+
if(CLR_CMAKE_HOST_UNIX)
233+
# this is needed to compile the jit on unix platforms.
234+
# When the runtime subset is compiled, the add_subdirectory(dlls) above
235+
# brings the mscorrc library into the build graph
236+
add_subdirectory(dlls/mscorrc)
237+
endif(CLR_CMAKE_HOST_UNIX)
238+
endif(CLR_CMAKE_BUILD_SUBSET_RUNTIME)

src/coreclr/Directory.Build.targets

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,24 @@
1212
<InformationalVersion>$(ProductVersion)</InformationalVersion>
1313
<InformationalVersion Condition="'$(VersionSuffix)' != ''">$(InformationalVersion)-$(VersionSuffix)</InformationalVersion>
1414
</PropertyGroup>
15+
16+
<ItemGroup>
17+
<BuiltBinary Include="$(TargetPath)" />
18+
</ItemGroup>
19+
20+
<!-- Target used to consolidate all PDBs into a single location -->
21+
<Target Name="MoveSymbolFiles"
22+
AfterTargets="Build"
23+
Condition="Exists(@(BuiltBinary -> '%(RootDir)%(Directory)%(Filename).pdb'))"
24+
Inputs="@(BuiltBinary -> '%(RootDir)%(Directory)%(Filename).pdb')"
25+
Outputs="@(BuiltBinary -> '$(RuntimeBinDir)PDB/%(Filename).pdb')">
26+
27+
<Move SourceFiles="@(BuiltBinary -> '%(RootDir)%(Directory)%(Filename).pdb')"
28+
DestinationFolder="$(RuntimeBinDir)PDB" />
29+
30+
</Target>
31+
32+
<!-- Import targets here to have TargetPath and other macros defined. Limit to CoreLib. -->
33+
<Import Condition="'$(MSBuildProjectName)' == 'System.Private.CoreLib'" Project="$(RepositoryEngineeringDir)illink.targets" />
34+
1535
</Project>

src/coreclr/src/System.Private.CoreLib/System.Private.CoreLib.csproj renamed to src/coreclr/System.Private.CoreLib/System.Private.CoreLib.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@
104104
</PropertyGroup>
105105

106106
<!-- Compilation options -->
107-
<Import Project="../../clr.featuredefines.props" />
107+
<Import Project="../clr.featuredefines.props" />
108108

109109
<!-- Sources -->
110110
<ItemGroup>
@@ -320,8 +320,8 @@
320320

321321
<!-- Setup eventing file generation -->
322322
<ItemGroup>
323-
<EventingGenerationScript Include="$(CoreClrProjectRoot)/src/scripts/genRuntimeEventSources.py" />
324-
<EventManifestFile Include="$(CoreClrProjectRoot)/src/vm/ClrEtwAll.man" />
323+
<EventingGenerationScript Include="$(CoreClrProjectRoot)scripts/genRuntimeEventSources.py" />
324+
<EventManifestFile Include="$(CoreClrProjectRoot)vm/ClrEtwAll.man" />
325325
<EventingSourceFile Include="$(IntermediateOutputPath)..\..\..\Eventing\$(TargetArchitecture)\$(Configuration)\NativeRuntimeEventSource.CoreCLR.cs" Condition="'$(FeaturePerfTracing)' == 'true' ">
326326
<Link>src\System\Diagnostics\Eventing\Generated\NativeRuntimeEventSource.CoreCLR.cs</Link>
327327
</EventingSourceFile>

0 commit comments

Comments
 (0)