I have a cross-platform build - since there's no debugger for Native Client yet, I made sure to keep the program I'm porting still running under windows, so I can still debug the bulk of my code.
Logging, logging, logging. Printf debugging is nigh-intolerable, but that's what I've got right now. When faced with a bug, I add instrumentation until it's narrowed down. Crash bugs are the worst, because they'll likely crash my logger, too, before all of the old logging messages have flushed - there I often find myself commenting out more and more code until the crash bug goes away...
I haven't figured out the voodoo that makes Chrome decide whether it's going to use the .nexe from the cache or a new one. So the first thing my program logs is __DATE__ and __TIME__, so I can make sure the program it's running is indeed the one I just built. And if it's not I clear the cache.
Version control. If I introduce a bug that has me tearing my hair out, I can go back to a previous version. I have to remember to check in often!
Using --jobs # with Scons. That cut my build time by 25%. (Trying to get precompiled headers to work actually slowed down my build enormously ... I'm considering metafiles at this point.)
I had some success with forcing the cache to reload by using the same trick designers use to flush css/js out of the cache - add '?v=' followed by an incrementing version number to the URL.
eg, in the NMF:
{"url": "SyNaCl_x86_64.nexe?v=5"}
I modded site_tools/nacl_tools.py to make scons do this automatically, in AllNaClModules :
'x86-32': '%s_x86_32.nexe?v=%i' % (module_name, time.time())
... well, you get the picture. Limited testing online seems to show Chrome reloading the NEXEs if the suffix changes and loading from the cache if they don't (eg. if I just touch the nmf and not the versioning numbers)
To be fair I haven't had many problems with it not recognising new builds, though. Yet.
I have only just started dabbling with NaCl but am quite hooked. A couple of ramblings here - http://tinyurl.com/synacl - but suspect most of it you've already encountered. Will pass on the --jobs # tip, has sped my builds up a great deal too!
Posted by: ishani | August 11, 2011 at 06:32 AM