Skip to content
This repository has been archived by the owner on Aug 23, 2018. It is now read-only.

bad error when bad constraint is added by hand #117

Open
martindemello opened this issue Sep 22, 2016 · 5 comments
Open

bad error when bad constraint is added by hand #117

martindemello opened this issue Sep 22, 2016 · 5 comments

Comments

@martindemello
Copy link

martindemello commented Sep 22, 2016

elm version: 0.17

I added "elm-lang/keyboard": "1.1.0 <= v < 2.0.0" to my elm-package.json (should have been 1.0.0, since that's the latest available version) and ran elm-make. It failed with

elm-make: elm-stuff/exact-dependencies.json: openBinaryFile: does not exist (No such file or directory)

which is technically correct, but doesn't really explain the problem.

@process-bot
Copy link

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.

@evancz
Copy link
Contributor

evancz commented Sep 22, 2016

Can you give more information about your setup? What is the content of your elm-package.json? How did you add this line? How did you set up your project?

From the message, it looks like you got your project into a weird configuration with the steps you took to get there.

@martindemello
Copy link
Author

I had an existing project that I wanted to add keyboard support to, so I added "elm-lang/keyboard": "1.1.0 <= v < 2.0.0" to my elm-package.json, blew away elm-stuff/, and ran elm-make. (I added it manually by copy/pasting the line for elm-lang/svg, which is how I ended up with 1.1.0).

Easy way to reproduce: Add this file to a clean directory

{
  "version": "1.0.0",
  "summary": "let people do a cool thing in a fun way",
  "repository": "https://github.com/user/project.git",
  "license": "BSD3",
  "source-directories": [
      "."
  ],
  "exposed-modules": [],
  "dependencies": {
    "elm-lang/core": "4.0.0 <= v < 5.0.0",
    "elm-lang/html": "1.0.0 <= v < 2.0.0",
    "elm-lang/keyboard": "1.1.0 <= v < 2.0.0"
  },
  "elm-version": "0.17.0 <= v < 0.18.0"
}

run elm-make (which will fail with the error message about elm-stuff/exact-dependencies.json not existing)

Now edit the last line of the dependencies to read

    "elm-lang/keyboard": "1.0.0 <= v < 2.0.0"

and run elm-make again, which will succeed.

It should fail with a helpful error message when it fails to generate elm-stuff/exact-dependencies.json , not with a file-not-found when it fails to read it back.

@evancz
Copy link
Contributor

evancz commented Sep 22, 2016

Thanks for the report for when things are added by hand. For now I recommend using commands like elm-package install elm-lang/keyboard to do this!

@evancz evancz changed the title elm-make needs a better error message when dependencies cannot be satisfied bad error when bad constraint is added by hand Sep 22, 2016
@martindemello
Copy link
Author

ah :) didn't realise that elm-package would do this for me.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants