shards icon indicating copy to clipboard operation
shards copied to clipboard

Incorrect entries listed as "Unable to satisfy the following requirements" re: crystal version

Open Sija opened this issue 4 years ago • 12 comments

When issuing shards install/update command, shards are refusing to cooperate due to unsupported crystal version in some of the dependencies and I'm greeted with a list of shards that are "Unable to satisfy the following requirements":

- `crystal (>= 0.35.0)` required by `raven 1.9.1`
- `crystal (>= 0.36.0)` required by `kemal 1.0.0`
- `crystal (>= 0.35.0)` required by `ameba 0.14.1`

(Notice the satisfied restriction for the shards above.)

But then running the above command with --ignore-crystal-version succeeds and the shards above are no longer (and correctly) logged with the message Shard “___" may be incompatible with Crystal 1.0.0.


For a repro case one can clone https://github.com/Sija/gphoto2-web.cr repo and test above steps.

Sija avatar Mar 30 '21 17:03 Sija

Isn't this expected? Or what's unexpected?

asterite avatar Mar 30 '21 17:03 asterite

>= 0.35.0 restriction satisfies version number 1.0.0, so what's unexpected is seeing shards with such restrictions listed there.

Sija avatar Mar 30 '21 17:03 Sija

>= 0.35.0 does not satisfy 1.0.0

That's according to how it was all planned, to my understanding. See this large discussion: https://github.com/crystal-lang/shards/issues/413

asterite avatar Mar 30 '21 17:03 asterite

It obviously does. I don't follow to which comment you're referring to.

Sija avatar Mar 30 '21 17:03 Sija

https://github.com/crystal-lang/shards/issues/413#issuecomment-648393629

asterite avatar Mar 30 '21 17:03 asterite

@asterite AFAIU it relates to the ~> operator.

Sija avatar Mar 30 '21 17:03 Sija

>= 0.35.0 does not satisfy 1.0.0

No, it does. 1.0.0 >= 0.35.0 is totally correct.

So if shards with CRYSTAL_VERSION=1.0.0 reports unsatisfied requirement crystal (>= 0.35.0), that's an error.

@Sija I can't reproduce with https://github.com/Sija/gphoto2-web.cr/commit/65a4751f349a30110dee5cc9d92b8763de6a9e66

The output of shards install is:

Unable to satisfy the following requirements:

- `crystal (~> 0.35, >= 0.35.1)` required by `gphoto2 0.9.0`
- `crystal (< 1.0.0)` required by `pool 0.2.3`
- `crystal (>= 0.35.0)` required by `raven 1.9.1`
- `crystal (~> 0.35, >= 0.35.0)` required by `kemal 0.27.0`
- `crystal (>= 0.35.0)` required by `ameba 0.14.1`
- `crystal (~> 0.35, >= 0.35.0)` required by `debug 2.0.0`

This correctly identifies a number of mismatches in Crystal requirements.

straight-shoota avatar Mar 30 '21 20:03 straight-shoota

This correctly identifies a number of mismatches in Crystal requirements.

@straight-shoota It doesn't, look at the requirements for raven and ameba dependencies - these two shards shouldn't have been on this list at all.

Sija avatar Mar 30 '21 21:03 Sija

Indeed, you're right.

straight-shoota avatar Mar 30 '21 21:03 straight-shoota

Maybe it's listing those shards so you can understand the conflict?

asterite avatar Mar 30 '21 21:03 asterite

Yeah, but >= 0.35.1 should be subsumed by all other restrictions except < 1.0.0. And even that is not a conflict.

straight-shoota avatar Mar 30 '21 21:03 straight-shoota

This bug results in spreading confusion re: the version selectors, see https://github.com/crystal-community/timecop.cr/pull/7 and https://github.com/amberframework/amber-router/pull/30 as another instances of that.

Sija avatar Apr 08 '21 09:04 Sija