Skip to content

Extensible snapshots: snapshot packages not shared between snapshots, nor fully between packages #3431

Closed
@dbaynard

Description

@dbaynard

Stack no longer shares packages built using different snapshots.

Even with the same resolver, git packages are re-downloaded, too — though not rebuilt! — and in the local package directory, not the global snapshot directory. The snapshot packages are shared.

(Incidentally, I wonder if there's an issue I should follow concerning extensible snapshots. It's a feature I've been anticipating for a while, and I very much liked some of the previous behaviour — in particular the package sharing).

Steps to reproduce

  1. First, try to install pandoc using the global-project.

    Use resolver: https://gist.github.com/dbaynard/9693107a883a6282f52f22785d0072e2/raw/cbbfa7251704add22d145dc14da9b278fdac2c77 in stack.yaml

    stack install pandoc (though it probably works for any package; the point is, this is a downstream package)

  2. Change to resolver: https://gist.github.com/dbaynard/9693107a883a6282f52f22785d0072e2/raw/eeb1f7a905e06bb22c641f30923a91f96bc4ead6 which has one change (that of pandoc).

    stack install pandoc

  3. Then, enter a directory containing a stack.yaml pointing to the latter resolver, and no .stack-work

    stack build --dependencies-only

Expected

  1. Stack builds whatever dependencies it needs, then builds pandoc.
  2. Stack recognises it has already built all the dependencies and then begins downloading and building pandoc.
  3. Stack recognises it has already built some of the dependencies and then gives messages about reusing existing packages. It builds the remaining dependencies.

Actual

  1. Stack builds all the dependencies (then fails to build pandoc; this is not the issue here)
  2. Stack begins rebuilding all the same dependencies it built the first time.
  3. Stack downloads the snapshot packages provided as git commits, into the local .stack-work directory, but does not rebuild them. It then builds the remaining dependencies.

Stack version

$ stack --version
Version 1.5.1, Git revision 2b0392468a03174a7c5d317291c62452d771b055 (5182 commits) x86_64 hpack-0.18.1

Configuration just sets up some personal information for new projects, and allows newer packages and system ghc.

Method of installation

Bootstrapped the git repo with stack install stack from the most recent stable version.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions