From 10a2afc45adff68ee07c94eb4d9089d8915425eb Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Wed, 16 Jul 2025 01:33:15 +0530 Subject: [PATCH 1/9] Support base variations inside combination of variations, fixes #38 --- automation/script/module.py | 109 +++++++++++++++++++++++++----------- 1 file changed, 76 insertions(+), 33 deletions(-) diff --git a/automation/script/module.py b/automation/script/module.py index f2b37c81e..ffa3d6e3f 100644 --- a/automation/script/module.py +++ b/automation/script/module.py @@ -2574,6 +2574,63 @@ def _update_state_from_variations(self, i, meta, variation_tags, variations, env return {'return': 0, 'variation_tags_string': variation_tags_string, 'explicit_variation_tags': explicit_variation_tags, 'warnings': warnings} + + + def _add_base_variations( + self, + variation_name, + variations, + variation_tags, + tmp_variations, + excluded_variation_tags + ): + """ + Adds base variations for a given variation_name into variation_tags + and updates tmp_variations if valid. + """ + + if "base" not in variations[variation_name]: + return {'return': 0} + + for base_variation in variations[variation_name]["base"]: + tag_to_append = None + dynamic_base_variation = False + dynamic_base_variation_already_added = False + + # Handle dynamic variation + if base_variation not in variations: + base_variation_dynamic = self._get_name_for_dynamic_variation_tag(base_variation) + if not base_variation_dynamic or base_variation_dynamic not in variations: + return { + 'return': 1, + 'error': f'Variation "{base_variation}" specified as base variation of "{variation_name}" is not existing' + } + dynamic_base_variation = True + base_prefix = base_variation_dynamic.split(".")[0] + "." + + # We allow repeated dynamic variations like _patch.1,_patch.2,_patch.3 + #for tag in variation_tags: + # if tag.startswith(base_prefix): + # dynamic_base_variation_already_added = True + # break + + # Append if not already added + if base_variation not in variation_tags and not dynamic_base_variation_already_added: + tag_to_append = base_variation + + # Validate exclusion list + if tag_to_append: + if tag_to_append in excluded_variation_tags: + return { + 'return': 1, + 'error': f'Variation "{tag_to_append}" specified as base variation for the variation is in the excluded list "{variation_name}"' + } + variation_tags.append(tag_to_append) + tmp_variations[tag_to_append] = False + + return {'return': 0} + + ########################################################################## def _update_variation_tags_from_variations( self, variation_tags, variations, variation_groups, excluded_variation_tags): @@ -2612,40 +2669,16 @@ def _update_variation_tags_from_variations( variation_name = self._get_name_for_dynamic_variation_tag( variation_name) - # TODO: Move this to a function and apply it for combination of variations too - # base variations are automatically turned on. Only - # variations outside of any variation group can be added as - # a base_variation - if "base" in variations[variation_name]: - base_variations = variations[variation_name]["base"] - for base_variation in base_variations: - dynamic_base_variation = False - dynamic_base_variation_already_added = False - if base_variation not in variations: - base_variation_dynamic = self._get_name_for_dynamic_variation_tag( - base_variation) - if not base_variation_dynamic or base_variation_dynamic not in variations: - return {'return': 1, 'error': 'Variation "{}" specified as base variation of "{}" is not existing'.format( - base_variation, variation_name)} - else: - dynamic_base_variation = True - base_prefix = base_variation_dynamic.split(".")[ - 0] + "." - for x in variation_tags: - if x.startswith(base_prefix): - dynamic_base_variation_already_added = True - - if base_variation not in variation_tags and not dynamic_base_variation_already_added: - tag_to_append = base_variation - - if tag_to_append: - if tag_to_append in excluded_variation_tags: - return {'return': 1, 'error': 'Variation "{}" specified as base variation for the variation is in the excluded list "{}" '.format( - tag_to_append, variation_name)} - variation_tags.append(tag_to_append) - tmp_variations[tag_to_append] = False + result = self._add_base_variations( + variation_name, + variations, + variation_tags, + tmp_variations, + excluded_variation_tags + ) + if result.get('return', 0) > 0: + return result - tag_to_append = None # default_variations dictionary specifies the # default_variation for each variation group. A default @@ -2677,6 +2710,16 @@ def _update_variation_tags_from_variations( combined_variation_meta = variations[combined_variation] tmp_combined_variations[combined_variation] = True + result = self._add_base_variations( + combined_variation, + variations, + variation_tags, + tmp_combined_variations, + excluded_variation_tags + ) + if result.get('return', 0) > 0: + return result + r = self._get_variation_tags_from_default_variations( combined_variation_meta, variations, From 6c70c415521b2e552c7ad20642afbece087353ef Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Tue, 15 Jul 2025 20:04:53 +0000 Subject: [PATCH 2/9] [Automated Commit] Format Codebase [skip ci] --- automation/script/module.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/automation/script/module.py b/automation/script/module.py index ffa3d6e3f..df5de3799 100644 --- a/automation/script/module.py +++ b/automation/script/module.py @@ -2574,8 +2574,6 @@ def _update_state_from_variations(self, i, meta, variation_tags, variations, env return {'return': 0, 'variation_tags_string': variation_tags_string, 'explicit_variation_tags': explicit_variation_tags, 'warnings': warnings} - - def _add_base_variations( self, variation_name, @@ -2599,7 +2597,8 @@ def _add_base_variations( # Handle dynamic variation if base_variation not in variations: - base_variation_dynamic = self._get_name_for_dynamic_variation_tag(base_variation) + base_variation_dynamic = self._get_name_for_dynamic_variation_tag( + base_variation) if not base_variation_dynamic or base_variation_dynamic not in variations: return { 'return': 1, @@ -2609,7 +2608,7 @@ def _add_base_variations( base_prefix = base_variation_dynamic.split(".")[0] + "." # We allow repeated dynamic variations like _patch.1,_patch.2,_patch.3 - #for tag in variation_tags: + # for tag in variation_tags: # if tag.startswith(base_prefix): # dynamic_base_variation_already_added = True # break @@ -2630,8 +2629,8 @@ def _add_base_variations( return {'return': 0} - ########################################################################## + def _update_variation_tags_from_variations( self, variation_tags, variations, variation_groups, excluded_variation_tags): @@ -2679,7 +2678,6 @@ def _update_variation_tags_from_variations( if result.get('return', 0) > 0: return result - # default_variations dictionary specifies the # default_variation for each variation group. A default # variation in a group is turned on if no other variation From 897a2d03f326ed893e0aef36ce4841d75323e155 Mon Sep 17 00:00:00 2001 From: Arjun Suresh Date: Wed, 16 Jul 2025 02:42:19 +0530 Subject: [PATCH 3/9] Added patch.# variation for get-git-repo --- script/get-git-repo/meta.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/script/get-git-repo/meta.yaml b/script/get-git-repo/meta.yaml index 468468bb5..134b2410f 100644 --- a/script/get-git-repo/meta.yaml +++ b/script/get-git-repo/meta.yaml @@ -67,6 +67,10 @@ variations: patch: env: MLC_GIT_PATCH: 'yes' + patch.#: + env: + MLC_GIT_PATCH: 'yes' + +,MLC_GIT_PATCH_FILEPATHS: '#' pr-to-apply.#: env: MLC_GIT_PR_TO_APPLY: '#' From 9a0611baf704bfcb082aac30a0ea00f81251c245 Mon Sep 17 00:00:00 2001 From: Arjun Suresh Date: Wed, 16 Jul 2025 02:59:33 +0530 Subject: [PATCH 4/9] Support lists in update_tags_from_env_with_prefix --- automation/script/module.py | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/automation/script/module.py b/automation/script/module.py index df5de3799..6b73435d6 100644 --- a/automation/script/module.py +++ b/automation/script/module.py @@ -3405,9 +3405,17 @@ def _run_deps(self, deps, clean_env_keys_deps, env, state, const, const_state, a for t in update_tags_from_env_with_prefix: for key in update_tags_from_env_with_prefix[t]: if str(d.get('env', {}).get(key, '')).strip() != '': - d['tags'] += "," + t + str(d.get('env')[key]) + if isinstance(d.get('env')[key], str): + d['tags'] += "," + t + str(d.get('env')[key]) + elif isinstance(d.get('env')[key], list): + for item in d.get('env')[key]: + d['tags'] += "," + t + str(item) elif str(env.get(key, '')).strip() != '': - d['tags'] += "," + t + str(env[key]) + if isinstance(env[key], str): + d['tags'] += "," + t + str(env[key]) + elif isinstance(env[key], list): + for item in env[key]: + d['tags'] += "," + t + str(item) for key in clean_env_keys_deps: if '?' in key or '*' in key: @@ -3446,8 +3454,18 @@ def _run_deps(self, deps, clean_env_keys_deps, env, state, const, const_state, a update_tags_from_env = d.get("update_tags_from_env", []) for t in update_tags_from_env: - if env.get(t, '').strip() != '': - d['tags'] += "," + env[t] + if str(d.get('env', {}).get(t, '')).strip() != '': + if isinstance(d.get('env')[t], str): + d['tags'] += "," str(d.get('env')[t]) + elif isinstance(d.get('env')[t], list): + for item in d.get('env')[t]: + d['tags'] += "," + t + str(item) + elif str(env.get(t, '')).strip() != '': + if isinstance(env[t], str): + d['tags'] += "," + t + str(env[t]) + elif isinstance(env[t], list): + for item in env[t]: + d['tags'] += "," + t + str(item) update_tags_if_env = d.get("update_tags_if_env", []) for t in update_tags_if_env: From a2b1bad27003711f25cca3f784fba3acd9079760 Mon Sep 17 00:00:00 2001 From: Arjun Suresh Date: Wed, 16 Jul 2025 03:00:40 +0530 Subject: [PATCH 5/9] Support lists in update_tags_from_env_with_prefix --- automation/script/module.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/automation/script/module.py b/automation/script/module.py index 6b73435d6..f7cbdcd37 100644 --- a/automation/script/module.py +++ b/automation/script/module.py @@ -3456,7 +3456,7 @@ def _run_deps(self, deps, clean_env_keys_deps, env, state, const, const_state, a for t in update_tags_from_env: if str(d.get('env', {}).get(t, '')).strip() != '': if isinstance(d.get('env')[t], str): - d['tags'] += "," str(d.get('env')[t]) + d['tags'] += "," + str(d.get('env')[t]) elif isinstance(d.get('env')[t], list): for item in d.get('env')[t]: d['tags'] += "," + t + str(item) From b366c7cab298091bba2b293bf627437b7fbb3e70 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Tue, 15 Jul 2025 21:30:55 +0000 Subject: [PATCH 6/9] [Automated Commit] Format Codebase [skip ci] --- automation/script/module.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/automation/script/module.py b/automation/script/module.py index f7cbdcd37..f42333aff 100644 --- a/automation/script/module.py +++ b/automation/script/module.py @@ -3456,7 +3456,7 @@ def _run_deps(self, deps, clean_env_keys_deps, env, state, const, const_state, a for t in update_tags_from_env: if str(d.get('env', {}).get(t, '')).strip() != '': if isinstance(d.get('env')[t], str): - d['tags'] += "," + str(d.get('env')[t]) + d['tags'] += "," + str(d.get('env')[t]) elif isinstance(d.get('env')[t], list): for item in d.get('env')[t]: d['tags'] += "," + t + str(item) From 288905069511e3caaa75a2af5a3d963701233812 Mon Sep 17 00:00:00 2001 From: Arjun Suresh Date: Wed, 16 Jul 2025 03:05:33 +0530 Subject: [PATCH 7/9] Support lists in update_tags_from_env_with_prefix --- script/get-git-repo/meta.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/script/get-git-repo/meta.yaml b/script/get-git-repo/meta.yaml index 134b2410f..e52110035 100644 --- a/script/get-git-repo/meta.yaml +++ b/script/get-git-repo/meta.yaml @@ -70,7 +70,8 @@ variations: patch.#: env: MLC_GIT_PATCH: 'yes' - +,MLC_GIT_PATCH_FILEPATHS: '#' + +,MLC_GIT_PATCH_FILEPATHS: + - '#' pr-to-apply.#: env: MLC_GIT_PR_TO_APPLY: '#' From 1a3a286487c9a42205096e47591f46882656988e Mon Sep 17 00:00:00 2001 From: Arjun Suresh Date: Wed, 16 Jul 2025 03:28:25 +0530 Subject: [PATCH 8/9] Fix typo --- automation/script/module.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/automation/script/module.py b/automation/script/module.py index f42333aff..954e0c444 100644 --- a/automation/script/module.py +++ b/automation/script/module.py @@ -3459,13 +3459,13 @@ def _run_deps(self, deps, clean_env_keys_deps, env, state, const, const_state, a d['tags'] += "," + str(d.get('env')[t]) elif isinstance(d.get('env')[t], list): for item in d.get('env')[t]: - d['tags'] += "," + t + str(item) + d['tags'] += "," + str(item) elif str(env.get(t, '')).strip() != '': if isinstance(env[t], str): - d['tags'] += "," + t + str(env[t]) + d['tags'] += "," + str(env[t]) elif isinstance(env[t], list): for item in env[t]: - d['tags'] += "," + t + str(item) + d['tags'] += "," + str(item) update_tags_if_env = d.get("update_tags_if_env", []) for t in update_tags_if_env: From ab5930cf10465921506bfe2c16c9fd5075041fc5 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Wed, 16 Jul 2025 13:27:39 +0530 Subject: [PATCH 9/9] Added a message for set-fixed-frequency with intel-pstate --- script/set-cpu-frequency/run.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/script/set-cpu-frequency/run.sh b/script/set-cpu-frequency/run.sh index 57b22872a..1bf863667 100644 --- a/script/set-cpu-frequency/run.sh +++ b/script/set-cpu-frequency/run.sh @@ -24,6 +24,9 @@ case "$DRIVER_KEY" in echo "→ intel_pstate: disabling turbo, setting performance governor" echo 0 | ${MLC_SUDO} tee /sys/devices/system/cpu/intel_pstate/no_turbo >/dev/null ${MLC_SUDO} cpupower frequency-set -g performance + echo "" + echo "Note: intel_pstate does _not_ support a userspace/fixed frequency mode." + echo "If you need a precise kHz, switch back to acpi-cpufreq in your kernel cmdline." ;; amd-pstate)