Skip to content

Commit c5301c4

Browse files
authored
Update SPMI collection script for ASP.NET (#102025)
* Add some new scenarios. * Revise configs we use for collections * Use .Net 8 for crank. * Use temp dir that is not under the repo root for .NET install
1 parent 214ea9c commit c5301c4

File tree

1 file changed

+16
-26
lines changed

1 file changed

+16
-26
lines changed

src/coreclr/scripts/superpmi_aspnet.py

Lines changed: 16 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
import sys
1818
import zipfile
1919
import stat
20+
import tempfile
2021

2122
from os import path
2223
from coreclr_arguments import *
@@ -124,39 +125,23 @@ def build_and_run(coreclr_args):
124125

125126
checked_root = path.join(source_directory, "artifacts", "bin", "coreclr", target_os + "." + coreclr_args.arch + ".Checked")
126127
release_root = path.join(source_directory, "artifacts", "bin", "coreclr", target_os + "." + coreclr_args.arch + ".Release")
127-
spmi_temp = path.join(source_directory, "artifacts", "spmi_aspnet_collection")
128-
129-
# Set up/clean up temp dir
130-
if not os.path.exists(spmi_temp):
131-
os.makedirs(spmi_temp)
132-
133-
def remove_readonly(func, path, _):
134-
"Clear the readonly bit and reattempt the removal"
135-
os.chmod(path, stat.S_IWRITE)
136-
func(path)
137-
138-
spmi_temp_items = [os.path.join(spmi_temp, item) for item in os.listdir(spmi_temp)]
139-
for item in spmi_temp_items:
140-
if os.path.isdir(item):
141-
shutil.rmtree(item, onerror=remove_readonly)
142-
else:
143-
os.remove(item)
144128

145129
# We'll use repo script to install dotnet
146130
dotnet_install_script_name = "dotnet-install.cmd" if is_windows else "dotnet-install.sh"
147131
dotnet_install_script_path = path.join(source_directory, "eng", "common", dotnet_install_script_name)
148132

149-
with TempDir(spmi_temp, skip_cleanup=True) as temp_location:
133+
with tempfile.TemporaryDirectory() as temp_location:
150134

151135
print ("Executing in " + temp_location)
136+
os.chdir(temp_location)
152137

153-
# install dotnet 6.0
154-
run_command([dotnet_install_script_path, "-Version", "7.0.2"], temp_location, _exit_on_fail=True)
138+
# install dotnet 8.0
139+
run_command([dotnet_install_script_path, "-Version", "8.0.0"], temp_location, _exit_on_fail=True)
155140
os.environ['DOTNET_MULTILEVEL_LOOKUP'] = '0'
156141
os.environ['DOTNET_SKIP_FIRST_TIME_EXPERIENCE'] = '1'
157142
dotnet_path = path.join(source_directory, ".dotnet")
158143
dotnet_exe = path.join(dotnet_path, "dotnet.exe") if is_windows else path.join(dotnet_path, "dotnet")
159-
run_command([dotnet_exe, "--info"], temp_location, _exit_on_fail=True)
144+
# run_command([dotnet_exe, "--info"], temp_location, _exit_on_fail=True)
160145
os.environ['DOTNET_ROOT'] = dotnet_path
161146

162147
## install crank as local tool
@@ -190,24 +175,27 @@ def remove_readonly(func, path, _):
190175
("proxy", "proxy-yarp"),
191176
("staticfiles", "static"),
192177
("websocket", "websocket"),
193-
("orchard", "about-sqlite")
178+
("orchard", "about-sqlite"),
179+
("signalr", "signalr"),
180+
("grpc", "grpcaspnetcoreserver-grpcnetclient"),
181+
("efcore", "NavigationsQuery"),
182+
("efcore", "Funcletization")
194183
]
195184

196-
# configname_scenario_list = [("platform", "plaintext")]
185+
# configname_scenario_list = [("quic", "read-write")]
197186

198187
# note tricks to get one element tuples
199188

200189
runtime_options_list = [
201190
("Dummy=0",),
202191
("TieredCompilation=0", ),
203-
("TieredPGO=1",),
192+
("TieredPGO=0",),
204193
("TieredPGO=1", "ReadyToRun=0"),
205194
("ReadyToRun=0", "OSR_HitLimit=0", "TC_OnStackReplacement_InitialCounter=10"),
206-
("TieredPGO=1", "ReadyToRun=0", "OSR_HitLimit=0", "TC_OnStackReplacement_InitialCounter=10"),
207195
("TC_PartialCompilation=1",)
208196
]
209197

210-
# runtime_options_list = [("TieredCompilation=0", )]
198+
# runtime_options_list = [("Dummy=0", )]
211199

212200
mch_file = path.join(coreclr_args.output_mch_path, "aspnet.run." + target_os + "." + target_arch + ".checked.mch")
213201
benchmark_machine = determine_benchmark_machine(coreclr_args)
@@ -288,6 +276,8 @@ def remove_readonly(func, path, _):
288276
command = [mcs_path, "-jitflags", mch_file]
289277
run_command(command, temp_location)
290278

279+
os.chdir(source_directory )
280+
291281
def main(main_args):
292282
""" Main entry point
293283

0 commit comments

Comments
 (0)