-
-
Notifications
You must be signed in to change notification settings - Fork 101
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
Unable to resolve dependency with pre-release version #572
Comments
Reduced it to a test case in molinillo. Definitely seems related to the pre-release shard version. Steps to reproduce:
{
"console": [
{
"name": "console",
"version": "0.4.0-dev",
"dependencies": {
}
}
],
"framework": [
{
"name": "framework",
"version": "0.17.1",
"dependencies": {
"console": ">=0.3.0, <0.4.0"
}
}
],
"athena": [
{
"name": "athena",
"version": "0.0.0",
"dependencies": {
"framework": "*",
"console": "*"
}
}
]
}
{
"name": "resolves an index with a pre-release version",
"index": "pre_release",
"requested": {
"athena": ""
},
"base": [],
"resolved": [
{
"name": "athena",
"version": "0.0.0",
"dependencies": [
{
"name": "framework",
"version": "0.17.1",
"dependencies": [
{
"name": "console",
"version": "0.4.0-dev",
"dependencies": []
}
]
},
{
"name": "console",
"version": "0.4.0-dev",
"dependencies": []
}
]
}
],
"conflicts": []
}
1) Molinillo::Resolver(R, S) dependency resolution with the TestIndex index resolves an index with a pre-release version
Unable to satisfy the following requirements:
- `console` required by `athena (0.0.0)`
- `console` required by `framework (0.17.1)` (Molinillo::VersionConflict(Gem::Dependency | Molinillo::TestSpecification, Molinillo::TestSpecification))
from src/molinillo/resolution.cr:333:9 in 'raise_error_unless_state'
from src/molinillo/resolution.cr:316:11 in 'unwind_for_conflict'
from src/molinillo/resolution.cr:698:13 in 'attempt_to_activate'
from src/molinillo/resolution.cr:266:11 in 'process_topmost_state'
from src/molinillo/resolution.cr:200:11 in 'resolve'
from src/molinillo/resolver.cr:33:7 in 'resolve'
from spec/resolver_spec.cr:78:7 in 'resolve'
from spec/resolver_spec.cr:96:20 in '->'
from /usr/lib/crystal/spec/example.cr:45:13 in 'internal_run'
from /usr/lib/crystal/spec/example.cr:33:16 in 'run'
from /usr/lib/crystal/spec/context.cr:18:23 in 'internal_run'
from /usr/lib/crystal/spec/context.cr:339:7 in 'run'
from /usr/lib/crystal/spec/context.cr:18:23 in 'internal_run'
from /usr/lib/crystal/spec/context.cr:339:7 in 'run'
from /usr/lib/crystal/spec/context.cr:18:23 in 'internal_run'
from /usr/lib/crystal/spec/context.cr:339:7 in 'run'
from /usr/lib/crystal/spec/context.cr:18:23 in 'internal_run'
from /usr/lib/crystal/spec/context.cr:156:7 in 'run'
from /usr/lib/crystal/spec/dsl.cr:220:7 in '->'
from /usr/lib/crystal/crystal/at_exit_handlers.cr:14:19 in 'run'
from /usr/lib/crystal/crystal/main.cr:50:14 in 'exit'
from /usr/lib/crystal/crystal/main.cr:45:5 in 'main'
from /usr/lib/crystal/crystal/main.cr:127:3 in 'main'
from /usr/lib/libc.so.6 in '??'
from /usr/lib/libc.so.6 in '__libc_start_main'
from ../sysdeps/x86_64/start.S:117 in '_start'
from ?? Pretty sure it's a bug at this point given replacing the three instances of |
This comment was marked as off-topic.
This comment was marked as off-topic.
@jwoertink What you describe is pretty certainly unrelated, so I created a new issue for it: #581 |
The exclusion of dependencies with pre-release versions is deliberate and identical to There is a specific case for a pre-release version matching against a dependency restriction that is not a pre-release and defines that as not satisfying the requirement: shards/src/molinillo_solver.cr Lines 225 to 234 in e56c44a
Note: So I think this should be considered not as a bug report but a discussion about this pre-release behaviour. But considering that bundler behaves the same, I would expect good reasons for it. @Blacksmoke16 Your reduction into a Molinillo test case is great, but it's actually coincidental: Molinillo has no understanding of versions and pre-releases. That's entirely delegated to the user of the Molinillo API, in form of implementing |
Interestingly, the most recent bundler release has added support for the
(The same release also replaced Molinnillo by PubGrub, but I don't think the option is related to the resolver engine) |
I'm still trying to reduce the issue, but for now to reproduce:
SHARDS_OVERRIDE=shard.dev.yml shards install
Currently also unsure if I'm just missing something or there is a bug here.
Debug Notes
shards 0.17.2
shard.yml
doesn't have any version constraints and sources everything from latest GH releaseshard.dev.yml
doesn't have any version constraints either and sources everything from the relatedpath
withinsrc/components
0.4.0-dev
>=0.3.0, <0.4.0
, which0.4.0-dev
should be valid againstmatches?("0.4.0-dev", ">=0.3.0, <0.4.0").should be_true
inshards
repo>=0.3.0, <=0.4.0-dev
produces same error0.4.0-dev
also produces the same errorpath
sources out ofshard.dev.yml
intoshard.yml
and trying again produces:path
part of it is the problem, or the fact the component versions have pre-releasesframework
component not having anathena-console
dep? My assumption was that the override file would make it just use whatever is insrc/components/framework/shard.yml
.The text was updated successfully, but these errors were encountered: