From ed7d5ec51a8c6406d93fff0bbb238ab4f5841b32 Mon Sep 17 00:00:00 2001 From: Krzysztof Boronski Date: Tue, 2 Aug 2022 09:42:40 -0500 Subject: [PATCH] Fix relocating files when paths for generic script wrapper are specified explicitely Signed-off-by: Krzysztof Boronski --- f4pga/flows/common_modules/generic_script_wrapper.py | 5 +++-- f4pga/flows/flow.py | 6 +++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/f4pga/flows/common_modules/generic_script_wrapper.py b/f4pga/flows/common_modules/generic_script_wrapper.py index ad860e8..cc09760 100644 --- a/f4pga/flows/common_modules/generic_script_wrapper.py +++ b/f4pga/flows/common_modules/generic_script_wrapper.py @@ -177,9 +177,10 @@ class GenericScriptWrapperModule(Module): with open(target, "wb") as f: f.write(data) - for _, file, target in self.file_outputs: + for dep, file, _ in self.file_outputs: file = ctx.r_env.resolve(file, final=True) - target = ctx.r_env.resolve(target, final=True) + target = ctx.r_env.resolve(getattr(ctx.outputs, dep), final=True) + print(f"file is: {file}, target is: {target}") if target != file: Path(file).rename(target) diff --git a/f4pga/flows/flow.py b/f4pga/flows/flow.py index 811fd10..aa64fc6 100644 --- a/f4pga/flows/flow.py +++ b/f4pga/flows/flow.py @@ -238,12 +238,12 @@ class Flow: sfprint(verbosity, f" {Style.BRIGHT + status} " f"{dep + Style.RESET_ALL}: {source}") def _build_dep(self, dep): - paths = self.dep_paths.get(dep) + provider = self.os_map.get(dep) + r_env = self.cfg.r_env if provider is None else self.cfg.get_r_env(provider.name) + paths = r_env.resolve(self.dep_paths.get(dep)) if not paths: sfprint(2, f"Dependency {dep} is unresolved.") return False - - provider = self.os_map.get(dep) run = (provider.name in self.run_stages) if provider else False if p_req_exists(paths) and not run: