Skip to content
  • Iustin Pop's avatar
    Add custom code for CV_E* constants to convert-constants · 9ba02574
    Iustin Pop authored
    
    
    Currently, the cluster verify errors are defined as follows:
    
    CV_ECLUSTER_FOO = (TCLUSTER, "ECLUSTER_FOO", "description")
    
    This means there's no standalone name for the string "ECLUSTER_FOO",
    which makes it hard to derive automatically a type for this union in
    Haskell.
    
    There are three possible fixes:
    
    - manually separate the CV_ECLUSTER_FOO_STR = "ECLUSTER_FOO" in
      constants.py
    - manually extract the strings in Haskell code
    - change convert-constants to automatically export virtual constants
      for those
    
    After discussion on IRC, I've taken the latter approach; even though a
    bit hack-ish, it avoids manual work and potential errors.
    
    Signed-off-by: default avatarIustin Pop <iustin@google.com>
    Reviewed-by: default avatarMichael Hanselmann <hansmi@google.com>
    9ba02574