Skip to content

Redefine the install process #435

Closed
Closed

Description

@forki

At the moment we have 3 commands:

  1. restore - doesn't change csproj files or any of the paket.* files. It just reads paket.lock and downlods all the dependencies
  2. Install - reads the paket.lock and modifies all csproj/fsproj files accoring to their paket.references files. Afterwards it does restore
  3. update - analyzes the paket.dependencies file and calculates the paket.lock file. Afterwards it does install

So there is some logic in this, but it seems people like bundler's workflow more.

If I understand @haf and @agross correctly the new install should be a bit between the old install and update command: we would want it to analyze the changes in the paket.dependencies file since the last install, recompute the changed part of the lockfile and then perform our current install routine.

Is that correct?

Activity

  1. agross commented on Dec 7, 2014

    @agross
    Contributor

    Yes, that looks good.

    In particular:

    • change paket.references -> paket install syncs these to the projects (unless reference is "unmanaged", i.e. reference node without <Paket>true</Paket>)
    • add or remove dependency to paket.dependecies -> paket install to recalculate the graph
    • change version constraint in paket.dependecies -> paket install to recalculate the graph
    • no change to paket.dependencies -> no need to recalculate the graph, but make sure projects are in sync with paket.references
  2. agross commented on Dec 7, 2014

    @agross
    Contributor

    I think the vital part is detecting what changed in paket.dependencies w.r.t. paket.lock. Bundler saves all dependency definitions (= our paket.dependencies) in a separate section in Gemfile.lock (= our paket.lock):

    GEM
      remote: https://rubygems.org/
      specs:
        rake (0.9.5)
        thor (0.18.0)
    
    PLATFORMS
      x86-mingw32
    
    DEPENDENCIES <-- from Gemfile
      rake (~> 0.9)
      thor (~> 0)
    
  3. haf commented on Dec 7, 2014

    @haf
    Member

    install

    I agree with agross, the key is keeping the build reproducible by doing a minimum of intervention on paket install. Install should be 'the default thing to call to get started'; or 'make it right'.

    If there are no changes to paket.references or paket.dependencies, install eq restore.

    If there are no changes to paket.references or paket.dependencies but we're on a new platform, install updates paket.lock with the newly supported platform.

    If there are changes to paket.dependencies, but paket.lock hasn't been correspondingly updated, update paket.lock with the minumum set of changes that still fits the versions specified in paket.dependencies.

    If there are changes to paket.references inside particular project files, update both paket.dependencies and paket.lock with the most recent nuget that in a version-levelled way meets all previous nugets' version specifications in paket.lock. Otherwise warn and suggest 'paket update'.

    update <package>

    Update paket.lock with the semver-/version-levelled transitive closure of paket.dependencies' specified nugets. Update xxproj files.

    update

    Finds the transitive closure of all dependencies in a version-levelled way. Updates all nugets according to their version specifications in paket.dependencies.

  4. forki commented on Dec 7, 2014

    @forki
    MemberAuthor

    If there are changes to paket.references inside particular project files, update both paket.dependencies and paket.lock with the most recent nuget that in a version-levelled way meets all previous nugets' version specifications in paket.lock. Otherwise warn and suggest 'paket update'.

    I don't get that part.

  5. haf commented on Dec 7, 2014

    @haf
    Member

    If there are changes in the file that accompanies each xxproj file, e.g. adding a reference through it, as opposed to adding it though paket add, I think install should update both the list of dependencies and the list of installed versions.

    The version-levelling means that if e.g. I add a reference to Intelliplan.JsonNet in an individual paket.references file, but I already have Newtonsoft.Json 5.0.7 in my lock-file, then paket install should not install Intelliplan.JsonNet 2.0 but Intelliplan.JsonNet 1.7, because it has a lesser Newtonsoft.Json requirement. Now, if I also add a dependency on the nuget Intelliplan.Logary, then, because we're require paket update Newtonsoft.Json to be called to 'unlock' the version of it/bump the version of it, doing a paket install with this new dependency on Logary would cause version 1.5 to be installed, because it depends on ~>1.7 and not > 1.7 and not ~>2.0 of Intelliplan.JsonNet. That's version levelling.

    If the versions can't be unified in a nice way, warn and suggest calling paket update newtonsoft.json.

  6. forki commented on Dec 7, 2014

    @forki
    MemberAuthor

    ok that sounds really useful.

    I didn't start this before since I don't like the idea of storing the dependencies file as a copy in the lock file (like bundler does). Until today I didn't really saw a better way, but maybe the following could work:

    1. we take the lockfile (we already have a good internal API for querying it)
    2. we load the new dependencies file
      • for every dependency in the dependencies file we fix all indirect dependencies according to old lock file
      • if the dependency in the lockfile doesn't fit the dependency requirement (it must has changed) we don't fix, but use the new dependency (all indirect dependencies are not fixed)
    3. we remove all requirements which are not indirectly used in the new dependencies file
    4. we add requirements from all paket.references files (but at the movent with x >= 0 since we don't allow versions in references files)

    then we run the resolver.

  7. haf commented on Dec 16, 2014

    @haf
    Member

    screen shot 2014-12-16 at 11 11 06
    Current workflow

  8. haf commented on Dec 16, 2014

    @haf
    Member

    Another question is how to replace a nuget. In ruby-world I do this:

    edit Gemfile, replace the string with the other, run 'bundle install', done.

    In paket-world, I tried this:

    edit paket.dependencies, run 'paket install', complains about lock-file, figure I need to update each project's references too, update those, run paket install again, get same complaint, try paket update, more complaints, scream a little, run '--force', paket is happy, it compiles, but xxproj-file not updated, go for lunch, come back 5 hours later when I discover the old package is still referenced, file this post.

    method

  9. forki commented on Dec 16, 2014

    @forki
    MemberAuthor

    We will change the install workflow soon.

    Another question is how to replace a nuget. In ruby-world I do this:

    edit Gemfile, replace the string with the other, run 'bundle install', done.

    In paket-world, I tried this:

    edit paket.dependencies, run 'paket install', complains about lock-file,
    figure I need to update each project's references too, update those, run
    paket install again, get same complaint, try paket update, more complaints,
    scream a little, run '--force', paket is happy, it compiles, but
    xxproj-file not updated, go for lunch, come back 5 hours later when I
    discover the old package is still referenced, file this post.

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

  10. added this to the NewInstaller milestone on Dec 20, 2014
  11. forki commented on Dec 27, 2014

    @forki
    MemberAuthor

    latest alpha detects changes in the dependencies file and performs a selective update during paket install.

    It doesn't consider changes in the references file, yet. But please give it a try and report issues.

  12. forki commented on Dec 29, 2014

    @forki
    MemberAuthor

    latest alpha also scans references files for addition

  13. forki commented on Dec 29, 2014

    @forki
    MemberAuthor

    v0.20 is released - please open new issues with concrete issues.

  14. haf commented on Dec 29, 2014

    @haf
    Member

    @forki thank you, we'll try it out

  15. haf commented on Dec 30, 2014

    @haf
    Member

    It's amazing! =) Smooooth!

    Have a dog with a light sabre!

    b1dy4unimaegnpy

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions