GithubHelp home page GithubHelp logo

Reverse dependencies about hackage-server HOT 10 CLOSED

haskell avatar haskell commented on June 10, 2024 3
Reverse dependencies

from hackage-server.

Comments (10)

gbaz avatar gbaz commented on June 10, 2024 2

should be resolved with the merge of #551

from hackage-server.

gracenotes avatar gracenotes commented on June 10, 2024

The main problem with dependencies is that there are just so many of them! So, the implementation allowed you to answer these questions for a given package very quickly:

  • /package/baz-1.0, /package/baz/reverse/summary
    • How many different packages have some version which depends directly on some version of baz?
    • How many different packages have some version which depends directly on baz-1.0?
  • /package/baz/reverse/summary
    • How many different packages have some version which depends directly or indirectly on some version of baz?
  • /package/baz/reverse/all
    • What are the different packages which have some version which depends directly and indirectly on any version of baz, and how many direct and indirect reverse dependencies do they each have?
  • /package/baz-1.0/reverse
    • What are the packages for which the latest version depends on baz-1.0, and what are those respective versions?
  • /package/baz-1.0/reverse/old
    • What are the different packages for which the latest version does not depend on baz-1.0, but some older version does, and what are those respective versions?
  • /packages/reverse
    • What are all packages which have direct reverse dependencies, sorted by the number of direct reverse dependencies, and what is the number of total (direct + indirect) reverse dependencies they have as well?

Some of the problems of the implementation:

  • All flags-controlled alternatives are allowed to be true simultaneously so no dependencies are missed-out on (see getAllDependencies).
  • I am certain space leaks abound.
  • Because ReverseIndex is an acid-state component with frequent updates, these updates should take in as small arguments as possible to keep the logs as small as possible, which means that it is better for operations to depend on internal state rather than passed-in state.
  • Consequently, non-leaked space also abounded. Updating a package in this scheme requires holding onto:
    • A complete map from a depended-on package baz to the VersionRange of every version of every package with a dependency on baz. This is in case a new version baz-1.2 gets uploaded, so the list of reverse dependencies can be created for that baz-1.2 (if someone depends on baz-1.1.*, they get excluded from this list).
    • A complete map from a depended-on package version baz-1.2 to every version of every package which depends on it. For example, we not only know that foo depends on baz-1.2, but foo-4.0, foo-4.1, etc. This is used for checking if the latest version of foo depends on baz-1.2, or only an older/deprecated version.
    • A complete enumeration of all packages and versions, duplicating the main index. This is in case a package foo-4.4 is uploaded which depends on bar <2.0, foo-4.4 should be added as a reverse dependencies to all versions of bar <2.0 in the index. The only way to get a list of such versions is to have a list of all existing packages.

The structure is complex, but it allows somewhat complex questions to be answered. For example, which packages depend only on an older version of some package, so they can be notified to upgrade to a newer version to help mitigate binary incompatibility? This could be detected for a package candidate. Or, which packages depend on some package only in their older versions, meaning that dependencies are being dropped over time (and may not be useful for determining popularity here)?

As an out-there idea: there are conceivably other services that are just as complicated as revdeps that Hackage might want to offer, like finding similar packages using dependencies, analyzing build reports to make diagnoses, or suggesting tags. Ideally, smart clients could handle as much of these as possible, with the server only providing the UI for them. Can this be done with revdeps?

from hackage-server.

l29ah avatar l29ah commented on June 10, 2024

For the record: https://packdeps.haskellers.com/reverse can be used now to figure out the reverse dependencies.

from hackage-server.

gbaz avatar gbaz commented on June 10, 2024

That has existed for eight plus years. Its irrelevant to this ticket.

from hackage-server.

l29ah avatar l29ah commented on June 10, 2024

It is relevant for people like me that find this ticket as their first google hit and want the functionality now.

from hackage-server.

gbaz avatar gbaz commented on June 10, 2024

This ticket is not for that purpose. Its a ticket for tracking hackage issues.

from hackage-server.

nrolland avatar nrolland commented on June 10, 2024

is this still active ? https://packdeps.haskellers.com/reverse is great but it is missing some hackage packages

from hackage-server.

andreasabel avatar andreasabel commented on June 10, 2024

is this still active ? packdeps.haskellers.com/reverse is great but it is missing some hackage packages

Also, it ignores dependencies under flags (and maybe also conditionals, testsuites?).

from hackage-server.

ysangkok avatar ysangkok commented on June 10, 2024

I think this should be resolved with #1082 (which has screenshots to show the re-added feature). Please let me know if there is a problem with it.

from hackage-server.

gbaz avatar gbaz commented on June 10, 2024

Closing as resolved.

from hackage-server.

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.