Git Product home page Git Product logo

Comments (5)

mpizenberg avatar mpizenberg commented on July 30, 2024

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.

mpizenberg avatar mpizenberg commented on July 30, 2024

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.

mpizenberg avatar mpizenberg commented on July 30, 2024

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.

Eh2406 avatar Eh2406 commented on July 30, 2024

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.

mpizenberg avatar mpizenberg commented on July 30, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.