pebbe / zmq4

A Go interface to ZeroMQ version 4
BSD 2-Clause "Simplified" License
1.17k stars 163 forks source link

remove patch version check #123

Closed kai5263499 closed 6 years ago

kai5263499 commented 6 years ago

The minor version check prevented me from compiling on Ubuntu 14.04 and deploying to an Ubuntu 16.04 instance.

pebbe commented 6 years ago

Can't do this because, unfortunately, patch updates in ZeroMQ are not always just patch updates. Some do introduce incompatible changes with previous patch versions.

If you want a better checking mechanism, you have to figure out exactly which patch updates are compatible with previous versions, and which are not. I haven't yet had time (or motivation) to do this.

pebbe commented 6 years ago

I updated the compatibility check. If a patch update of ZeroMQ doesn't introduce an incompatibility, it is considered the same as the previous patch version.

kai5263499 commented 6 years ago

Thanks! On your patch you have

v, ok1 := api[[2]int{major, minor}]
w, ok2 := api[[2]int{int(C.zmq4_minor), int(C.zmq4_patch)}]

How does that work with the api compatibility map you have right above that? In particular, I'd like to mark 4.1.3 as being compatible with 4.1.4

kai5263499 commented 6 years ago

I added these entries to the map

[2]int{1, 3}: 4,
[2]int{1, 4}: 4,

and changed the version check to be

v, ok1 := api[[2]int{minor, patch}]
w, ok2 := api[[2]int{int(C.zmq4_minor), int(C.zmq4_patch)}]

Is that what you had in mind for a compatibility version check?

pebbe commented 6 years ago

4.1.3 and 4.1.4 are considered compatible by the current check. You don't need to add anything.

pebbe commented 6 years ago

Ah, I see my mistake. Using major and minor instead of minor abd patch. I will fix it.

pebbe commented 6 years ago

I fixed it.

kai5263499 commented 6 years ago

Thanks!