-
Notifications
You must be signed in to change notification settings - Fork 6
Description
Describe the bug
gazelle-update-repos can generate duplicates within stack_snapshot::packages when one of the packages has "strict" versioning.
To Reproduce
- Add a "strict versioned" dependency to
stack_snapshot::packageslist, e.g.
stack_snapshot(
packages = [
...
"wai-make-assets-0.2", # keep
...
],
)
- If gazelle_cabal generated
haskell_librarycontain 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: