fusesoc
fusesoc copied to clipboard
Core dependency query subcommand
I've recently found it useful to be able to be able to query the dependencies of all the core files in libraries known to fusesoc. My use case is that I am making a breaking change to a low level core that is used in many others across libraries and being able to find everything that needs to be updated quickly is handy!
I've written a separate tool to do this that will search for all uses of a core and report them but have wondered if it is potentially useful to others. The initial implementation I've got only looks at the latest version of the cores and supports globbing of the VLN fields (eg to find all uses of any core from the vendor vend you could query "vend:*:*")
If you think this is a worthwhile addition to fusesoc I'll put up a PR for a sub command :)
For example given some core files:
#queue.core
name: "vend:lib:queue:1.0.1"
# foo.core
name: "vend:thing:foo:3.0.0"
filesets:
default:
depend:
"^vend:lib:queue:1.0.0"
#bar.core
name: "vend:thing:bar:2.0.0"
filesets:
default:
depend:
"^vend:lib:queue:1.0.0"
The subcommand could look like
$ fusesoc core whatdepends "vend:lib:queue"
vend:lib:queue used in 2 cores:
vend
thing
bar
foo
This can be extended to cover more complicated queries if needed but starting simple feels right to me
That would be super useful! Happy to look at a PR for that