Fix relocating files when paths for generic script wrapper are specified explicitely

Signed-off-by: Krzysztof Boronski <kboronski@antmicro.com>
This commit is contained in:
Krzysztof Boronski 2022-08-02 09:42:40 -05:00 committed by Unai Martinez-Corral
parent 831492aa0d
commit ed7d5ec51a
2 changed files with 6 additions and 5 deletions

View File

@ -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)

View File

@ -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: