Skip to content

Fix deprecated dependencies in components when they are not in depends#5

Open
dancewithheart wants to merge 1 commit into
masterfrom
fix-deps-from-components-not-depends
Open

Fix deprecated dependencies in components when they are not in depends#5
dancewithheart wants to merge 1 commit into
masterfrom
fix-deps-from-components-not-depends

Conversation

@dancewithheart
Copy link
Copy Markdown
Owner

Problem

cabal plan someties does not have information on dependencies in depends but in components:

jq '.["install-plan"][] | select(.["pkg-name"] == "unix-time") | {id, depends, components}' \
  ~/unix-time/dist-newstyle/cache/plan.json

gives:

{
  "id": "unix-time-0.4.17-inplace",
  "depends": null,
  "components": {
    "lib": {
      "depends": [
        "base-4.18.3.0",
        "binary-0.8.9.1",
        "bytestring-0.11.5.4",
        "old-time-1.1.1.0-6e92d79dcab5f57e120ada70a17bfa1c8071794e08837d598cefbb679ff3f201"
      ],
      "exe-depends": [
        "hsc2hs-0.68.10-e-hsc2hs-fb1024169576068383dbd121987e800658cc7c2a92cc7e4fc94abf9c3777f792"
      ]
    },
    "test:spec": {
      "depends": [
        "QuickCheck-2.18.0.0-4e7c7bccb9d404dd3ac51121ccf7bd5739d79187122d9752322706b498fcd55b",
        "base-4.18.3.0",
        "bytestring-0.11.5.4",
        "hspec-2.11.17-b6f4c590424f722677420617dad26c883c6c911d994d722361c99e92960d43f3",
        "old-locale-1.0.0.7-00b6245a62a63f564305aacc36c9e97f4c17022db7fdb14d5577a87f226a08b9",
        "old-time-1.1.1.0-6e92d79dcab5f57e120ada70a17bfa1c8071794e08837d598cefbb679ff3f201",
        "template-haskell-2.20.0.0",
        "time-1.12.2"
      ],
      "exe-depends": [
        "hspec-discover-2.11.17-e-hspec-discover-af43c076631cf57d41c4c33f9afd5c2fb4f604915193bc439c75c14fbd80e34b"
      ],
      "bin-file": "/home/piter/unix-time/dist-newstyle/build/x86_64-linux/ghc-9.6.7/unix-time-0.4.17/build/spec/spec"
    }
  }
}

Observed behavior before

cabal run cabal-plan-submit -- inspect-deprecated "/home/piter/unix-time/dist-newstyle/cache/plan.json" deprecated.yaml
no deprecated packages found

even though calling from package that as unix-time as depenency:

cabal run cabal-plan-submit -- inspect-deprecated --production-only "/home/piter/cabal-audit/dist-newstyle/cache/plan.json" deprecated.yaml
deprecated packages:
  old-time-1.1.0.4
    relationship: indirect
    replacement: time
    used by path: cabal-audit-1.0.0.0 -> hsec-tools-0.3.0.1 -> pandoc-3.7.0.2 -> tls-2.1.14 -> unix-time-0.4.17 -> old-time-1.1.0.4

Behavior after this change

cabal run cabal-plan-submit -- inspect-deprecated "/home/piter/unix-time/dist-newstyle/cache/plan.json" deprecated.yaml
deprecated packages:
  old-time-1.1.1.0
    relationship: direct
    replacement: time
    used by path: unix-time-0.4.17 -> old-time-1.1.1.0

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant