elm-package
elm-package copied to clipboard
Patch version restriction is ignored
I configured elm-package.json for not installing latest version of elm-lang/core.
"dependencies": {
"NoRedInk/elm-decode-pipeline": "1.1.2 <= v < 2.0.0",
"elm-community/elm-material-icons": "2.0.0 <= v < 3.0.0",
"elm-lang/core": "4.0.0 <= v < 4.0.1", <-this
"elm-lang/dom": "1.0.0 <= v < 2.0.0",
"elm-lang/html": "1.0.0 <= v < 2.0.0",
"elm-lang/keyboard": "1.0.0 <= v < 2.0.0",
"elm-lang/svg": "1.0.0 <= v < 2.0.0",
"elm-lang/virtual-dom": "1.0.0 <= v < 2.0.0",
"elm-lang/window": "1.0.0 <= v < 2.0.0",
"evancz/elm-http": "3.0.1 <= v < 4.0.0"
},
But elm-package install installs latest version.
Some new packages are needed. Here is the upgrade plan.
Install:
NoRedInk/elm-decode-pipeline 1.1.2
elm-community/elm-material-icons 2.0.0
elm-lang/core 4.0.1 <-this
elm-lang/dom 1.0.0
elm-lang/html 1.0.0
elm-lang/keyboard 1.0.0
elm-lang/svg 1.0.0
elm-lang/virtual-dom 1.0.0
elm-lang/window 1.0.0
evancz/elm-http 3.0.1
Is this still true in 0.17.1? Can you check and let me know?
I just checked it in 0.17.1. It is still happening. But I wasn't able to reproduce it except for elm-lang/core.

I had a very similar problem which I believe belongs here also, please correct me if I'm wrong. Elm ignored the <= part of the version restriction, and instead required the exact version to be specified.
I tried to do this:
ᕕ(ᐛ)ᕗ elm package install jasonmahr/html-escape-sequences
To install jasonmahr/html-escape-sequences I would like to add the following
dependency to elm-package.json:
"jasonmahr/html-escape-sequences": "2.0.5 <= v < 3.0.0"
May I add that to elm-package.json for you? [Y/n] y
Error: I cannot find a set of packages that works with your constraints.
--> There are no versions of jasonmahr/html-escaped-unicode that work with Elm
0.17.1. Maybe the maintainer has not updated it yet.
so I looked at the elm-package.json for that project. here it is:
{
"version": "2.0.5",
"summary": "Use decimal, hex and named escapes with elm-lang/html. Supports all of Unicode.",
"repository": "https://github.com/jasonmahr/html-escape-sequences.git",
"license": "MIT",
"source-directories": [
"src"
],
"exposed-modules": [
"Unicode"
],
"dependencies": {
"elm-lang/core": "4.0.0 <= v < 5.0.0",
"elm-lang/html": "1.0.0 <= v < 2.0.0"
},
"elm-version": "0.17.0 <= v < 0.18.0"
}
I then changed it to support 0.17.1 explicitly, along with upgrading its minimum versions for elm-lang/core and elm-lang/html as well. I also changed the version number to 1.0.0, changed the git tags accordingly, and published it.
ᕕ(ᐛ)ᕗ cat elm-package.json
{
"version": "1.0.0",
"summary": "Use decimal, hex and named escapes with elm-lang/html. Supports all of Unicode.",
"repository": "https://github.com/gilesbowkett/html-escape-sequences.git",
"license": "MIT",
"source-directories": [
"src"
],
"exposed-modules": [
"Unicode"
],
"dependencies": {
"elm-lang/core": "4.0.5 <= v < 5.0.0",
"elm-lang/html": "1.1.0 <= v < 2.0.0"
},
"elm-version": "0.17.1 <= v < 0.18.0"
}
Installing this version worked perfectly.
Since this is such a huge comment, here's the TLDR: I couldn't rely on the 0.17.0 <= v < 0.18.0 thing when using 0.17.1. I had to explicitly hard-code the exact version of Elm I was using.
I'm having the same issue, but I can seem to reduce it to the restrictions of a transitive dependency. For example when I have the following dependency:
"dependencies": {
"elm-lang/virtual-dom": "2.0.0 <= v < 2.0.1"
},
I'll get the following output (which is fine):
Starting downloads...
● elm-lang/virtual-dom 2.0.0
● elm-lang/core 5.0.0
Packages configured successfully!
When I add elm-html to the dependency list, things go wrong:
"dependencies": {
"elm-lang/virtual-dom": "2.0.0 <= v < 2.0.1",
"elm-lang/html": "2.0.0 <= v < 3.0.0"
},
Starting downloads...
● elm-lang/html 2.0.0
● elm-lang/virtual-dom 2.0.2
● elm-lang/core 5.0.0
Packages configured successfully!
Instead of installing version 2.0.0 of elm-lang/virtual-dom, 2.0.2 is installed. This makes me assume that elm-lang/html is causing the problem. The 2.0.0 version of the package depends on "elm-lang/virtual-dom": "2.0.0 <= v < 3.0.0", which might wrong package being installed.
I've ran this on version 0.18.