Debugging webrtc gyp files

54 views
Skip to first unread message

Devin Heitmueller

unread,
Oct 26, 2015, 4:41:03 PM10/26/15
to discuss-webrtc
Hello,

I'm doing some debugging of the webrtc build, and am trying to trace through the various build options managed through gyp files.

Can anyone who works with this stuff daily point me to any resources for debugging gyp files?  The ones I'm looking at are littered with conditionals, and it would be *very* useful to either be able to inject the equivalent of a printf() in there at certain points, or be able to print out the entire parsed JSON structure after it's been processed.  My goal is really to just be able to print out the intermediate values, so I can trace backwards how certain build decisions are being made.

This is the equivalent to the classic case in C programming where you ask yourself, "how the heck did that #define get set to XYZ?"....

Looking through what little gyp documentation I've found, it's mostly focused on the syntax of implementation, with few pointers on debugging for when things go wrong.

Also, are changes to the gyp files picked up automatically (i.e. the next time I run 'ninja -C out/Debug')?  Or do I need to run some command to regenerate the build files after modifying the gyp?

I realize the webrtc developers may interpret this to be a bit off-topic (aside from the fact that their entire project relies on the gyp build system).  If there is some other forum or IRC channel where such questions are better to ask, don't hesitate to point me in that direction and tell me to get lost.  :-)

Any suggestions/pointers that can be offered would be greatly appreciated.

Thanks in advance,

Devin


Henrik Kjellander

unread,
Oct 27, 2015, 2:26:59 PM10/27/15
to discuss...@googlegroups.com
On Mon, Oct 26, 2015 at 9:41 PM, Devin Heitmueller <dheitm...@kernellabs.com> wrote:
Hello,

I'm doing some debugging of the webrtc build, and am trying to trace through the various build options managed through gyp files.

Can anyone who works with this stuff daily point me to any resources for debugging gyp files?  The ones I'm looking at are littered with conditionals, and it would be *very* useful to either be able to inject the equivalent of a printf() in there at certain points, or be able to print out the entire parsed JSON structure after it's been processed.  My goal is really to just be able to print out the intermediate values, so I can trace backwards how certain build decisions are being made.

Debugging GYP is painful unfortunately (which is one of the reasons why GN is being developed as a replacement).
In WebRTC, we run GYP using a script: webrtc/build/gyp_webrtc (runs as part of the runhooks setup in the DEPS file).
To debug it with printf-style statements, you'll have to dig into the GYP source code which is located in tools/gyp. There you can hack Python down the route of the generation (tools/gyp/pylib/gyp/generator/ninja.py is probably a good start).
 
This is the equivalent to the classic case in C programming where you ask yourself, "how the heck did that #define get set to XYZ?"....

Looking through what little gyp documentation I've found, it's mostly focused on the syntax of implementation, with few pointers on debugging for when things go wrong.

Also, are changes to the gyp files picked up automatically (i.e. the next time I run 'ninja -C out/Debug')?  Or do I need to run some command to regenerate the build files after modifying the gyp?

Changes aren't picked up automatically, you have to run webrtc/build/gyp_webrtc to regenerate the ninja files.

I realize the webrtc developers may interpret this to be a bit off-topic (aside from the fact that their entire project relies on the gyp build system).  If there is some other forum or IRC channel where such questions are better to ask, don't hesitate to point me in that direction and tell me to get lost.  :-)

This is the right place to ask. You can always try #webrtc on Freenode IRC but it's not very active.
 

Any suggestions/pointers that can be offered would be greatly appreciated.

Thanks in advance,

Devin


--

---
You received this message because you are subscribed to the Google Groups "discuss-webrtc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to discuss-webrt...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/discuss-webrtc/16562290-02bb-4c94-8900-e888d8a188f2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages