Strategies for finding binary dependencies

add info on meson IntrospectionInterpreter

+6 -4
+6 -4
README.md
··· 121 121 122 122 Clearly, the syntax of build recipe files is complex enough to require actual parsing and evaluation. 123 123 124 - Such a static analysis of build recipes is possible, though. Lightweight parsers for build recipes already exist, such 125 - as [parse.c][muon-parser] from [muon][muon], which is a lightweight Meson implementation. Such a parser could be used to 126 - turn build recipes into [AST][ast]s, which can then be evaluated using custom rules that do nothing but collect 127 - the names of all dependencies referred to in the build recipe. 124 + Such a static analysis of build recipes is possible, though. Lightweight interpreters for build recipes already exist, 125 + such as [parse.c][muon-parser] from [muon][muon], which is a lightweight Meson implementation. In fact, meson itself 126 + provides an [IntrospectionInterpreter][meson-introspection] capable of identifying dependencies. Such interpreters could 127 + be used to turn build recipes into [AST][ast]s, which can then be evaluated using custom rules that do nothing but 128 + collect the names of all dependencies referred to in the build recipe. 128 129 129 130 Of course, such a parser-evaluator would have to be written for each build system, but once the most popular build 130 131 systems, such as CMake and Meson, are covered, it seems likely that the dependencies of a good proportion of C/C++ ··· 245 246 [linker]: https://en.wikipedia.org/wiki/Linker_(computing) 246 247 [meson-deps]: https://mesonbuild.com/Dependencies.html 247 248 [meson-file]: https://github.com/numpy/numpy/blob/main/numpy/meson.build 249 + [meson-introspection]: https://github.com/mesonbuild/meson/blob/master/mesonbuild/ast/introspection.py 248 250 [meson]: https://mesonbuild.com/ 249 251 [mkl]: https://docs.cirrus.ac.uk/software-libraries/intel_mkl/ 250 252 [muon-parser]: https://git.sr.ht/~lattis/muon/tree/master/item/src/lang/parser.c