rixed / ramen

A stream processing language and compiler for small-scale monitoring
Other
14 stars 4 forks source link

Typing error on the OCaml generated code #1356

Closed rixed closed 3 years ago

rixed commented 3 years ago

Seen in the wild:

Compiling "/srv/ramen/execompserver/cache/v100_26.2.0/m74619738b2e6db19488512d8eb411e47_9aa0b792a15f2367c2d56cdc787c7dad_v100_26_46_2_46_0.ml"
File "/srv/ramen/execompserver/cache/v100_26.2.0/m74619738b2e6db19488512d8eb411e47_9aa0b792a15f2367c2d56cdc787c7dad_v100_26_46_2_46_0.ml", line 709, characters 16-33:
Error: This expression has type
         DessserMasks.t ->
         RamenIp.t option * float * float * Stdint.Uint32.t *
         Stdint.Uint8.t * Stdint.Uint8.t * Stdint.Uint8.t * Stdint.Uint16.t *
         Stdint.Uint32.t * Stdint.Uint32.t * Stdint.Uint32.t *
         Stdint.Uint16.t * Stdint.Uint16.t * Stdint.Uint16.t *
         Stdint.Uint16.t * Stdint.Uint32.t * RamenIp.t option * 'weak108 *
         'weak109 * 'weak110 * 'weak111 * 'weak112 * 'weak113 * 'weak114 ->
         int
       but an expression was expected of type
         DessserMasks.t -> RamenNetflowSerialization.netflow_metric -> int
       Type
         RamenIp.t option * float * float * Stdint.Uint32.t *
         Stdint.Uint8.t * Stdint.Uint8.t * Stdint.Uint8.t * Stdint.Uint16.t *
         Stdint.Uint32.t * Stdint.Uint32.t * Stdint.Uint32.t *
         Stdint.Uint16.t * Stdint.Uint16.t * Stdint.Uint16.t *
         Stdint.Uint16.t * Stdint.Uint32.t * RamenIp.t option * 'weak108 *
         'weak109 * 'weak110 * 'weak111 * 'weak112 * 'weak113 * 'weak114
       is not compatible with type
         RamenNetflowSerialization.netflow_metric =
           RamenIp.t option * float * float * Stdint.Uint32.t *
           Stdint.Uint8.t * Stdint.Uint8.t * Stdint.Uint8.t *
           Stdint.Uint16.t * Stdint.Uint32.t * Stdint.Uint32.t *
           Stdint.Uint32.t * Stdint.Uint16.t * Stdint.Uint16.t *
           Stdint.Uint16.t * Stdint.Uint16.t * Stdint.Uint32.t *
           Stdint.Uint32.t * Stdint.Uint8.t * Stdint.Uint8.t *
           Stdint.Uint8.t * Stdint.Uint16.t * Stdint.Uint16.t *
           Stdint.Uint8.t * Stdint.Uint8.t
       Type RamenIp.t option is not compatible with type
         Stdint.Uint32.t = Stdint.uint32
(W) While compiling examples/monitoring/network/traffic: Cannot generate code for "netflow": Cannot compile "function netflow": Typecore.Error(_, _, _), quarantining until ...

Another instance:

File "/srv/ramen/execompserver/cache/v100_26.2.0/c253743a89cb1603d1505ac30adcdd1b_afea8149348e06e378da825b1198d11f_v100_26_46_2_46_0.ml", line 450, characters 15-32:
Error: This expression has type
         DessserMasks.t ->
         string * string option * string option * 'weak280 * string option *
         string option * 'weak281 * 'weak282 option * 'weak283 option *
         'weak284 option * 'weak285 option -> int
       but an expression was expected of type
         DessserMasks.t -> RamenCollectdSerialization.collectd_metric -> int
       Type
         string * string option * string option * 'weak280 * string option *
         string option * 'weak281 * 'weak282 option * 'weak283 option *
         'weak284 option * 'weak285 option
       is not compatible with type
         RamenCollectdSerialization.collectd_metric =
           string * float * string option * string option * string option *
           string option * float * float option * float option *
           float option * float option
       Type string option is not compatible with type float
(W) While compiling examples/monitoring/hosts: Cannot generate code for "collectd": Cannot compile "function collectd": Typecore.Error(_, _, _), quarantining until ...

Same error can actually be obtained with:

$ make examples/programs/monitoring/network/traffic.x