Move some global state into a function

This commit is contained in:
Christoph Reiter 2021-07-17 18:30:50 +02:00
parent 32d83dcdad
commit e45ceae224

View File

@ -856,7 +856,8 @@ def get_workflow():
raise Exception("workflow not found:", workflow_name)
JOB_META: List[Dict[str, Any]] = [
def get_job_meta() -> List[Dict[str, Any]]:
job_meta: List[Dict[str, Any]] = [
{
"build-types": ["mingw64"],
"matrix": {
@ -916,9 +917,8 @@ JOB_META: List[Dict[str, Any]] = [
}
]
# The job matching MINGW_SRC_ARCH should also build mingw-src
for meta in JOB_META:
for meta in job_meta:
if Config.MINGW_SRC_ARCH in meta["build-types"]:
meta["build-types"].append("mingw-src")
meta["matrix"]["build-args"] = meta["matrix"]["build-args"] + ",mingw-src"
@ -926,6 +926,8 @@ for meta in JOB_META:
else:
raise Exception("Didn't find arch for building mingw-src")
return job_meta
def write_build_plan(args: Any):
target_file = args.target_file
@ -965,7 +967,7 @@ def write_build_plan(args: Any):
return
jobs = []
for job_info in JOB_META:
for job_info in get_job_meta():
matching_build_types = set(queued_build_types) & set(job_info["build-types"])
if matching_build_types:
build_count = sum(queued_build_types[bt] for bt in matching_build_types)