Chet Murthy created THRIFT-4393:
-----------------------------------

             Summary: repeated runs of compiler produce different binary output 
at plugin interface
                 Key: THRIFT-4393
                 URL: https://issues.apache.org/jira/browse/THRIFT-4393
             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
            Priority: Trivial


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
(v6.4.14#64029)

Reply via email to