[Yosys][Warnings] Fixed Fatal Not Git Repo Warning #2520
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixed a warning where "fatal: not a git repository: './/.git' was being printed during builds of VPR.
This is caused by Yosys being included as a subtree instead of a git submodule. The Makefile in Yosys is trying to get the current version of git for Yosys but it cannot do it since it is not a git repo.
Just commented out the line causing the warning for now.
Description
This was actually a very interesting warning to debug.
I started by debugging the make command without using multiple threads to see what CMake command was causing this warning:
Looking into the temp.dump file, I found that the warning was being printed when generating "yosys-bin":
Not only that, but it was being printed twice.
I then opened up yosys' CMakeList to find this beauty:
It looks like all this CMake is doing is running another Makefile, twice. I should note that the "-f" argument should be set here since this is, in-fact, an "out-of-tree" build.
Looking into Yosys' Makefile, we find the culprit:
YOSYS_SRC
is a variable that should point to the directory of the current Makefile as defined here:However, since the "-f" argument was not set before, this gets initialized to "./"; hence the warning. Setting the "-f" argument does not fix the warning however, it just makes it better:
Obviously, we still get the same warning since this is not a git repository, since it was included into VTR as a git subtree. To fix this issue I just commented out the line causing this issue since all it was doing was failing to find the git version. Perhaps the Yosys infrastructure should be revisited if we plan to support this long term.
Related Issue
See issue #2518