Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Perform an initial checkout if library is missing
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 the `fusesoc_library`. In this case, almost all `fusesoc`- commands will fail with an error like this: ```shell $ ls fusesoc_libraries fusesoc.conf ls: cannot access 'fusesoc_libraries': No such file or directory fusesoc.conf $ cat fusesoc.conf [library.vlog_tb_utils] location = fusesoc_libraries/vlog_tb_utils sync-uri = https://github.com/fusesoc/vlog_tb_utils sync-type = git auto-sync = true $ fusesoc library update WARNING: Failed to register library 'fusesoc_libraries/vlog_tb_utils is not a directory' ``` When looking into the code, the error can be traced to a FIXME, which exactly describes the initialization of missing libraries that this com- mit tries to add. All it does is to move th 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 check- out should be performed.
- Loading branch information