George3d6 / Inquisitor

An easily extensible, minimal footprint monitoring tool. (Still in the testing phase)
BSD 2-Clause "Simplified" License
30 stars 4 forks source link

Warn on semvar incompatabilities #38

Closed Deedasmi closed 6 years ago

Deedasmi commented 6 years ago

The agent and receptor should provide compilation warnings when plugins have a lower 'major release' version than the agent/receptor itself. i.e. Agent version 1.0.0, Alive plugin version 0.9.5.

This should also apply to agent_lib, shared_lib, etc.

George3d6 commented 6 years ago

How would this be even done ? Maybe implemented as part of the plugin creator macro using the metadata from the cargo files... I guess, seems a bit complex, maybe worth looking into but I don't think it would come in that handy and it would add even more complexity to the plugin initialization macro and the build system.

Overall, if the plugins are incompatible with the API the code just won't compile, if they are, they should still work more or less as intended.

Deedasmi commented 6 years ago

My thought was build.rs has access to the cargo metadata and can glance at versions. It should be able to warn/panic the build as soon as it finds an issue. Won't change plugin initialization at all.

Reasoning behind it is because if there is an API issue the error messages don't always say what plugin has the API issue. If you recall the output I posted a couple weeks ago, one API error caused every plugin to throw compilation errors. This is just an easy way to make the 1.0 transition easier.

Although we could make it work for all API changes if we also checked minor version on major version 0 with your semvar recommendation....

Although, yes, I agree this may not be worth the time it takes to work on.