-
-
Notifications
You must be signed in to change notification settings - Fork 99
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
Don't default the Crystal version to "<1.0.0", use only the lower bound #493
Conversation
I personally think that the version in the |
I cannot support that comment, because:
|
I'm not sure I agree on " The major confusion comes from the semantics of the absence of the |
Well you can't literally just "remove" it from the universe, you still need to specify what happens if people write |
To clarify: that was the typical old style syntax, and there are still plenty of such lines in the wild, those are usually the ones that break due to the implied |
Of course. I was speaking purely theoretical. Yes, the original meaning of Anyways, I'd like to separate concerns and focus on the absence of the |
Why? I think you may be misunderstanding the scope of the issue. Libraries currently fail to install both when the Crystal version is unspecified and when it's specified as |
I just don't think that " For me, the only benefit of that change is to mitigate installation failures of outdated dependencies that still depend on the old crystal version semantics. That might have been a reason to include this change in the shards version distributed with Crystal 1.0. |
Sure. I even agree with that. But we are dealing with numerous libraries that already have that specified, so we can't just say "it's not good" and hide.
Well yes, isn't that what we're doing here? That's 100% of my motivation.
Alright, guess I'll just close this. |
Well, I don't think that part is worth it. But we can still come to a different conclusion. |
I second that. I'm bored with pull requests for empty releases that are a mere "identical to previous version, but installable with crystal 1.0". My shards were already compatible with 1.0. I'm fine with fixing bugs. These shards are fully compatible with Crystal 1.0, but Shards won't install them:
I'll have a bunch more among the next weeks. |
One common thing is when your shard is ok but depends on shards that aren't. What could help would be let shards explicit declare that it should ignore crystal versions of some dependencies, e.g.:
And I agree with the MR.... but in fact it come too late :-(. Have the upper bound is useless since nobody can predict the future to say that a shard wont work with some version, so better to guarantee just what's know at the time, the lower bound crystal version supported. |
Although I understand the present struggle while 1.0 is young, I think that explicit dependencies with versions are a necessity in the long run if you want to allow things to keep working and being usable in scenarios where you can't or wont use the latest version of everything. I fail to see why the language & std-lib version should be different than depending on libraries. Having informative versions offers no clue whether newer or older version should work. If offers no contract whether the author is willing nor was expecting for other than the informative version to support. If I publish a package for 0.x and I am no longer interested in updating it support 1.0 that is fine. The community will need to use a fork that will be maintained. If not, overrides offers a workaround. Of course, things can change from the current status, but I believe the current one is better for the long run. |
That is exactly how you make people uninterested. See @ysbaddaden above. What the current state achieves:
And um let's not even put it as "people who are no longer interested", with this in mind: https://github.com/crystal-lang/html_builder/blob/master/shard.yml (there were even more, but were only very recently updated) |
If I wrote a package that worked fine for 0.35.1 and it still compiles fine for 1.0.0, why do I need to release a new version with no changes? |
https://twitter.com/ysbaddaden/status/1381015518728089603?s=20 Can we please fix it? This doesn't make any sense. Say I have a shard that says
As you can see, before this PR we simply ban any shard that wasn't updated to say "crystal: 1.0.0" , "crystal >= 0.35.1", etc. But with this PR, in the happy path scenario (the shard still works fine with 1.0) things just work fine out of the box. Users are not annoyed. In the case it doesn't work fine you will get a compile error. You'll have to make changes to the shard. That's also true before this PR! So the situation remains the same for broken shards. But for working shards, the situation is improved. There's a catch: what if crystal 1.0.0 introduced a semantic change? Then maybe the shard still compiles fine with 1.0, but it works in a bad way. Should we just consider all shards broken because of that? NO! If there's a semantic issue, you'll surely find out when you install the shard. Because maybe my shard has a semantic bug now in 1.0, but what if I don't have a test to prove it? In summary, knowing if something works fine with 1.0 besides compile errors is impossible to automate, so we shouldn't just ban all existing shards. Please, please, change this! It gives a really bad image of Crystal 🙏 Another summary: if my shards says Look at this shard: https://github.com/maiha/base32.cr/blob/main/shard.yml . It's really simple! Just uses a couple of String, Int and Hash functions. But guess what? No crystal version is specified. Nobody can install it without passing |
What's even worse is that there's an escape hatch: I can actually install that shard if I pass If there's the possibility to pass |
@asterite I have said most of this before, mainly #413 (comment). Absolutely all of this was predicted, we didn't need to see it to realize. Moreover, almost everyone agreed that this was not good, including the majority of core team members. The fact that a few people were still able to push this through, without listing any real advantages of this, and ignoring the numerous pointed out disadvantages, should be (for lack of a better word) investigated. Even now it is really weird that anyone needs to plead for this, especially @asterite, the creator of the language, and with overwhelming support. |
@asterite having the author of the shard making a new release just to change the version is nothing compared with everyone else having to wonder if a shard is still compatible with new Crystal versions or not. It's annoying to have to release just one more version of each shard just to change the Crystal version in it? Sure. But the idea was to remove that annoyance from everyone else for unmaintained shards. Setting the version doesn't give any warranty, but at least is the author who claims its compatibility. Authors that set this value to So, the idea was to give a tool to help the community, not to give bad image. Actually I think it's the attitude of many main contributors what hurts the image. |
...like they're doing now?
Yes, that is actually what we are talking here. The transition is broken and let's not bring far future into this. |
@oprypin please don't quote just part of what I said to take them out of context. That's disrespectful. And the transition is broken just because shards maintainers have to release a new version that only takes 5 minutes to them to do it? What I'm saying is that we were more concerned about future migrations from 1.x to 2.x than the migration from 0.36 to 1.0. We wanted, as I think we stated many times, to be able to make non backward compatible changes in 2.x. |
@waj I disagree that that quote is any different without context than in context. And let me reiterate why I disagree with it. People here are talking exclusively about the ongoing transition to 1.0, and then you come in and deflect that by talking about long-term considerations. The long-term considerations cannot be used as an argument regarding the current state, because there's literally no way for them to kick in until Crystal 2.0 is on the horizon.
Yes. |
And let me make the agreeable solution fully clear: Removing the check that says 0.36.0 and 1.0 are incompatible now doesn't mean that later 1.0 and 2.0 can't be declared incompatible. |
I think this is the key point. Why prepare for the up coming 2.0 which we still have no idea how (or if) it will break things? Not much changed between 0.35.1 and 1.0.0, so the majority of shards will work just fine. What other language does a restriction like this at the language level? And why isn't this a problem in languages that don't do this? |
Please let's not delve into this, it doesn't matter at the moment. I am only reverting the biggest breaking change for syntax which was used everywhere but never had such a meaning. And the meaning of the syntax doesn't even matter much for new usages because almost everyone uses |
As other shards authors, I was hit by this empty update to keep compatibility. As Crystal user, I was extremely annoyed that I had to fork most of my dependencies and correct the Crystal version, even that all these shards were already compatible with 1.0.0 Coming from Ruby land, as RubyGems contributor and author of some gems, I can comment that is an utopia trying to force and coerce a required Ruby version to library authors and that ends causing is lot of noise and frustration on users. A library author cannot predict if next minor or major version of your language will break the specific parts of the language your library is using. Only nearing a release/nightly of what is going to be is the only moment you can determine if you need to reduce your supported spectrum of compatible versions. But that also means your library is maintained. We all dream with semantic versioning will be the solution, but even that while try it, we know that sometimes that is not possible. There are libraries that are feature complete, don't need updates, but this new version restriction is adding noise to someone that already created and shipped something that already works, that doesn't depend on anything that could break. One concrete example, but many similar PR: luislavena/radix#32. The last time Radix had to deal with compiler changes to be compatible was in 2016 with Crystal 0.15...: luislavena/radix#8 Thanks for reverting this change and hope can be part of the next release. ❤️ ❤️ ❤️ |
I think this completely misses the real problem here. The 5 minutes every shard maintainer needs to update the shard is negligible. If that just "somehow" happend around release time, everything would be perfect. But it is not. It takes time for maintainers to realize they need to act and be able to act. The fact that even many crystal-lang shards are still missing a release to declare compatibility with Crystal 1.0 is a clear confession of failure. |
I want to revisit more or less the criteria used. Ideally, I would have prefered that the same semantics could be applied for crystal version and for any other dependencies. Easier to explain and tidy enough. But that would have broken all packages and crystal init would need to be updated since Prior Shards 0.14 the crystal version was informative. If we would have kept that then there was two choices: Add a schema version to the Both alternatives were more uncomfortable to explain to the user. So the best we could do, in order to have a strict version check, and not break the ecosystem for Crystal 0.x was to make The decision was made consiously and with Crystal 2.0 in mind. I don't think is a good thing to not establish a policy for 2.0 and see it in the future. I think that the price of updating the ecosystem on major versions is fine. Shards might not be migrated, it's fine, packages are always being deprecated. The fact the some people are complaining is because they don't agree or don't know about this change, despite that we've announced it in Aug '20. And the fact that some crystal-lang packages have not been updated is because we lack organization or we think maybe they are worth leaving them behind in the 0.x era. Things are not broken, but some prefer a more loose semantics in Crystal version. I wonder, why that is not try on every other package? Why not leave just the package name and let it be? Don't you think that will be to chaotic in the long run? Making the If we don't honor semver in the crystal version restriction then we are left probably with what this PR is aiming: I don't think we will convince each other. It's a matter of preferences, there is no right or wrong. The most I can do is to remove myself from the equation regarding this topic. |
@bcardiff My problem is the default constraint being |
Sorry to cheap in late in the conversation, I'm just detaching the parachute from my back... It's clear that this is a 7-headed beast, and I don't think there is an obvious "right" or "wrong" on this matter. Now, as I see it, the And let me note something: even a small thing like adding a type annotation might break a dependency. Then, even claiming "x.y" might be a lie when transitioning from "x.y.z" to "x.y.(z+1)". And, like Ary mentioned above, there can be a semantic difference breaking things... So we have two options: If we ignore the check, users have to find out if things work in their systems or not. If we impose a restriction (=, >=, whatever), if it is too restrictive it will force many people to Then, what is the way out? My proposal is to default to warning: "The maintainer didn't specify it works on your system; they might be pleased to know how it went. Note that it might compile, yet not work properly.", with a |
This appears to be stalled. A "perfect" solution was suggested, but is anyone working on the implementation, and is it going to be approved any time soon? The bleeding is ongoing. Why is it so difficult to just revert the check for now, release, and then proceed to add it back in whatever shape desired? |
The "bleeding" will continue until the next release is out, isn't it? Just merging this PR won't make a release. Or am I missing something? |
Right, so a release should be made after merging this, and the apt repos can get a crystal-1.0.0-2 package with this. (really shards should be a separate package but this is not the time to change that) |
@beta-ziliani suggestion is implemented in https://github.com/crystal-lang/shards/tree/feature/warn-only-crystal-version and is based on this PR in case that is wanted. What is the expected semantics of |
About |
Given the current behavior I'm not super confident that most people have put a restriction specifier into their |
Statistics for shards listed at shardbox are available here: https://shardbox.org/stats A more condensed summary:
|
Given that, I think |
Perhaps there was something of my proposal that got lost in communication, or I missed something about all this (in which case, be patient and explain it like I'm 5...). A better way of understanding my idea is as a "compatibility" badge, and this is something we can't possibly put in the future. By not committing to the future, we only say a honest "we don't know" to those that are not listed in the field. What is the problem with this, and how would the commitment to the future fix it? |
@beta-ziliani Honestly now I'm actually confused, whereas after your previous message (or I mean 3 ago) I wasn't. |
Re-reading my message I see it's pretty obvious I'm against promising things will work in the future. Isn't it? I'm confused too! |
But it doesn't really matter how we interpret the lack of symbol in front of the version no. I was aiming to the more restrictive interpretation. |
I just made the PR form @bcardiff code of my proposal (+ this PR). If this is sufficiently good for everyone, I say let's move on :-) |
Hello @bcardiff @beta-ziliani, any further updates on #496 that are blocking? Thank you. |
We'll get it soon, thanks for pinging @luislavena |
#496 was merged including this PR, I'm closing this one. |
Fixes #413
As I said in #413 (comment), when discussing this breaking check, there was no motivation specified in terms of how this makes developers' lives better at all. And seems that the majority does not want this check.
Behavior before #395:
crystal:
field does nothingBehavior now:
crystal
unspecified means< 1.0.0
crystal: x.y.z
means>= x.y.z, <(x+1).0
Behavior with this PR:
crystal
unspecified means*
/ does mostly nothingcrystal: x.y.z
means>= x.y.z
It is still possible to explicitly write
crystal: ">=0.35, <2.0"
and the check will trigger.