-
-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Regression from 3.1 -> 3.2 in values_of
(i think)
#3826
Comments
So the change was we went from We made a fundamental change to how clap tracks argument values in 3.2 that presupposes callers are using the correct In light of this, I am closing this as expected. |
Ahhh. Thanks for the reply. That makes sense. The debug/release split caused me to think I was going a bit crazy because we are using |
Just to clarify here: is clap's official policy that changing the presence of panics between minor versions doesn't constitute SemVer breakage, so long as those panics were previously present in a debug build? This caused some surprising breakage on one of my projects (woodruffw/kbs2#370), but that's possibly because I expected the wrong SemVer policy here. Either case is ultimately fine, but I think an explicit policy would be beneficial 🙂 |
I definitely consider it to have broken semver. I had 42 separate programs break over the weekend as a result of that change. That number may seem like a joke, but I am being quite literal; I had to fix 42 separate programs using the builder api that used the |
As was mentioned before, we generally report development-time errors through debug asserts and a situation where a debug assert would fire but isn't in a release build is undefined behavior in clap. Specifically in this case, we called out the need for It'd be possible to make the old behavior still work though it isn't a priority for me. I would be willing to review a PR for it. Note that |
None of that is really very relevant. I inherited 43 programs that all used clap in the same way. They don’t have tests (at least not ones that use the Rust test runner). They’ve probably never been run in debug mode. Please don’t be so quick to make breaking changes in minor releases in the future. |
@db48x I can understand the frustration when low-touch tools break. However, please keep in mind though that when maintaining software, a line needs to be drawn between what is defined and expected behavior that cannot break and what is undefined or deviates from the definition and can change without being a breaking change (requisite XKCD). The breaking change for this was in clap 3.0 which is relevant.
The functions were coupled together in their use and how we assert to enforce that is more of an implementation detail. Looking back, it does seem that we forgot to update the panic expectations for the Overall, care is given to not intentionally include breaking changes in minor releases and we try to minimize the risk of accidental ones. |
This is the key. Either the panics should have been added in 3.0, or they should have been left out until 4.0. If they were supposed to be there all along and you suddenly noticed that they were missing, you should have decided to simply let sleeping dogs lie and wait until 4.0 to add them in. Especially since their absence was doing no harm. If we had actually tried to use a non–utf8 filename the programs just have failed to parse the arguments, and in the mean time they worked just fine. I am disappointed to find that you’re doubling down now and making excuses, rather than recognizing your mistake and apologizing. |
That isn't necessary. This is an open source project; nobody here is expected to provide unpaid support or satisfy our exact requirements. There was a communication error here, but it's been recognized and their argument (that the API change happened between 2 and 3) is reasonable. |
This is describing a bug fix and to say we cannot fix bugs within a minor or patch release is unreasonable.
For |
Adding a new panic to an existing method that did not panic in the past is a breaking change, not suitable for a minor release. You can fix all the bugs you want as long as the fix doesn’t break anything. If the fix would break something, save it for a major release. Change the documentation to point out the problem, and note specifically that it won’t be fixed until the next major release.
Absolutely. This panic would be perfectly fine! We would have been surprised, but then we would have clearly seen that the error was our own. It would have caused one failure, not 43 simultaneous ones. Additionally, as all of these programs were taking filenames (and directory names, etc) as arguments, the type system makes it pretty inconvenient to make that mistake. The mistake we did make, to use the
I ask for nothing other than a promise that this type of breaking change will be avoided in future minor releases. |
I've tried to engage in this but @db48x has not come across to me as engaging with good faith (seeking to understand, not casting motives or degrading the other participants), I will be backing off from this moving forward. |
Seriously? You accuse me of acting in bad faith? I sought understanding not by asking questions in a bug report. Rather I examined the source code instead, particularly the change that introduced the problem. Having gained understanding, I stopped in here to seek empathy and a promise not to do it again. I received only excuses. Please, just try to do better in the future. Perhaps try rereading the definitions over at https://semver.org/. This was not a “new feature” nor was it “backwards compatible”. |
I'm just a random unaffiliated developer, but: @db48x Paragraph 1 of the semver specification says:
The clap 3.0 documentation stated that your code was using the API incorrectly. Those docs are sufficient to meet semver's requirements, but as a bonus, clap also provided an automatic test to detect that case, which you say you didn't run. Once you violated the API semantics, clap had no obligation to keep your code working, even if it appeared to work for a while. Even if it wasn't obvious at the time, this was your bug. I think folks here understand how painful this fix has been for you, and how surprising. But speaking as an open-source maintainer myself: directing public aggression toward a maintainer just pushes them one step closer to burnout. Please don't do it. Don't do it even if you're convinced they're wrong. Providing free, high-quality, widely used software to the public is hard. Whenever a maintainer decides their life will be better if they abandon their software and go do something that won't get them shouted at by random people on the Internet, we all lose out. I'm sorry this happened to you, and I hope next weekend brings fewer fires. ❤️ |
Don’t put words in my mouth. I have not been aggressive, nor have I shouted at anyone. If you saw those things in my words, then you made a mistake.
No, semver requires backwards compatibility. Not bureaucratic adherence to documentation, just backwards compatibility from one version of the software to the next. This sometimes requires acknowledging that a bug exists but that it cannot be fixed until the next major release. |
We had a panic happen on running `py-spy completions bash`, due to clap-rs/clap#3826 . Fixes #520
We had a panic happen on running `py-spy completions bash`, due to clap-rs/clap#3826 . Fixes #520
Please complete the following tasks
Rust Version
rustc 1.60.0 (7737e0b5c 2022-04-04)
Clap Version
3.2.1
Minimal reproducible code
Steps to reproduce the bug with the above code
Using
clap = "3.2"
withcargo run --release
, I get:Yet specifying
clap = ">= 3.1, < 3.2"
(resolving tov3.1.18
), the program succeeds.Actual Behaviour
Panic
Expected Behaviour
Don't panic
Additional Context
This was seen in dtolnay/cxx#1057
Debug Output
The text was updated successfully, but these errors were encountered: