Nice, thanks for trying this out, this could be very useful.
I'm not sure how we can test this well. At least a "probabilistic test"
where
have a lot of pdbs generated by compile steps and then have them used by
different mspdbsrvs. But since we don't know the actual requirements and
constraints it might be tricky to come up with a solid test. siggi, any
ideas?
I'll try to think about it a bit more.
https://codereview.chromium.org/83803003/diff/10002/pylib/gyp/win_tool.py
File pylib/gyp/win_tool.py (right):
https://codereview.chromium.org/83803003/diff/10002/pylib/gyp/win_tool.py#newcode37
pylib/gyp/win_tool.py:37: self._is_started =
self._MaybeStartMsPdbSrv(env, args)
no _ prefix on member variables
initialize the various things you intend to use as members of this class
here to None:
self.mspdbsrv_start_process = None
self.mspdbsrv_stop_process = None
self.env = None
|is_started| seems redundant with |mspdbsrv_process|, just remove it?
https://codereview.chromium.org/83803003/diff/10002/pylib/gyp/win_tool.py#newcode39
pylib/gyp/win_tool.py:39: def __del__(self):
__del__ isn't good as it's when it happens to get GCd, or possibly
never. Instead use __enter__ and __exit__ and in the usage location, use
with MsPdbSrvHelper(...) as mspdbsrv:
blah
and then __exit__ will be called on the end of that scope.
https://codereview.chromium.org/83803003/diff/10002/pylib/gyp/win_tool.py#newcode60
pylib/gyp/win_tool.py:60: endpoint_name = arg[arg.rfind(':') + 1:] +
'_mspdbsrv_endpoint'
is the ':' the drive separator? i know i suggested this to test, but
instead, it'd be better to pass the target name through in the calls to
gyp-win-tool link-wrapper and add another argument after $arch that's
the endpoint name. (there's only 3 callsites and they're all
windows-only)
https://codereview.chromium.org/83803003/diff/10002/pylib/gyp/win_tool.py#newcode79
pylib/gyp/win_tool.py:79: '-spawn')
when i run "mspdbsrv -start -spawn -endpoint abcd" from the command line
it doesn't actually seem to spawn, but rather blocks. does it do
differently for you? (i didn't try running it from within python though)
https://codereview.chromium.org/83803003/diff/10002/pylib/gyp/win_tool.py#newcode84
pylib/gyp/win_tool.py:84: stderr=subprocess.STDOUT)
i don't think there's any stdout/stderr, but just in case, don't
redirect them because if there is they'll get swallowed (also, you're
not using them anyway.
https://codereview.chromium.org/83803003/diff/10002/pylib/gyp/win_tool.py#newcode97
pylib/gyp/win_tool.py:97: _, _ = mspdbsrv_stop_process.communicate()
and these can just be .wait() instead of .communicate then once you
remove the stdout/stderr redirects.
https://codereview.chromium.org/83803003/diff/10002/pylib/gyp/win_tool.py#newcode144
pylib/gyp/win_tool.py:144: mspdbsrv_helper = MsPdbSrvHelper(args, env)
i'm still concerned that there's a race between the compiler/default
mspdbsrv completing its writes and the linker pdb starting up. it would
be great if you can figure out how to test that, or otherwise, i think
we should at least have the beginning of a link -stop the default
mspdbsrv.
https://codereview.chromium.org/83803003/