Skip to content

Commit

Permalink
Raise exception instead of exiting on dependency resolution errors
Browse files Browse the repository at this point in the history
  • Loading branch information
olofk committed Dec 18, 2024
1 parent 1a9b687 commit 978652a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 10 deletions.
11 changes: 1 addition & 10 deletions fusesoc/edalizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,16 +74,7 @@ def cores(self):
@property
def resolved_cores(self):
"""Get a list of all "used" cores after the dependency resolution"""
try:
return self.core_manager.get_depends(self.toplevel, self.flags)
except DependencyError as e:
logger.error(
e.msg + f"\nFailed to resolve dependencies for {self.toplevel}"
)
exit(1)
except SyntaxError as e:
logger.error(e.msg)
exit(1)
return self.core_manager.get_depends(self.toplevel, self.flags)

@property
def discovered_cores(self):
Expand Down
4 changes: 4 additions & 0 deletions fusesoc/fusesoc.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,10 @@ def get_backend(self, core, flags, backendargs=[]):
raise RuntimeError(e.msg)
except RuntimeError as e:
raise RuntimeError("Setup failed : {}".format(str(e)))
except DependencyError as e:
raise RuntimeError(
"Failed to resolve dependencies. " + e.msg
)

if os.path.exists(edam_file):
old_edam = yaml_fread(edam_file, self.config.resolve_env_vars_early)
Expand Down

0 comments on commit 978652a

Please sign in to comment.