Skip to content

Commit

Permalink
Add platform compatibility checks for incremental build
Browse files Browse the repository at this point in the history
Signed-off-by: Zelin Hao <zelinhao@amazon.com>
  • Loading branch information
zelinh committed Aug 14, 2024
1 parent 47993e0 commit 63d927b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion src/build_workflow/build_incremental.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,10 @@


class BuildIncremental:
def __init__(self, input_manifest: InputManifest, distribution: str):
def __init__(self, input_manifest: InputManifest, distribution: str, platform: str):
self.distribution = distribution
self.input_manifest = input_manifest
self.platform = platform

# Given input manifest and return a list of what components changed and added.
def commits_diff(self, input_manifest: InputManifest) -> List[str]:
Expand All @@ -31,6 +32,9 @@ def commits_diff(self, input_manifest: InputManifest) -> List[str]:
return [input_manifest.build.name.replace(" ", "-")]
components = []
for component in stable_input_manifest.components.select():
if self.platform not in component.platforms:
logging.info(f"Skipping {component.name} as platform is not compatible.")
continue
if component.name not in previous_build_manifest.components:
components.append(component.name)
logging.info(f"Adding {component.name} since it is missing from previous build manifest")
Expand Down
2 changes: 1 addition & 1 deletion src/run_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def main() -> int:
output_dir = BuildOutputDir(manifest.build.filename, args.distribution).dir

if args.incremental:
buildIncremental = BuildIncremental(manifest, args.distribution)
buildIncremental = BuildIncremental(manifest, args.distribution, args.platform)
list_of_updated_plugins = buildIncremental.commits_diff(manifest)
components = buildIncremental.rebuild_plugins(list_of_updated_plugins, manifest)

Expand Down

0 comments on commit 63d927b

Please sign in to comment.