本人把emq2.3.7版本写的插件copy到新版本emq2.3.11之后,编译可以通过,但是运行报错。经过反复调试发现,是版本号有区别造成:
/home/emqx-rel-2.3.?/deps/emq_auth_clientid/Makefile
emq v2.3.7
PROJECT = emq_auth_clientid PROJECT_DESCRIPTION = Authentication with ClientId/Password PROJECT_VERSION = 2.3.7 NO_AUTOPATCH = cuttlefish BUILD_DEPS = emqttd cuttlefish dep_emqttd = git https://github.com/emqtt/emqttd master dep_cuttlefish = git https://github.com/emqtt/cuttlefish
emq v2.3.11
PROJECT = emq_auth_clientid PROJECT_DESCRIPTION = Authentication with ClientId/Password PROJECT_VERSION = 2.3.11 NO_AUTOPATCH = cuttlefish BUILD_DEPS = emqttd cuttlefish dep_emqttd = git https://github.com/emqtt/emqttd master dep_cuttlefish = git https://github.com/emqtt/cuttlefish v2.0.11
源码升级之后,版本号出现了差异。PROJECT_VERSION和dep_cuttlefish的版本有变化。dep_cuttlefish的后缀指明了v2.0.11
如果用户自己把2.3.7的deps路径下的插件源码拷贝到2.3.11,需要把上诉的两个版本号调整为2.3.11对应的版本号。否则程序编译执行会有问题。