Remoting uses a GUID that changes over time for its main class.
midl.py currently just copies over fixed precomputed outputs.
(midl.exe is Windows-only, and we want to be able to build on non-Win).
To make things work, give midl.py a dynamic_guid arg, that, when set,
makes midl.py replace the GUID in the checked-in output with a dynamic
GUID.
The tricky bit is that the GUID also ends up in the binary .tlb file,
which is an undocumented file format. I figured out most of the file
format in https://chromium-review.googlesource.com/c/chromium/src/+/693223
(see around line 26s for an overview). For a dynamic GUID, two things
need to happen:
1. Find where the GUID of the main clas is in the .tlb file, replace it
2. There's a global hash table of all GUIDs. Recompute this hash table
after changing one of the GUIDs.
midl.py still compares the output of "copy file with replaced GUID"
with the output of running midl.exe when on Windows, which verifies
that the tlb modification does the same thing that midl.exe does.
(But the diff now needs to compare the post-copy files instead of
the checked-in files.)
TBR=sergeyu
Bug: 761839
Change-Id: I1fcc3202df3cc4f80a41087668c2c60110fa142c
Reviewed-on: https://chromium-review.googlesource.com/707197
Commit-Queue: Nico Weber <thakis@chromium.org>
Reviewed-by: Bruce Dawson <brucedawson@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#507860}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: fc10d000f13aae3905207b94325a6ffa6b44cfe4