elm-lang / elm-package

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

install succeeds when depending on not existing packages #253

Open stil4m opened 7 years ago

stil4m commented 7 years ago

When you have a package that has a version constraint that can not be resolved (it is higher than the existing version), the package install just succeeds.

I've used the following elm-package.json:

{
    "version": "1.0.0",
    "summary": "helpful summary of your project, less than 80 characters",
    "repository": "https://github.com/user/project.git",
    "license": "BSD3",
    "source-directories": [
        "."
    ],
    "exposed-modules": [],
    "dependencies": {
        "elm-lang/core": "5.0.0 <= v < 6.0.0",
        "elm-lang/html": "2.0.1 <= v < 3.0.0"
    },
    "elm-version": "0.18.0 <= v < 0.19.0"
}

| Note that at creation of the issue, elm-lang/html was at version 2.0.0.

When executing elm package install, the only output returned is:

Packages configured successfully!

The find command shows that nothing is downloaded:

$ find elm-stuff
elm-stuff
elm-stuff/exact-dependencies.json
elm-stuff/packages

The content of exact-dependencies.json is {}.

I would expect the package manager to fail with an error that explains I depend on a version that does not exist.

I am using OS X 10.11.5 and Elm 0.18

process-bot commented 7 years ago

Thanks for the issue! Make sure it satisfies this checklist. My human colleagues will appreciate it!

Here is what to expect next, and if anyone wants to comment, keep these things in mind.

jacobat commented 7 years ago

Was just bitten by this as well.

I had the following elm-package.json:

{
    "version": "1.0.0",
    "summary": "helpful summary of your project, less than 80 characters",
    "repository": "https://github.com/user/project.git",
    "license": "BSD3",
    "source-directories": [
        "."
    ],
    "exposed-modules": [],
    "dependencies": {
        "elm-lang/core": "5.0.0 <= v < 6.0.0",
        "elm-lang/html": "2.0.0 <= v < 3.0.0",
        "elm-lang/http": "3.0.0 <= v < 4.0.0"
    },
    "elm-version": "0.18.0 <= v < 0.19.0"
}
abailly commented 7 years ago

FWIW, I got the same issue with completely wrong bounds:

    "dependencies": {
        "elm-lang/core": "5.0.0 <= v < 4.0.0",
benjamin-bergia commented 7 years ago

Same issue here. Funny thing is that when one of the dependencies is wrong elm package install will actually try to remove all the dependencies.

For example by using the wrong version of url-parser (2.1.0 instead or 2.0.1):

    "dependencies": {                                                               
        "elm-lang/core": "5.1.1 <= v < 6.0.0",                                      
        "elm-lang/html": "2.0.0 <= v < 3.0.0",                                      
        "elm-lang/svg": "2.0.0 <= v < 3.0.0",                                       
        "elm-lang/http": "1.0.0 <= v < 3.0.0",                                      
        "elm-lang/navigation": "2.1.0 <= v < 3.0.0",                                
        "terezka/elm-plot": "4.1.0 <= v < 5.0.0",                                   
        "debois/elm-mdl": "8.1.0 <= v < 10.0.0",                                    
        "evancz/url-parser": "2.1.0 <= v < 3.0.0"                                   
    }

I get:

$ elm package install 
Some new packages are needed. Here is the upgrade plan.

  Remove:
    debois/elm-dom
    debois/elm-mdl
    elm-lang/core
    elm-lang/dom
    elm-lang/html
    elm-lang/http
    elm-lang/mouse
    elm-lang/navigation
    elm-lang/svg
    elm-lang/virtual-dom
    elm-lang/window
    myrho/elm-round
    terezka/elm-plot

Do you approve of this plan? [Y/n] 
Packages configured successfully!

It would be very nice to have an error with the name of the invalid package instead.

sjfloat commented 7 years ago

I'm having this same trouble (or something that looks very much the same).

domenkozar commented 7 years ago

This one is really annoying, mistyping a dependency (in my case elm-json-extra was renamed to json-extra for Elm 0.19) results into seemingly successful installation.