Access to runtime_deps at build-time

31 views
Skip to first unread message

arvid.g...@gmail.com

unread,
Jun 13, 2018, 10:15:24 AM6/13/18
to gn-dev
The `runtime_deps` system is amazing, I can collect all the dependencies and build a package out of them for distribution.
However, to do so I have to rely on an external python script, which takes the generated file (generated via `write_runtime_deps` of a target) and creates a bundle (either the parts of a .app, on macOS, or a folder with a directory structure on Windows, Linux). This has one huge disadvantage, which I dislike a lot: it's circumventing the build systems dependency tree, I have to list a non-existant stamp file as input dependency for the action invoking the python script, since neither ninja nor gn know about the output files.
I tried to access the generated file at build time, but since all runtime dep files are written at the end of generation, this is impossible.

Is there any way I could achieve that GN knows about the files? That'd be great, and would eliminate, for example, the custom clean script (since ninja doesn't know about the output files, either), or re-running the build step every time, even though nothing changed.

- Arvid

Brett Wilson

unread,
Jun 13, 2018, 12:30:34 PM6/13/18
to Arvid Gerstmann, gn-dev
There isn't an ordering for the loading of BUILD files, so GN won't know the dependency tree until after the script as run. As a trivial example, say your target has a dependency on a target defined below it in the same file, the script will have no way of knowing what that later target brings in.

Brett 

Dirk Pranke

unread,
Jun 13, 2018, 2:56:13 PM6/13/18
to arvid.g...@gmail.com, gn-dev
Can you list the file written by write_runtime_deps() as an input to the target that creates the bundle?

-- Dirk
Reply all
Reply to author
Forward
0 new messages