thrift-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James E. King, III (JIRA)" <>
Subject [jira] [Resolved] (THRIFT-4393) repeated runs of compiler produce different binary output at plugin interface
Date Thu, 11 Jan 2018 04:48:00 GMT


James E. King, III resolved THRIFT-4393.
       Resolution: Fixed
    Fix Version/s: 0.12.0

Committed - thanks!

> repeated runs of compiler produce different binary output at plugin interface
> -----------------------------------------------------------------------------
>                 Key: THRIFT-4393
>                 URL:
>             Project: Thrift
>          Issue Type: Improvement
>          Components: Compiler (General)
>    Affects Versions: 0.10.0
>         Environment: Ubuntu 16.04, Linux amd64, but generally applicable
>            Reporter: Chet Murthy
>            Assignee: James E. King, III
>            Priority: Trivial
>             Fix For: 0.12.0
> TL;DR the plugin interface produces serialized thrift objects containing integers derived
from addresses; this results in repeated runs producing differing output, and that's unpleasant.
 This is easy to test and easy to fix.
> Longer: The plugin interface is really nice, and I'd like to use it for more things.
 One problem with it, is that from run-to-run, the data given to the plugin can and does change,
b/c there are "ids" (e.g. "t_type_id") that are derived from pointer-addresses inside the
compiler.  It'd be nice to replace those with generated integers starting at a fixed base.
 In short, instead of random integers scattered thru the plugin, we'd get (say) numbers starting
at 1000000 and consecutively increasing.  Each different kind of ID would start at that same
base, and the assignment would be based on how the "converter" from internal types to thrift
types walked the data-structure.  Which should be deterministic.  So that would give a determinsitic
output to the plugin.
> This is *easy* to unit-test: just use /bin/cat as a plugin and compare subsequent runs.
> I'll write a unit-test and then a patch.

This message was sent by Atlassian JIRA

View raw message