From d9e6d80c4983e20ace00303e075c00f46da83c27 Mon Sep 17 00:00:00 2001 From: = Date: Tue, 3 Sep 2024 19:44:55 +0000 Subject: [PATCH] meson_to_hermetic: Fix package path and all meson options being loaded Test: build--turnip.sh Bug: 357080225 Change-Id: Iaf26680f3c8c730d870bff4fde56085254872594 --- .../templates/generate_python_build.txt | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/meson_to_hermetic/templates/generate_python_build.txt b/meson_to_hermetic/templates/generate_python_build.txt index 44b7f9a4cb9..72b0b4052e8 100644 --- a/meson_to_hermetic/templates/generate_python_build.txt +++ b/meson_to_hermetic/templates/generate_python_build.txt @@ -6,7 +6,7 @@ import tomllib ### Pull in the definitions meson is expecting ### from meson_common import * -from meson_to_hermetic import * +from meson_to_hermetic.meson_to_hermetic import * ### ######################################################################################################################## {{ meson_options }} @@ -24,11 +24,11 @@ if __name__ == "__main__": with open(value, 'rb') as f: data = tomllib.load(f) config_path = value - project_config = data.get('project_config') - for config in project_config: - meson_options = config.get('meson_options') - for key in meson_options: - set_option(key, meson_options[key]) + # Data entry point of meson_translator global + load_meson_data(config_path) + meson_options = meson_translator.config.meson_options + for key in meson_options: + set_option(key, meson_options[key]) case _: exit(f'Unhandled arg={flag} with value={value}') @@ -38,9 +38,6 @@ def get_variable(name: str): return globals()[name] -### Load Metadata -load_meson_data(config_path) - meson = impl.Meson(meson_translator.generator) host_machine = impl.Machine(meson_translator.host_machine) build_machine = impl.Machine(meson_translator.build_machine)