Skip to content

Commit b943100

Browse files
Oren CohenMichael Schwarcz
authored andcommitted
Fix incremental builds
1 parent 16a74c2 commit b943100

File tree

2 files changed

+28
-20
lines changed

2 files changed

+28
-20
lines changed

tools/build_api.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -763,9 +763,9 @@ def build_library(src_paths, build_path, target, toolchain_name,
763763
toolchain.copy_files(resources.hex_files, build_path,
764764
resources=resources)
765765

766-
if resources.psa_manifests:
767-
toolchain.copy_files(resources.psa_manifests, build_path,
768-
resources=resources)
766+
# if resources.psa_manifests:
767+
# toolchain.copy_files(resources.psa_manifests, build_path,
768+
# resources=resources)
769769

770770
# Compile Sources
771771
objects = toolchain.compile_sources(resources, resources.inc_dirs)

tools/spm/generate_partition_code.py

Lines changed: 25 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,14 @@
1010

1111
SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
1212
TEMPLATES_DIR = path_join(SCRIPT_DIR, 'templates')
13+
MANIFEST_TEMPLATES = filter(
14+
lambda filename: '_NAME_' in filename,
15+
glob.glob(path_join(TEMPLATES_DIR, '*.tpl'))
16+
)
17+
COMMON_TEMPLATES = filter(
18+
lambda filename: '_NAME_' not in filename,
19+
glob.glob(path_join(TEMPLATES_DIR, '*.tpl'))
20+
)
1321

1422

1523
def assert_int(num):
@@ -611,11 +619,6 @@ def generate_partitions_sources(manifest_files, extra_filters=None):
611619
:return: List of paths to the generated files
612620
"""
613621

614-
partition_template_files = filter(
615-
lambda filename: '_NAME_' in filename,
616-
glob.glob(path_join(TEMPLATES_DIR, '*.tpl'))
617-
)
618-
619622
# Construct a list of all the manifests and sfids.
620623
manifests = []
621624
for manifest_file in manifest_files:
@@ -628,13 +631,13 @@ def generate_partitions_sources(manifest_files, extra_filters=None):
628631
generated_folders = []
629632
for manifest in manifests:
630633
manifest_output_folder = manifest.autogen_folder
631-
if not manifest.is_up_to_date(partition_template_files):
634+
if not manifest.is_up_to_date(MANIFEST_TEMPLATES):
632635
render_args = {
633636
'partition': manifest,
634637
'dependent_partitions': manifest.find_dependencies(manifests)
635638
}
636639
manifest_output_folder = generate_source_files(
637-
manifest.templates_to_files(partition_template_files,
640+
manifest.templates_to_files(MANIFEST_TEMPLATES,
638641
manifest_output_folder),
639642
render_args,
640643
manifest_output_folder,
@@ -656,27 +659,32 @@ def generate_spm_data(manifest_files, output_dir, extra_filters=None):
656659
:return: List of paths to the generated files
657660
"""
658661
autogen_folder = path_join(output_dir, 'psa_autogen')
659-
template_files = filter(
660-
lambda filename: '_NAME_' not in filename,
661-
glob.glob(path_join(TEMPLATES_DIR, '*.tpl'))
662-
)
663-
664662
templates_dict = {
665663
t: path_join(autogen_folder, os.path.basename(os.path.splitext(t)[0]))
666-
for t in template_files
664+
for t in COMMON_TEMPLATES
667665
}
668666

669-
if is_up_to_date(manifest_files, template_files, templates_dict.values()):
670-
return autogen_folder
667+
complete_source_list = templates_dict.values()
671668

672669
# Construct lists of all the manifests and mmio_regions.
673670
region_list = []
674671
manifests = []
675672
for manifest_file in manifest_files:
676-
manifest_obj = Manifest.from_json(manifest_file, skip_src=True)
673+
manifest_obj = Manifest.from_json(manifest_file)
674+
manifests.append(manifest_obj)
677675
for region in manifest_obj.mmio_regions:
678676
region_list.append(region)
679-
manifests.append(manifest_obj)
677+
complete_source_list.extend(
678+
manifest_obj.templates_to_files(
679+
MANIFEST_TEMPLATES,
680+
manifest_obj.autogen_folder).values()
681+
)
682+
683+
if is_up_to_date(
684+
manifest_files,
685+
MANIFEST_TEMPLATES + COMMON_TEMPLATES,
686+
complete_source_list):
687+
return autogen_folder
680688

681689
render_args = {
682690
'partitions': manifests,

0 commit comments

Comments
 (0)