Coder Social home page Coder Social logo

Dependency processing about ckan HOT 12 CLOSED

ksp-ckan avatar ksp-ckan commented on May 21, 2024
Dependency processing

from ckan.

Comments (12)

pjf avatar pjf commented on May 21, 2024

As @NathanKell pointed out on IRC, this isn't safe if one mod needs to overwrite part of another mod (which also relates to #15 ). We may need some sort of signal to indicate that dependencies need to be installed first. If we do go down that route, using it should be discouraged, as well-packaged mods should be install-order independent.

from ckan.

Wizarth avatar Wizarth commented on May 21, 2024

Discouraged but still present - for example, mods for mods (how meta) will definitely need this.

from ckan.

pjf avatar pjf commented on May 21, 2024

@Wizarth : Most mods of mods use ModuleManager to do their changes. This means they don't need to overwrite any files, and install order is truly unimportant. So while RealismOverhaul must be installed after TACLS, it can be installed before before or after any of the other mods it depends upon, just as long as they're all present before one starts the actual game.

So while dependencies themselves are super common (and cyclical dependencies are fine), dependency ordering should be quite rare (and cyclical dependencies are disallowed).

from ckan.

pjf avatar pjf commented on May 21, 2024

Stealing from the debian policy manual, I'm going to suggest we have depends and pre-depends.

I'm also rather partial to their entire relationship model, which includes:

  • recommends - A strong, but not absolute dependency.
  • suggests - A suggestion another mod be installed.
  • enhances - An indication this mod improves the functionality of another mod.

In #11 we also suggest having a supports field, which is a clear indication of compatibility.

@NathanKell, in the example we had of RealismOverhaul, we might say that it depends on ModuleManager, recommends EngineIgnitor, and suggests TextureReplacer.

A typical install (ckan install RealismOverhaul) would install both dependencies and recommends. However a user may do a ckan install --no-recommends RealismOverhaul to get just the bare minimum, or a ckan install --all-suggested RealismOverhaul to get everything it suggests.

(Actual switch options are indicative only, and may change.)

from ckan.

NathanKell avatar NathanKell commented on May 21, 2024

Sounds good to me.

from ckan.

pjf avatar pjf commented on May 21, 2024

Okay, this is my work unit for the day, and also quite possibly the biggest remaining bit of needed functionality. We'll be abstracting a bunch of things into a generalised relationship class. We'll generate a list of install rounds; nominally just one, but if something has a pre-depends that will create an install round before it (and if there's a pre-depends in that, then another install round before that and so on).

To start with, I'll just be doing dependency resolution; anything with a 'pre-depends' will just throw an exception for now.

from ckan.

pjf avatar pjf commented on May 21, 2024

I'm following dependency chains, but they're raising a few issues.

When we install a module, we must install its dependencies, and we may install its recommends list (unless specifically asked not to), and its suggests list (if explicitly requested).

But what do we do in the case of chained recommendations? If A depends on B, and B recommends C, then do we install C when asked to install A?

I'm inclined to go with the following rules:

  • If we're running in --no-recommends mode, we only install dependencies, no matter what.
  • If we're running in --with-recommends mode (the default), we install all recommended modules, all the way down the chain.
  • If we're running --with-suggests we only install the suggested modules for the top-level module, everything else gets the default treatment.
  • If we're running --with-all-suggests, then we install all suggestions, all the way down.

This meas that the default experience (with recommends) gives both user and module authors the configuration they'd expect. Recommends is a strong relationship, so those things should be installed.

Users running --with-suggests get the suggestions for the module they asked for, but not for something six layers deep that was required, but which the user was unaware of. This means we don't surprise the user with unexpected cruft.

Users running --with-all-suggests (suggested alias: --with-kitchen-sink) get what they asked for. ;)

Thoughts and feedback welcome.

from ckan.

Wizarth avatar Wizarth commented on May 21, 2024

Do we know what apt-get does in this circumstance, for reference?

On Sun, Oct 12, 2014 at 6:33 PM, Paul Fenwick [email protected]
wrote:

I'm following dependency chains, but they're raising a few issues.

When we install a module, we must install its dependencies, and we may
install its recommends list (unless specifically asked not to), and its
suggests list (if explicitly requested).

But what do we do in the case of chained recommendations? If A depends
on B, and B recommends C, then do we install C when asked to install A?

I'm inclined to go with the following rules:

  • If we're running in --no-recommends mode, we only install
    dependencies, no matter what.
  • If we're running in --with-recommends mode (the default), we install
    all recommended modules, all the way down the chain.
  • If we're running --with-suggests we only install the suggested
    modules for the top-level module, everything else gets the default
    treatment.
  • If we're running --with-all-suggests, then we install all
    suggestions, all the way down.

This meas that the default experience (with recommends) gives both user
and module authors the configuration they'd expect. Recommends is a
strong relationship, so those things should be installed.

Users running --with-suggests get the suggestions for the module they
asked for, but not for something six layers deep that was required, but
which the user was unaware of. This means we don't surprise the user with
unexpected cruft.

Users running --with-all-suggests (suggested alias: --with-kitchen-sink)
get what they asked for. ;)

Thoughts and feedback welcome.


Reply to this email directly or view it on GitHub
#32 (comment).

from ckan.

pjf avatar pjf commented on May 21, 2024

Aaah, WWAGD? I don't know, but that's a good thing to check. :)

from ckan.

pjf avatar pjf commented on May 21, 2024

It looks like apt-get switches things on and off the whole way down. So by default, you get all the recommended packages for everything. With suggests turned on, you get a kitchen sink.

So I'm essentially doing the same there, but tweaking --with-suggests to not include all the suggestions all the way down. Given how many times I've seen the question asked about how one installs the suggests for the requested module but not everything else¹, I think my deviation from the apt-get way of doing things has merit.

But thanks for mentioning that, WWAGD was indeed the obvious way to see if my plan had potential for sanity. :)

¹ Debian lore has it that installing gparted with suggestions will also give you apache, and a full dev environment for three different languages.

from ckan.

pjf avatar pjf commented on May 21, 2024

More progress on this in 306cc03 with FindReverseDependencies() by @AlexanderDzhoganov .

from ckan.

pjf avatar pjf commented on May 21, 2024

It sure looks like we're doing the core of this now, so closing.

from ckan.

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.