Skip to content

Commit

Permalink
Remove requirement on 'format' to have a valid build cache (#120)
Browse files Browse the repository at this point in the history
* Remove requirement on 'format' to have a valid build cache

* Correcting code architecture for skipping a failed cache load
  • Loading branch information
LeStarch committed Feb 28, 2023
1 parent f53f0a1 commit e4baff3
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions src/fprime/util/build_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -241,14 +241,19 @@ def utility_entry(args):
# Some commands, like purge and info, run on sets of directories and will attempt to load those sets later.
# However, the base directory must be setup here. Errors in this load are ignored to allow the command to find
# build caches related to that set.
try:
if parsed.command == "generate":
build.invent(parsed.platform, build_dir=parsed.build_cache)
else:
build.load(parsed.platform, parsed.build_cache)
except InvalidBuildCacheException:
if parsed.command not in ["purge", "info"]:
raise
if parsed.command == "generate":
build.invent(parsed.platform, build_dir=parsed.build_cache)
else:
does_not_need_cache_directory = parsed.command in [
"purge",
"info",
"format",
]
build.load(
parsed.platform,
parsed.build_cache,
skip_validation=does_not_need_cache_directory,
)
validate_tools_from_requirements(build)
status = runners[parsed.command](
build, parsed, cmake_args, make_args, getattr(parsed, "pass_through", [])
Expand Down

0 comments on commit e4baff3

Please sign in to comment.