veyron2/{vdl,vom2,ipc}: Finish the vom2 transition.
This CL enables the vom2 transition; vom1 is still the default,
and vom2 is enabled by setting the VEYRON_VOM2 env var to any
non-empty string. All tests pass in both modes, except for 2
tests with trivial differences (nil vs. empty collections). Note
that vom2 uses the updated vdl type system semantics, thus the
difference.
Here are the changes:
o Add type registration to the vdl package, so that the various
security-related features that rely on it can work. I have a
TODO to add support for external types (e.g. Go time.Time),
and have thought through the strategy, and will do that later.
o Add vdl codegen for type names associated with every defined
type, and consolidate the different "__Describe" mechanisms
into a single __VDLDescribe. Associating the name as a
struct field tag allows us to capture it via reflection, and
avoids any weird registration; it's a property of the type.
o Add a simple transition mechanism for vom2; if you set the
VEYRON_VOM2 environment variable to any non-empty string,
we'll enable vom2 mode; all ipc will be over vom2.
o Fixed a bunch of bugs along the way, most due to bad handling
of optional types in value conversion, and with lots of help
from Asim debugging.
o Changed some apps / tests to use verror2. The issue is that
vdl / vom2 uses verror2 as its base error, and verror2
formats error messages slightly differently, with a prefix.
Tests that were string-matching on the error string would
break. It seemed better to just updated them to verror2,
although I was going to kill myself updating the node/impl
tests.
o Changed vdl / vom2 to use nil to represent empty slices /
maps in generated Go code. This is more idiomatic, and leads
to many fewer trivially failing tests.
Note that because of the vdl codegen changes, I'll need to
trivially re-generate the code in every repo; I'll send out
separate CLs for that after I get an OK for this one.
Change-Id: I3d6755b22d59e4087df9a723233af0c963d4a671
29 files changed