Skip to content

add-bound reports failure if build-depends are all conditional #47

Description

@andreasabel

hackage-cli add-bound cannot deal with the following structure, taken from https://hackage.haskell.org/package/regex-compat-tdfa-0.95.1.4/revision/0.cabal :

library
  if flag(newBase)
      Build-Depends:      base >= 4 && < 5, regex-base >= 0.93, regex-tdfa >= 1.1.0, array
  else
    if flag(splitBase)
      Build-Depends:      base >= 3.0, regex-base >= 0.93, regex-tdfa >= 1.1.0, array
    else
      Build-Depends:      base < 3.0,  regex-base >= 0.93, regex-tdfa >= 1.1.0

It reports for hackage-cli add-bound base '<4.15':

Edit failed, version ranges don't match:  <0 && <4.15 =/= <4.15

Activity

  1. andreasabel commented on Jul 14, 2022

    @andreasabel
    MemberAuthor

    Looks like the default noVersion is wrong, it should be anyVersion (which is the unit of intersection):

    hackage-cli/src/Main.hs

    Lines 874 to 877 in da9c329

    extractRange :: LC.GenericPackageDescription -> C.PackageName -> C.VersionRange
    extractRange gpd pkgName = case vss of
    [] -> C.noVersion
    (v:vs) -> List.foldl' C.intersectVersionRanges v vs

  2. added a commit that references this issue on Jul 14, 2022
    69715eb
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

    bugre: add-boundConcerning the `add-bound` feature

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions