YosysHQ / sby

SymbiYosys (sby) -- Front-end for Yosys-based formal verification flows
Other
390 stars 74 forks source link

Work Directory is not removed even `-f` is specified #269

Closed khwong-c closed 6 months ago

khwong-c commented 6 months ago

Situation

SBY failed to remove the existing directory when

The script produced a log of Removing directory but it doesn't really take effect.

cmd='sby -f -T "default" --prefix "/home/khwong/.config/JetBrains/PyCharm2023.3/scratches/delay"'
SBY 15:55:26 [/home/khwong/.config/JetBrains/PyCharm2023.3/scratches/delay_default] Removing directory '/home/khwong/.config/JetBrains/PyCharm2023.3/scratches/delay_default'.
ERROR: Directory '/home/khwong/.config/JetBrains/PyCharm2023.3/scratches/delay_default' already exists, use -f to overwrite the existing directory.

Bug Caused by

sbyfile is None when the SBY script is inputted from stdin https://github.com/YosysHQ/sby/blob/e30a0fe611fb1a0dea3808a130308b2d34443d86/sbysrc/sby.py#L422-L427

khwong-c commented 6 months ago

I doubt if the if sbyfile: check is used to protect the directory from multiple tasks running concurrently. @cliffordwolf would you mind having a check on this script?