Making changes to the IDL crate, e.g. adding features such as the convert feature, would require bumping the version even if the spec itself doesn't change. We essentially have two options to fix this:
Remove the patch version from the spec field i.e. use 0.1 instead of 0.1.0 so that patch changes to the IDL crate version does not affect the spec field
Add a new spec crate that only contains the IDL type specification so that the crate only gets a new version when there is an actual spec change
Add a separate anchor-lang-idl-spec crate that only contains the IDL type specification, and re-export it from the main IDL crate to keep backwards compatibility.
Problem
Making changes to the IDL crate, e.g. adding features such as the
convert
feature, would require bumping the version even if the spec itself doesn't change. We essentially have two options to fix this:spec
field i.e. use0.1
instead of0.1.0
so that patch changes to the IDL crate version does not affect thespec
fieldspec
crate that only contains the IDL type specification so that the crate only gets a new version when there is an actual spec changeWhile both options seems viable, combined with the reasons explained in https://github.com/coral-xyz/anchor/pull/2901, the latter option seems to be more suitable.
Summary of changes
Add a separate
anchor-lang-idl-spec
crate that only contains the IDL type specification, and re-export it from the main IDL crate to keep backwards compatibility.