olofk / fusesoc

Package manager and build abstraction tool for FPGA/ASIC development
BSD 2-Clause "Simplified" License
1.17k stars 242 forks source link

fusesoc 2.x on windows: export files get removed due to /, \ mismatch #628

Closed schwende closed 10 months ago

schwende commented 1 year ago

After doing a fusesoc run --setup I always find my src/ directory empty with only the folders left, but without any file.

After debugging the issue I found out, that all the files get removed by the "# Clean out leftover files from previous builds" (capi2\core.py line 129).

Line 133: os.path.relpath(_abs_f, dst_dir) and src_files use other /, \ conventionand therefore the two strings are never matching and all the files get removed.

I'm sure there are better solutions, but I fixed it locally at my place by replacing line 133 with: if not os.path.relpath(_abs_f, dst_dir).replace("\\","/") in src_files:

hackathlete commented 1 year ago

Hello, I faced the same problem with fusesoc 2.1 under Windows 10 and Pyhton 3.9.1. The described change of line 133, solved the issue. Thanks @schwende!

BTW, the file is located here: C:\Users\xxx\AppData\Local\Programs\Python\Python311\Lib\site-packages\fusesoc\capi2

schwende commented 11 months ago

Hello,

are there any plans from the fusesoc team how this would/could be handled in the future?

olofk commented 10 months ago

Ouch. This looks bad. Let's go with the quick fix for now and I will do a new release. Then we can think about a long-term solution. As you mention, it feels a bit hacky and the risk is it will break again at some point :/

olofk commented 10 months ago

FuseSoC 2.3 is released which should hopefully fix this. Please let me know if it works and thanks everyone for reporting and commenting

olofk commented 10 months ago

655 was reported as fixed so I'm assuming this one is fixed as well. Please reopen otherwise.