Perform an initial checkout if library is missing #720
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.
As mentioned in #603, it is tempting to check in the
fusesoc.conf
-file into a version control system. This way all the necessary libraries are written down explicitly and changes are tracked as well. Note, that this is not the intended workflow, but it almost works with fusesoc version 2.4.2, except for one usecase:in a clean checkout of a repository, there is the
fusesoc.conf
, but crucially not thefusesoc_library
. In this case, almost allfusesoc
-commands will fail with an error like this:When looking into the code, the error can be traced to a FIXME, which exactly describes the initialization of missing libraries that this commit tries to add.
All it does is to move the check for a non-existing directory downwards after there is the correct provider. If the path doesn't exist, it tries to initialize the library using said provider, failing with the old error output as before this commit. This way, missing libraries get initialized gracefully and the usecase described above is supported.
The new testcase is simple: it creates an empty library directory, which gets updated. Since the core directory does not exist, an initial checkout should be performed.
Fixes #603.