Comments (5)
Nice find! Using Range::none()
in dependencies invalidates the pattern for building incompatibilities reflecting dependencies in the form : { package: Positive(v), dependedUponPackage: Negative(range) }
. Because if Range::none()
is used, we get { package: Positive(v), dependedUponPackage: Negative(Range::none) }
which is equivalent to { package: Positive(v) }
(though the incompat is not reduced when building dependencies) which just says well we cannot pick that package version.
from pubgrub.
There might be an incentive though to authorize people using Range::none()
when they want to express directly that a package depend on another package not being in the dependency. In such case, we should probably identify that Range::none()
and generate an incompatibility of the form { package: Positive(v), dependedUponPackage: Positive(any)}
but that would be a half-backed solution for more advanced "anti-dependency" expressions and I propose to postpone that to the next version if we need it. For now, let's just try to fix the panic in meaningful way.
from pubgrub.
This also makes me wonder how would the solver react to a dependency using the same package (I suppose packages in the hash map will be overwritten leading in pretty wrong conclusions). Something like add_dependency( "p", 0, vec![ ("p", whatever) ])
from pubgrub.
This is a hack but is the resolve
when making dependencies I added:
Some(x) => {
if x.values().any(|r| r == &Range::none()) {
// todo: what is the correct Incompatibility?
state.add_incompatibility(|id| {
Incompatibility::unavailable_dependencies(id, p.clone(), v.clone())
});
continue;
}
x
},
Witch gets this test to pass. What would be a more elegant solution?
from pubgrub.
Witch gets this test to pass. What would be a more elegant solution?
Maybe we should fail, with a dedicated error type explaining why Range::none()
should not be used for dependencies?
from pubgrub.
Related Issues (20)
- Remove `Reporter` trait
- Create a contributions guide HOT 1
- Update reporter implementations to use `&mut Write` instead of buffering strings
- When can the algorithm use `simplify` HOT 2
- Move off actions-rs HOT 1
- Update criterion or replace it
- How to get the report formatting presented in the README HOT 8
- Tests fail when using semantic Eq for Term HOT 7
- Out of date documentation for Dev HOT 1
- Build a benchmark based on UV slow case HOT 5
- A new release and switching the default branch to dev HOT 6
- Declare minimum Rust version HOT 1
- Switch to `swatinem/rust-cache` instead of bespoke `actions/cache` in CI
- CI is failing on dev. HOT 2
- Allow changing the `Display` of `Range` HOT 4
- Panic: "add_derivation should not be called after a decision" HOT 4
- The pubgrub api should be one top level module HOT 2
- Expose apis that allow implementing your own solver loop
- Merge custom incompatibility reasons
- Expose edges in solution HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pubgrub.