This repository was archived by the owner on Jan 23, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 7 files changed +110
-1
lines changed Expand file tree Collapse file tree 7 files changed +110
-1
lines changed Original file line number Diff line number Diff line change @@ -189,6 +189,15 @@ call "%__VSToolsRoot%\VsDevCmd.bat"
189
189
190
190
@ call %__ProjectDir% \run.cmd build -Project=%__ProjectDir% \build.proj -generateHeaderWindows -NativeVersionHeaderFile=" %__RootBinDir% \obj\_version.h" %__RunArgs% %__UnprocessedBuildArgs%
191
191
192
+ REM =========================================================================================
193
+ REM ===
194
+ REM === Restore optimization profile data
195
+ REM ===
196
+ REM =========================================================================================
197
+
198
+ echo %__MsgPrefix% Restoring the OptimizationData Package
199
+ @ call %__ProjectDir% \run.cmd sync -optdata
200
+
192
201
REM =========================================================================================
193
202
REM ===
194
203
REM === Build the CLR VM
Original file line number Diff line number Diff line change 24
24
<Delete Files =" $(BinDir)System.Private.CoreLib.*" />
25
25
</Target >
26
26
27
+ <Target Name =" RestoreOptData" >
28
+ <Exec Command =" $(DnuRestoreCommand) " $(SourceDir).nuget/optdata/project.json" --source https://dotnet.myget.org/F/dotnet-core-optimization-data/api/v3/index.json" />
29
+ </Target >
30
+
27
31
<Target Name =" RestoreNETCorePlatforms" AfterTargets =" Build" Condition =" '$(RestoreDuringBuild)'=='true'" >
28
32
<Exec Command =" $(DnuRestoreCommand) " $(SourceDir).nuget/init/project.json" --source https://dotnet.myget.org/F/dotnet-core/api/v3/index.json" />
29
33
</Target >
Original file line number Diff line number Diff line change @@ -176,6 +176,9 @@ build_coreclr()
176
176
echo $__versionSourceLine > $__versionSourceFile
177
177
fi
178
178
179
+ echo " Restoring the OptimizationData package"
180
+ " $__ProjectRoot /run.sh" sync -optdata
181
+
179
182
pushd " $__IntermediatesDir "
180
183
# Regenerate the CMake solution
181
184
__ExtraCmakeArgs=" -DCLR_CMAKE_TARGET_OS=$__BuildOS -DCLR_CMAKE_PACKAGES_DIR=$__PackagesDir -DCLR_CMAKE_PGO_INSTRUMENT=$__PgoInstrument "
Original file line number Diff line number Diff line change 48
48
"values" : [],
49
49
"defaultValue" : " "
50
50
},
51
+ "RestoreOptData" : {
52
+ "description" : " MsBuild target that restores optimization profile data." ,
53
+ "valueType" : " target" ,
54
+ "values" : [],
55
+ "defaultValue" : " "
56
+ },
51
57
"RestoreDuringBuild" : {
52
58
"description" : " Enables/disables package restore." ,
53
59
"valueType" : " property" ,
362
368
"RestoreNETCorePlatforms" : " default"
363
369
}
364
370
},
371
+ "optdata" : {
372
+ "description" : " Restores optimization profile data for the repository." ,
373
+ "settings" : {
374
+ "Project" : " ./build.proj" ,
375
+ "RestoreDuringBuild" : true ,
376
+ "RestoreOptData" : " default"
377
+ }
378
+ },
365
379
"ab" : {
366
380
"description" : " Downloads the latests product packages from Azure. The values for '-AzureAccount' and '-AzureToken' are required" ,
367
381
"settings" : {
Original file line number Diff line number Diff line change
1
+ #!/usr/bin/python
2
+
3
+ import argparse
4
+ import json
5
+ import sys
6
+
7
+ def parse_args ():
8
+ parser = argparse .ArgumentParser (
9
+ description = """Extracts information from a json file by navigating the JSON object using a
10
+ sequence of property accessors and returning the JSON subtree, or the raw data, found
11
+ at that location."""
12
+ )
13
+
14
+ parser .add_argument (
15
+ '-f' , '--file' ,
16
+ metavar = '<project.json>' ,
17
+ help = "Path to project.json file to parse" ,
18
+ required = True ,
19
+ )
20
+
21
+ parser .add_argument (
22
+ 'property' ,
23
+ metavar = 'property_name' ,
24
+ help = """Name of property to extract using object notation.
25
+ Pass multiple values to drill down into nested objects (in order).""" ,
26
+ nargs = '*' ,
27
+ )
28
+
29
+ parser .add_argument (
30
+ '-r' , '--raw' ,
31
+ help = """Dumps the raw object found at the requested location.
32
+ If omitted, returns a JSON formatted object instead.""" ,
33
+ action = 'store_true' ,
34
+ default = False
35
+ )
36
+
37
+ return parser .parse_args ()
38
+
39
+ def main ():
40
+ args = parse_args ()
41
+
42
+ with open (args .file ) as json_file :
43
+ selected_property = json .load (json_file )
44
+
45
+ for prop in args .property :
46
+ selected_property = selected_property [prop ]
47
+
48
+ if args .raw :
49
+ print (selected_property )
50
+ else :
51
+ print (json .dumps (selected_property ))
52
+
53
+ return 0
54
+
55
+ if __name__ == "__main__" :
56
+ sys .exit (main ())
Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ function(add_pgo TargetName)
13
13
endif (WIN32 )
14
14
15
15
file (TO_NATIVE_PATH
16
- "${CLR_CMAKE_PACKAGES_DIR} /Microsoft.DotNet.OptimizationData.Coreclr/ ${CLR_CMAKE_TARGET_OS} . ${CLR_CMAKE_TARGET_ARCH} /${ProfileFileName} "
16
+ "${CLR_CMAKE_PACKAGES_DIR} /${CLR_CMAKE_OPTDATA_PACKAGEWITHRID} / ${CLR_CMAKE_OPTDATA_VERSION} /data /${ProfileFileName} "
17
17
ProfilePath
18
18
)
19
19
@@ -37,6 +37,18 @@ function(add_pgo TargetName)
37
37
endforeach (ConfigType)
38
38
endfunction (add_pgo)
39
39
40
+ set (CLR_CMAKE_OPTDATA_PACKAGEID "optimization.PGO.CoreCLR" )
41
+ set (CLR_CMAKE_OPTDATA_PACKAGEWITHRID "optimization.${CLR_CMAKE_TARGET_OS} -${CLR_CMAKE_TARGET_ARCH} .PGO.CoreCLR" )
42
+
43
+ # Parse optdata package version from project.json
44
+ file (TO_NATIVE_PATH "${CMAKE_SOURCE_DIR} /extract-from-json.py" ExtractFromJsonScript)
45
+ file (TO_NATIVE_PATH "${CMAKE_SOURCE_DIR} /src/.nuget/optdata/project.json" OptDataProjectJsonPath)
46
+ execute_process (
47
+ COMMAND python "${ExtractFromJsonScript} " -rf "${OptDataProjectJsonPath} " dependencies "${CLR_CMAKE_OPTDATA_PACKAGEID} "
48
+ OUTPUT_VARIABLE CLR_CMAKE_OPTDATA_VERSION
49
+ OUTPUT_STRIP_TRAILING_WHITESPACE
50
+ )
51
+
40
52
if (WIN32 )
41
53
if (CLR_CMAKE_PGO_INSTRUMENT)
42
54
# Instrumented PGO binaries on Windows introduce an additional runtime dependency, pgort<ver>.dll.
Original file line number Diff line number Diff line change
1
+ {
2
+ "dependencies" : {
3
+ "optimization.PGO.CoreCLR" : " 1.1.0-release-20161025"
4
+ },
5
+ "frameworks" : {
6
+ "netstandard" : {}
7
+ },
8
+ "runtimes" : {
9
+ "win7-x64" : {}
10
+ }
11
+ }
You can’t perform that action at this time.
0 commit comments