Skip to content

Filter out extra-deps packages from freeze file. #47

Open

Description

@philderbeast

As cabal constraints are additive, please filter from the generated freeze file any package names that are coming from git extra-deps. For instance, inclusion of any.prometheus ==2.2.3 in the following example will give a constraint solving error because bitnomial/prometheus:1fde661 is prometheus-2.2.2 and that is incompatible with the constraint prometheus ==2.2.3.

> cabal build all --enable-tests --minimize-conflict-set
Resolving dependencies...
Error: cabal: Could not resolve dependencies:
[__0] next goal: prometheus (user goal)
[__0] rejecting: prometheus-2.2.3 (constraint from user target requires
==2.2.2)
[__0] rejecting: prometheus-2.2.2 (constraint from project config /.../cabal.project.freeze
requires ==2.2.3)
[__0] rejecting: prometheus-2.2.1, prometheus-2.1.3, prometheus-2.1.2,
prometheus-2.1.1, prometheus-2.1.0, prometheus-2.0.2, prometheus-2.0.1,
prometheus-2.0.0, prometheus-0.5.0, prometheus-0.4.2, prometheus-0.4.1,
prometheus-0.4.0, prometheus-0.3.2.1, prometheus-0.3.2, prometheus-0.3.1,
prometheus-0.3.0, prometheus-0.2.0, prometheus-0.1.1, prometheus-0.1.0.3,
prometheus-0.1.0.2, prometheus-0.1.0.1, prometheus-0.1.0.0 (constraint from
user target requires ==2.2.2)
[__0] fail (backjumping, conflict set: prometheus)
After searching the rest of the dependency tree exhaustively, these were the
goals I've had most trouble fulfilling: prometheus
# stack.yaml
resolver: lts-18.27
...
extra-deps:
  - git: [email protected]:bitnomial/prometheus.git
    commit: 1fde661d897c500534769960584b29e8c39e8abb
# stack.yaml.lock
...
- completed:
    commit: 1fde661d897c500534769960584b29e8c39e8abb
    git: [email protected]:bitnomial/prometheus.git
    name: prometheus
    pantry-tree:
      sha256: 904843022ed0eabaf4e3dfc8f36e28e7365788c91e1d471b1eba56e1fca7511d
      size: 1969
    version: 2.2.2
...
-- cabal.project
-- Generated by stack2cabal

with-compiler: ghc-8.10.7
...
source-repository-package
    type: git
    location: [email protected]:bitnomial/prometheus.git
    tag: 1fde661d897c500534769960584b29e8c39e8abb
...
-- cabal.project.freeze
constraints:
             ...
             any.prometheus ==2.2.3,
             ...

Activity

  1. hasufell commented on Oct 6, 2022

    @hasufell
    Owner

    That's already done

    "Don't check package names from remote git sources (this is faster, but may leave incorrect versions in cabal.project.freeze if remote packages overwrite stack resolver versions)"

    remotePkgs <- if inspectRemotes

  2. philderbeast commented on Nov 2, 2022

    @philderbeast
    ContributorAuthor

    Inspecting remotes can be time consuming. Isn't the same information available in the stack.yaml.lock file and could we not use that if available?

    # stack.yaml.lock
    - completed:
        commit: 1fde661d897c500534769960584b29e8c39e8abb
        git: [email protected]:bitnomial/prometheus.git
        name: prometheus
        pantry-tree:
          sha256: 904843022ed0eabaf4e3dfc8f36e28e7365788c91e1d471b1eba56e1fca7511d
          size: 1969
        version: 2.2.2
      original:
        commit: 1fde661d897c500534769960584b29e8c39e8abb
        git: [email protected]:bitnomial/prometheus.git
  3. hasufell commented on Nov 5, 2022

    @hasufell
    Owner

    Possibly. Feel free to draft a PR

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