Skip to content

Conversation

@2-towns
Copy link

@2-towns 2-towns commented May 23, 2025

The dependencies are defined in Nimble without specifying versions, which is problematic as it can break dependency resolution for projects that rely on this library.

This is the case with the last version of nim-stew.

"serialization",
"stew",
"results"
"serialization >= 0.2.0 & < 0.3.0",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we generally don't specify upper ranges on dependencies since this more often than not is obnoxious to users and breaks resolution for no good reason, specially on 0.x-deps.

This is optimistic versioning, where we only add upper ranges once it is known for certain that something broke, in the cases where the breakage cannot be resolved in the downstream user of the package (typically the "end application").

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seen in a different way: upper ranges only make sense for packages that explicitly state they follow semver, which these packages don't (ie like python, Nim has a flexible approach to versioning in its ecosystem).

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hum got it, thanks for the explanation.

So if this package does not follow semver, let's say that the next version 0.2.10 contains a breaking change. Is nimble smart enough to keep the 0.2.9 in my project ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, it's not (I've thought about a "try all versions" style of command that would discover such breakage - would be neat, for autoversioning).

fwiw, the >= constraints are useful - feel free to add them to this library. They should be set to the lowest possible version that works for n-j-s.

Due to how symbol lookups are done, there are very few ways you can change code in nim that is guaranteed not to break downstream code - ie ABI stability is pretty hard to achieve.

The reality of nim is thus "mostly works but might break a few things" and there's no way to express that in semver - specially for libraries like stew which are really collections of libraries where most usages are not affected.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay thanks a lot for those details

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants