tun2proxy / rust-tun

TUN device creation and handling.
https://docs.rs/tun2/
30 stars 13 forks source link

Please don't pump minor version with breaking changes. #49

Closed leptonyu closed 4 months ago

leptonyu commented 4 months ago

Newest minor change cause code compile error, because method signature is changed.

Please follow semantic version conversions. https://doc.rust-lang.org/cargo/reference/semver.html

ssrlive commented 4 months ago

Well, yanked the older versions.

M0dEx commented 4 months ago

I agree and was planning on making an issue as well. These changes should either be made in a backwards-compatible way, with a deprecation warning (with a minor version bump), or the major version should be bumped.

I propose to make the last change (tun_name) backwards compatible, which should not be difficult, and add a deprecation warning.

M0dEx commented 4 months ago

Well, yanked the older versions.

This does not help since breaking changes are only expected in new major versions, not in new minor versions, which is a behaviour that Cargo and many users rely on.

A version spec such as ^1.0.0 is still going to upgrade to the 1.1.2 version, which causes the 1.1.2 version to break the "contract" of semver.

ssrlive commented 4 months ago

I know, just i'm lazy.

ssrlive commented 4 months ago

Thanks for warning.

A version spec such as ^1.0.0 is still going to upgrade to the 1.1.2 version, breaking the "contract" of semver.

xmh0511 commented 4 months ago

Since name may easily have multiple candidates listed by IDE prompt when coding, for a better coding experience, the name is replaced by tun_name, which also has a better semantic. However, in terms of the "contract" of semver, we just cannot casually remove name, so, marking name as a deprecated API is a trade-off scheme.