Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gazelle-update-repos should avoid adding duplicates to stack_snapshot packages #46

Open
kczulko opened this issue Sep 2, 2022 · 0 comments

Comments

@kczulko
Copy link
Contributor

kczulko commented Sep 2, 2022

Describe the bug

gazelle-update-repos can generate duplicates within stack_snapshot::packages when one of the packages has "strict" versioning.

To Reproduce

  1. Add a "strict versioned" dependency to stack_snapshot::packages list, e.g.
stack_snapshot(
  packages = [
    ...
    "wai-make-assets-0.2", # keep
    ...
  ],
)
  1. If gazelle_cabal generated haskell_library contain following entry:
haskell_library(
  deps = [
    ...
    "@stackage//:wai-make-assets",
    ...
  ],
)

...
3. ..., then running :gazelle-update-repos will generate duplicates within stack_snapshot::deps

stack_snapshot(
  packages = [
    ...
    "wai-make-assets",
    "wai-make-assets-0.2", # keep
    ...
  ],
)

It doesn't cause failures for bazel since rules_haskell unify names and allows for a duplicates (but which shouldn't happened as confirmed with @aherrmann - defect is pending and will be added here).

Expected behavior
gazelle-update-repos should try to avoid generating duplicates while updating packages list of the stack repository when one of the packages has #keep comment. Maybe gazelle_cabal should produce additional warning about such case.

Environment

  • OS name + version: Nixos 22.05.2351.e4c9d950a3c
  • Version of the code:
gazelle_cabal_version = "34a41345973cdffa29bf4d5d349439e86fc30ed3"
rules_haskell_version = "rules_haskell-0.14"

Additional context
Observed while converting example-servant-elm to bazel. There are two places from which those dependencies come:

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

No branches or pull requests

1 participant