Setup* setup = new Setup();
if (!setup->DoSetup(args[0], false))
return 1;
if (!setup->Run())
return 1;
--
- Digit
To unsubscribe from this group and stop receiving emails from it, send an email to gn-dev+un...@chromium.org.
Another option would be to flesh out the generated `--ide=json` output to be comprehensive and standardized, and just generate that at `gn gen` time and have tools parse the output to figure out what you needed.It would be slower than querying an in-memory graph, of course, but presumably much faster than actually parsing the BUILD.gn files and building the graph from that.
Thanks for your replies.
First, the target audience for this feature is anybody who needs to inspect a complex build graph by doing repeated queries like `gn desc` / `gn refs` / `gn path`.
Which includes myself, since I have to routinely perform these when debugging issues in the Fuchsia build system, where each query can have 12 to 25 seconds of delay, depending on build configuration).
All I can say is that having the query results immediately is quite addictive compared to the current situation :-)
What I call a "daemon" is a server process that moves itself to the background. In this case, this would mean that the first `gn query <command>` call would start a background server process automatically, which would be reused by later `gn query` invocations.
However, managing the lifetime of this daemon requires much more complexity that what is being proposed here (the client needs to reliably detect whether a daemon is already running for the current directory, daemons can get stuck and must be killed manually, or the daemon becomes stale as soon as one input file changes, plus a few other things). I am perfectly happy with having to start the server process in a different terminal explicitly. Note that a daemonized mode can be implemented with a small shell script on Unix anyway (though this is more difficult on Windows).
A REPL is a nice feature to have too, but would require more code to handle parsing inputs, which is not always trivial, especially to support history and cursor management. And by the way, I don't know any non-GPL readline alternative that works on Windows.
In a way, the proposal just uses your existing shell as the REPL. And if you really want one, it is possible to implement one as a wrapper script or program on top of `qn query ...` commands.
On Thu, Jan 20, 2022 at 3:13 PM David Turner <di...@google.com> wrote:Thanks for your replies.
First, the target audience for this feature is anybody who needs to inspect a complex build graph by doing repeated queries like `gn desc` / `gn refs` / `gn path`.
Which includes myself, since I have to routinely perform these when debugging issues in the Fuchsia build system, where each query can have 12 to 25 seconds of delay, depending on build configuration).
All I can say is that having the query results immediately is quite addictive compared to the current situation :-)
What I call a "daemon" is a server process that moves itself to the background. In this case, this would mean that the first `gn query <command>` call would start a background server process automatically, which would be reused by later `gn query` invocations.
However, managing the lifetime of this daemon requires much more complexity that what is being proposed here (the client needs to reliably detect whether a daemon is already running for the current directory, daemons can get stuck and must be killed manually, or the daemon becomes stale as soon as one input file changes, plus a few other things). I am perfectly happy with having to start the server process in a different terminal explicitly. Note that a daemonized mode can be implemented with a small shell script on Unix anyway (though this is more difficult on Windows).
A REPL is a nice feature to have too, but would require more code to handle parsing inputs, which is not always trivial, especially to support history and cursor management. And by the way, I don't know any non-GPL readline alternative that works on Windows.The Fuchsia readline library we wrote for the debugger has all of the features you might need and I think it should be easy enough to port to Windows.
For command parsing, I would factor all commands into two halves: one that takes a Setup object and all of the parameters other than the directory, and one that has the existing code that makes the Setup object. The latter would be implemented in terms of the former, and the REPL would call the forner. I think you would probably need something similar for a remote thing anyway.
Le ven. 21 janv. 2022 à 00:36, Brett Wilson <bre...@chromium.org> a écrit :On Thu, Jan 20, 2022 at 3:13 PM David Turner <di...@google.com> wrote:Thanks for your replies.
First, the target audience for this feature is anybody who needs to inspect a complex build graph by doing repeated queries like `gn desc` / `gn refs` / `gn path`.
Which includes myself, since I have to routinely perform these when debugging issues in the Fuchsia build system, where each query can have 12 to 25 seconds of delay, depending on build configuration).
All I can say is that having the query results immediately is quite addictive compared to the current situation :-)
What I call a "daemon" is a server process that moves itself to the background. In this case, this would mean that the first `gn query <command>` call would start a background server process automatically, which would be reused by later `gn query` invocations.
However, managing the lifetime of this daemon requires much more complexity that what is being proposed here (the client needs to reliably detect whether a daemon is already running for the current directory, daemons can get stuck and must be killed manually, or the daemon becomes stale as soon as one input file changes, plus a few other things). I am perfectly happy with having to start the server process in a different terminal explicitly. Note that a daemonized mode can be implemented with a small shell script on Unix anyway (though this is more difficult on Windows).
A REPL is a nice feature to have too, but would require more code to handle parsing inputs, which is not always trivial, especially to support history and cursor management. And by the way, I don't know any non-GPL readline alternative that works on Windows.The Fuchsia readline library we wrote for the debugger has all of the features you might need and I think it should be easy enough to port to Windows.Can you provide a link, I cannot seem to find it under //zircon.
On Thu, Jan 20, 2022 at 4:43 PM David Turner <di...@google.com> wrote:Le ven. 21 janv. 2022 à 00:36, Brett Wilson <bre...@chromium.org> a écrit :On Thu, Jan 20, 2022 at 3:13 PM David Turner <di...@google.com> wrote:Thanks for your replies.
First, the target audience for this feature is anybody who needs to inspect a complex build graph by doing repeated queries like `gn desc` / `gn refs` / `gn path`.
Which includes myself, since I have to routinely perform these when debugging issues in the Fuchsia build system, where each query can have 12 to 25 seconds of delay, depending on build configuration).
All I can say is that having the query results immediately is quite addictive compared to the current situation :-)
What I call a "daemon" is a server process that moves itself to the background. In this case, this would mean that the first `gn query <command>` call would start a background server process automatically, which would be reused by later `gn query` invocations.
However, managing the lifetime of this daemon requires much more complexity that what is being proposed here (the client needs to reliably detect whether a daemon is already running for the current directory, daemons can get stuck and must be killed manually, or the daemon becomes stale as soon as one input file changes, plus a few other things). I am perfectly happy with having to start the server process in a different terminal explicitly. Note that a daemonized mode can be implemented with a small shell script on Unix anyway (though this is more difficult on Windows).
A REPL is a nice feature to have too, but would require more code to handle parsing inputs, which is not always trivial, especially to support history and cursor management. And by the way, I don't know any non-GPL readline alternative that works on Windows.The Fuchsia readline library we wrote for the debugger has all of the features you might need and I think it should be easy enough to port to Windows.Can you provide a link, I cannot seem to find it under //zircon.Sure, it's actually in //src/lib: