提交 b21abf0c 编写于 作者: J jashook

Apply format patch and run git out of tempdir

上级 c8eab0ce
......@@ -6139,8 +6139,9 @@ int Compiler::compCompileHelper(CORINFO_MODULE_HANDLE classPtr,
#ifdef DEBUG
if (JitConfig.DumpJittedMethods() == 1 && !compIsForInlining())
{
printf("Compiling %4d %s::%s, IL size = %u, hash=%08x %s\n", Compiler::jitTotalMethodCompiled, info.compClassName,
info.compMethodName, info.compILCodeSize, info.compMethodHash(), compGetTieringName());
printf("Compiling %4d %s::%s, IL size = %u, hash=%08x %s\n", Compiler::jitTotalMethodCompiled,
info.compClassName, info.compMethodName, info.compILCodeSize, info.compMethodHash(),
compGetTieringName());
}
if (compIsForInlining())
{
......
......@@ -161,7 +161,6 @@ def main(argv):
returncode = 0
jitutilsBin = os.path.join(os.path.dirname(bootstrapPath), "jitutils", "bin")
my_env["PATH"] = jitutilsBin + os.pathsep + my_env["PATH"]
current_dir = os.getcwd()
if not os.path.isdir(jitutilsBin):
print("Jitutils not built!")
......@@ -203,43 +202,41 @@ def main(argv):
proc = subprocess.Popen([jitformat, "--fix", "-a", arch, "-b", build, "-o", platform, "-c", coreclr, "--verbose", "--projects", project], env=my_env)
output,error = proc.communicate()
os.chdir(current_dir)
patchFilePath = os.path.join(coreclr, "format.patch")
patchFilePath = os.path.join(coreclr, "format.patch")
if returncode != 0:
# Create a patch file
print("Creating patch file " + patchFilePath)
patchFile = open(patchFilePath, "w")
proc = subprocess.Popen(["git", "diff", "--patch", "-U20"], env=my_env, stdout=patchFile)
output,error = proc.communicate()
if returncode != 0:
# Create a patch file
print("Creating patch file " + patchFilePath)
patchFile = open(patchFilePath, "w")
proc = subprocess.Popen(["git", "diff", "--patch", "-U20"], env=my_env, stdout=patchFile)
output,error = proc.communicate()
if os.path.isdir(jitUtilsPath):
print("Deleting " + jitUtilsPath)
shutil.rmtree(jitUtilsPath, onerror=del_rw)
if os.path.isdir(jitUtilsPath):
print("Deleting " + jitUtilsPath)
shutil.rmtree(jitUtilsPath, onerror=del_rw)
if os.path.isfile(bootstrapPath):
print("Deleting " + bootstrapPath)
os.remove(bootstrapPath)
if returncode != 0:
print("There were errors in formatting. Please run jit-format locally with: \n")
print(errorMessage)
print("\nOr download and apply generated patch:")
print("1. From the GitHub 'Checks' page on the Pull Request, with the failing Formatting")
print(" job selected (e.g., 'Formatting Linux x64'), click the 'View more details on")
print(" Azure Pipelines' link.")
print("3. Select the 'Summary' tab.")
print("4. Open the 'Build artifacts published' entry.")
print("5. Find the link to the OS/architecture appropriate format patch file.")
print("6. Click on the link to download it.")
print("7. Unzip the patch file.")
print("8. git apply format.patch")
if (returncode != 0) and (os.environ.get("TF_BUILD") == "True"):
print("##vso[task.logissue type=error](NETCORE_ENGINEERING_TELEMETRY=Build) Format job found errors, please apply the format patch.")
return returncode
if os.path.isfile(bootstrapPath):
print("Deleting " + bootstrapPath)
os.remove(bootstrapPath)
if returncode != 0:
print("There were errors in formatting. Please run jit-format locally with: \n")
print(errorMessage)
print("\nOr download and apply generated patch:")
print("1. From the GitHub 'Checks' page on the Pull Request, with the failing Formatting")
print(" job selected (e.g., 'Formatting Linux x64'), click the 'View more details on")
print(" Azure Pipelines' link.")
print("3. Select the 'Summary' tab.")
print("4. Open the 'Build artifacts published' entry.")
print("5. Find the link to the OS/architecture appropriate format patch file.")
print("6. Click on the link to download it.")
print("7. Unzip the patch file.")
print("8. git apply format.patch")
if (returncode != 0) and (os.environ.get("TF_BUILD") == "True"):
print("##vso[task.logissue type=error](NETCORE_ENGINEERING_TELEMETRY=Build) Format job found errors, please apply the format patch.")
return returncode
if __name__ == '__main__':
return_code = main(sys.argv[1:])
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册