Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions json_serialization.nimble
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ license = "Apache License 2.0"
skipDirs = @["tests", "fuzzer"]

requires "nim >= 1.6.0",
"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

"stew >= 0.2.0 & < 0.3.0",
"results >= 0.5.0 & < 0.6.0"

let nimc = getEnv("NIMC", "nim") # Which nim compiler to use
let lang = getEnv("NIMLANG", "c") # Which backend (c/cpp/js)
Expand Down
Loading