elm-lang / elm-package

Command line tool to share Elm libraries
BSD 3-Clause "New" or "Revised" License
214 stars 66 forks source link

dependency solver bug #135

Open gregwebs opened 9 years ago

gregwebs commented 9 years ago

With these dependencies I was getting elm-html < 4 installed because elm-html-shorthand wanted that. After removing elm-html-shorthand everything worked as expected.

    "dependencies": {
        "circuithub/elm-html-shorthand": "9.0.0 <= v < 10.0.0",
        "circuithub/elm-json-extra": "2.1.1 <= v < 3.0.0",
        "elm-lang/core": "2.1.0 <= v < 3.0.0",
        "evancz/elm-effects": "1.0.0 <= v < 2.0.0",
        "evancz/elm-html": "4.0.1 <= v < 5.0.0",
        "evancz/elm-http": "1.0.0 <= v < 2.0.0",
        "evancz/start-app": "2.0.0 <= v < 3.0.0",
        "evancz/virtual-dom": "2.0.0 <= v < 3.0.0",
        "mgold/elm-date-format": "1.0.1 <= v < 2.0.0"
    },
    "elm-version": "0.15.1 <= v < 0.16.0"
rtfeldman commented 9 years ago

Yep, we just encountered this too.

Steps to reproduce:

  1. Make an elm-package.json with the line "evancz/elm-html": "4.0.0 <= v < 5.0.0"
  2. Add a dependency on a package containing the line "evancz/elm-html": "3.0.0 <= v < 4.0.0"
  3. Run elm package install

Expected Result: elm package install gives you an error because these constraints cannot be satisfied. Actual Result: you get elm-html 3.0.0 and everything seems fine until you try to use a 4.0.0 feature and get a compile error.

evancz commented 8 years ago

Is this still possible with 0.17.1?

gregwebs commented 8 years ago

Sorry, don't have my Elm setup anymore

brendan-jefferis commented 7 years ago

I still get this in 0.18

My code expects less than v2.0.0 of package-b, and between v5.0.0 and v6.0.0 of package-a

// my elm-package.json
"dependencies": {
    “package-a”: “5.0.0 <= v < 6.0.0",
    “package-b”: “1.0.0 <= v < 2.0.0"
}

However, package-a just upgraded their package-b version range to v2.0.0 - v3.0.0

// package-a elm-package.json
"dependencies": {
    "package-b": "2.0.0 <= v < 3.0.0"
}

When I now run elm-package install, I get this upgrade plan

Some new packages are needed. Here is the upgrade plan.

  Install:
    package-a 5.2.2
    package-b 2.0.1

Do you approve of this plan? [Y/n]

Which, if approved, introduces breaking changes to my code.

Additionally, if I set my version range higher than is specified in package-a (say 3.0.0 <= v < 4.0.0) I immediately get the following (with no upgrade plan message/approval prompt):

Packages configured successfully

Which gives me an almost empty elm-stuff/ dir

elm-stuff/
    ├ packages/ <-- Empty
    └ exact-dependencies.json <-- contains only {}