Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

opam install errors on this project #1

Open
idkjs opened this issue Sep 30, 2017 · 5 comments
Open

opam install errors on this project #1

idkjs opened this issue Sep 30, 2017 · 5 comments

Comments

@idkjs
Copy link

idkjs commented Sep 30, 2017

Hi, Bobby,

Great medium post and right on time. I was hoping you might shed some light on the install for me.
I have chasing down these errors and cant seem to understand them yet. Ocaml rookie and im mostly going through your article for the ocaml project setup.

General questions are how do you deal with 'aborted'? What does that mean exactly?
Why are cmdliner an astring packages failing?

Questions seem simple, but sometimes a quick answer gives me some better context. Thank you.

I created this gist with the errors. https://gist.github.com/idkjs/8ccb4e74d9437a850e96e619574de3ff

Here is the opam list output:
https://gist.github.com/idkjs/04f84105e3445d455d12b59c35174eb9

@bobbypriam
Copy link
Owner

Hi @idkjs! Thanks for the kind words.

General questions are how do you deal with 'aborted'?

If an installation for a package is 'aborted', it usually means because that package's dependency's installation failed. In this case, we know that the failing packages are cmdliner and astring. It makes no sense to install a package when its dependency does not exist, hence aborted.

Why are cmdliner an astring packages failing?

Seeing the errors you provided, we can see the error on these lines:

### stderr ###
# File "./pkg/pkg.ml", line 1:
# Error: /Users/shingdev/.opam/4.04.2-haversiner/lib/topkg/topkg.cmi
# is not a compiled interface for this version of OCaml.
# It seems to be for an older version of OCaml.

Both the errors of cmdliner and astring packages contain this error. From it, it seemed like the topkg is faulty (somehow compiled for another version of OCaml).

Can you try removing topkg and trying again? Basically, you need to run this:

$ opam remove topkg
$ opam install --deps-only haversiner

topkg will be automatically installed since it's depended by both astring and cmdliner, and it will be compiled using the current active compiler.

If that doesn't work, perhaps you'd want to remove and recreate the switch, but hopefully reinstalling topkg solves it. Let me know after you try it! 🙂

@idkjs
Copy link
Author

idkjs commented Sep 30, 2017

So that worked. Before writing you, I had removed/reinstalled topkg. Didnt work until i removed the switch though. Updating it said it was already installed but I may have done it after building the switch? Maybe wrong order for the commands? I'll take it!

These are the steps I followed in case anyone else needs it.
debugging.sh

This is the output of the clean fresh build command.
output.sh

Thanks for these explanations, sir. Very helpful.

@bobbypriam
Copy link
Owner

Glad to know you got it working!

Yeah perhaps that was caused by some mix up of commands. Not sure though.

I'm kinda curious about the Ezjsonm.Parse_error you're getting. It shouldn't happen if you pass the correct data (-d @test/payload.json). I can reproduce the error only if I curl-ed without providing the json data. Does it happen everytime you hit the API?

@idkjs
Copy link
Author

idkjs commented Oct 1, 2017

I will have to check. Incidentally, you would just restart the container, and hit it with curl, right? That is the workflow? Like hitting npm start on a node project.

@bobbypriam
Copy link
Owner

Incidentally, you would just restart the container, and hit it with curl, right? That is the workflow? Like hitting npm start on a node project.

For development? Not exactly, the docker image is intended to be for deployment only. The feedback cycle of changing something and needing to rebuild the image is quite long. You can setup a docker container for development using volumes, though, but it's not explained in the article.

For local development I usually just change things and run make (or make run) which will rebuild and run the project without the container. There might be some way to "watch" and rebuild on change, but I've not explored it yet and I don't think jbuilder has the option to do it currently.

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

No branches or pull requests

2 participants