Skip to content

Paket FizzBin / paket restore #176

Closed

Description

@bartelink

Recently I've tried to explain Paket to a number of people who are well versed in NuGet, .net, MSBuild (and in 2/3 cases, F#)

Examples:

I'd like to make a plea that you read this "NuGet Package Restore misconceptions" article by Jeff Handley of the NuGet team as it filled in / accentuated some key points for me. I don't think I was guilty of any of the misconceptions, but it leads into what I will say after the jump. If you're going to bother to read on, PLEASE read the link - there's no point in reading on without the context

So, my 'solution' is to attempt to write a compact guide to Paket that doesn't:

a) assume it can say "inspired by bundler" and not have that trigger 0-15 good things and 2-4 bad things dependeing on people's experience
b) does not work with detailed examples with a goal of having people read rather than scan it
c) have something that people are expected to read before anything.

i.e. if something that if there's evidence that any core point is missing from somone's understanding, that one could (either conceptually or really be told "Come back when you've read link or we have no shared understanding and we're going to find out in 20 mins time that there are massive broken assumptions)

So.... v1 of it is:

Activity

  1. bartelink commented on Sep 28, 2014

    @bartelink
    MemberAuthor

    Paket FizzBin

    Commandline tool used to download nugets/files across your entire repo consistently, add them to .vb/.fs/.csprojs. Has restore option so packages dont have to go into source control.

    Fast, no mousing/waiting/clicking/progress dialogs, no angle brackets, no gratuitous diffs on updates. It Just Works with/without Xamarin/Visual Studio, Windows/Mono, C#/F#/VB. Updating to latest is up arrow, enter.

    You'll especially like it if any of the following is true:

    • you use git
    • you are in Package Manager Console a lot
    • you sometimes feel you're spending too much time/clicks/mouse wheeling/managing merge conflicts on package updates and or scanning for ticks

    Dev uses Paket when developing

    paket.dependencies: Put paths, package names and version constraints in paket.dependencies file in a dir tree root.

    $ paket update: Creates/validates a graph and saves resolved vers to paket.lock.

    paket.references: In proj dirs, simple text file lists pakets used in .xxproj files

    1. Use NuGet to maintain /packages. paket convert-from-nuget to suck Refs out of packages.config into Deps+Refs files.
    2. Edit paket.dependencies or use $ paket add: Add file (\share, Http, GitHub, fssnip) or NuGet specs to deps, Write Lock, Add to Refs for a proj, put ref into a proj
    3. $ paket update: Read paket.dependencies, Write Lock, Load Refs, Put <References into csprojs
    4. Loop (can go back to -1 if you want - using paket does not preclude use of NuGet)
    5. Add paket.dependencies, paket.lock paket.references to source control. Add .nupkg files + DLLs in packages folder to either .gitignore or source control. Commit.

    People cloning repo need exact same set of files dev was using but dev didnt commit entire packages folder

    1. Fork repo.
    2. paket install: read Lock, download .nupkg files iff not there, expand DLLs out of .nupkg zips
    3. Load VS.

    CI box iff not committing all packages folder

    5: <build>.cmd/sh: paket install: Read Lock, download files not in /packages, expand DLLs.

    6: Run msbuild/xbuild - no magic scripts slowing anything down

  2. bartelink commented on Sep 28, 2014

    @bartelink
    MemberAuthor

    Realizations from the article

    FizzBin

    The first problem is that despite the fact that @shanselman
    s fizzbin concept really spoke to me, it doesnt seem to have caught on at all

    • its not really googleable
    • @forki, who we can all agree is pretty well versed in dev and net slang hadnt heard of it

    Only thing in its defence was that urban dictionary has it.

    So, the title needs to change.

    1000 words

    @forki pointed out that a diagram was in order and will happen. It's definitely a key component, and should be used to cut out a lot of the words in the FizzBin

    But nobody reads (anymore)

    I'm acutely aware that nobody reads the manual. I had my misunderstanding core Paket concepts phase too (the docs were a lot less complete back then in my defence, but I am certain it would still apply).

    The names of the files are good enough to convey their concepts

    But I wanted to use Deps, Refs and Lock in the text above and if there was a core knowledge post I could.

    Because nobody reads, the paket command names are absolutely critical

    As an example, I questioned the name outdatedat one point - @agross indicated its the term bundler uses. I like prior art. But I still think news or something which doesnt feel like a cumbersome word in English which is part of a set of terms that are carefully aligned.

    The proposal

    Have you read the linked Jeff Handley article at the top yet? Close this thread and dont bother to read on if you havent. I'm serious.

    So, about 40 mins into mowing the lawn the following hit me:

    paket install needs to be renamed

    The name needs to:

    • convey that its used in the build to restore the files
    • convey that it will not change things
    • not have the need to say "update and/or your first paket install when describing it
    • acknowledge the fact that NuGet is what a lot of people get their preconceptions from
    • ack that nothing is installed - no sln level init.ps1 or project level install.ps1 or uninstall.ps1 or MSIs like some people seem to ecpect
    • acknowledge that names that make a lot of sense in bundler
      a) have no currency for lots of people (me and others)
      b) can as easily cause misconceptions and trigger 1001 crazy notions in other peoples heads
    • like NuGet Package Restore, Paket doesn't readlly 'install' anything. It's not bundler - key example: bundler has environments

    What is the name, I hear you ask? I've been jumping between two and have no idea how to choose.

    paket restore

    When all is said and done, aside from the wart of paket install also being update first time, does exactly the same as NuGet's restore subcommand.

    Yes, except for the wart that it can also fixup a project that has changed its Refs file. But:

    1. in a real build script you'd all-but want the command to fail-fast if it turned out that paket in stall was going to change a proj file (should that be an issue?)
    2. When doing dev, you run it from time to time to fixup projects as you add refs.
      BUT now we have paket add
      AND its absolutely critical to REPL mode - but its hard to explain as its lower traffic and/or orthogonal to the core funcitonality of Paket (the stuff that overlaps with NuGet client) - see Make "Get package" available in REPL #124 and people thinking that Paket is a scriptcs like thing for F#
      BUT thats difficult to doc wihtout a big sentence because it leans on too many other concepts

    I dont expect people will like the name. But I think it will save a LOT of confusion relative to persisting with install.

    paket sync

    OK, so the roles of the install command are:

    1. (if not in source control, see Package Common Sense Mode #166 ) re-downloading files (.nupkgs and other content)
    2. iff not in source control - see Package Common Sense Mode #166 expanding lib portions into packages
    3. (iff not in source control - see Handle NuGet Build .props .targets #101 ) expanding build portions into packages
    4. (only during dev) fixing csproj files -> sync !

    Conclusion

    I'd like input from at least @forki @agross @ilkerde and @theimowski re what makes sense here.

    I'll venture some ideas:

    Proposal 1: Just a rename

    IOW change paket install to paket restore or paket sync without much change - seem to fall between two stools?

    Proposal 2: clear separate commands

    Split paket install into:

    1. paket restore
      same as NuGet Restore
      but complains if any proj files are broken (but maybe with a --hard to override?)
    2. paket sync
      same as paket install today, i.e. fixes up projs based on Refs but
      • will not download ever
      • tells you to use paket update if not all required packages are in lock (maybe with --freshen override)

    IOW now high level workflow is that:

    • build scripts do paket restore ONLY
    • when you edit the Deps and want stuff reflected downstream, only update will ever do that
    • if you want to add a ref of something you are already using in the sln to a new proj, you can either
      • edit Refs file and paket sync
      • use paket add ref projdir PaketId command (maybe that should be paket ref ?) which does (only ) a paket sync implictly
      • use paket add dep NuGetPackageId (which will add a Dep, update and then (depending on --interactive adds refs to all projs or a subset)

    I'd do the doc work (and a lot of the impl work if others dont want to) if anyone thinks this makes any sense.

    Be warned I will start linking to this article up the wazoo for each misconception I encounter, esp if we don't fix this and/or people ignore this issue an :D

  3. bartelink commented on Sep 28, 2014

    @bartelink
    MemberAuthor

    To summarise, we want cut off at the pass, having a cottage industry of complex prescriptive flows, PluralSight courses, and diagrams like:

    what you have to do to make git tractable to new people

    While I like this diagram and I like the power of git, that's partially Stockholm Syndrome.

    I dont like the success of Paket and/or our ability to explain to new users over time to be contingent on such complexity when it can be avoided by thinking hard about the problems and fixing things now. The ultimate thing we're think we're talking about is composability (and its friends DRY and rule of 2-3+ (which I believe I've demonstrated has been triggered...))

    Another pertinent link :)

  4. ilkerde commented on Oct 3, 2014

    @ilkerde

    Wow @bartelink this time I'm totally sold on the get the names right theme of your writing! To keep things short: I definitely vote for your second proposal. Both restore and sync are great matches.

    @agross @forki ?

  5. bartelink commented on Oct 3, 2014

    @bartelink
    MemberAuthor

    If there's a seconder (esp with a diff or two to suggest) I'll do a revision of the article (surely something about it is either unclear, redundant or missing ?)

  6. forki commented on Oct 5, 2014

    @forki
    Member

    I also tend to think that install is an unfortunate name. After I'm ready
    with the new install model we will probably see what it really is. So long
    I don't want to change it.
    On Oct 3, 2014 11:04 PM, "bartelink" [email protected] wrote:

    If there's a seconder (esp with a diff or two to suggest) I'll do a
    revision of the article (surely something about it is either unclear,
    redundant or missing ?)

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

  7. forki commented on Jan 31, 2015

    @forki
    Member

    Restore is implemented, install has new semantics

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions