Skip to content

Commit

Permalink
Logging for CI bug with headers coming from multiple folders
Browse files Browse the repository at this point in the history
  • Loading branch information
SamFlt committed Mar 11, 2024
1 parent f122084 commit e6fe88b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -156,9 +156,10 @@ def is_forbidden_function_name(name: str) -> bool:

@staticmethod
def update_from_main_config_file(path: Path) -> None:
assert path.exists()
assert path.exists(), f'Main config file {path} was not found'
with open(path, 'r') as main_config_file:
main_config = json.load(main_config_file)
print(json.dumps(main_config, indent=2))
logging.info('Updating the generator config from dict: ', main_config)
GeneratorConfig.pcpp_config.include_directories = main_config['include_dirs']

Expand All @@ -176,6 +177,7 @@ def update_from_main_config_file(path: Path) -> None:
for module_name in modules_dict:
headers = map(lambda s: Path(s), modules_dict[module_name].get('headers'))
deps = modules_dict[module_name].get('dependencies')

# Include only headers that are in the VISP source directory
headers = list(filter(lambda h: source_dir in h.parents, headers))
headers_log_str = '\n\t'.join([str(header) for header in headers])
Expand Down
2 changes: 1 addition & 1 deletion modules/python/generator/visp_python_bindgen/submodule.py
Original file line number Diff line number Diff line change
Expand Up @@ -284,8 +284,8 @@ def get_submodules(config_path: Path, generate_path: Path) -> List[Submodule]:
headers = module_data.headers
if len(headers) == 0:
print(f'Module {module_data.name} has no input headers, skipping!')

continue
# The headers are already filtered: they should all come from the ViSP source folder (no vpConfig, etc.)
include_dir = headers[0].parent
hh = "\n".join(map(lambda s: str(s), headers))
assert all(map(lambda header_path: header_path.parent == include_dir, headers)), f'Found headers in different directory, this case is not yet handled. Headers = {hh}'
Expand Down

0 comments on commit e6fe88b

Please sign in to comment.