pinterest / elixometer

A light Elixir wrapper around exometer.
https://hexdocs.pm/elixometer
Apache License 2.0
827 stars 67 forks source link

Unable to install dependencies when adding exometer to deps #78

Closed smoak closed 5 years ago

smoak commented 7 years ago

Following the docs and trying to add

{:exometer, github: "PSPDFKit-labs/exometer_core"}

to my deps. However, I get "(Mix) Command "git --git-dir=.git checkout --quiet HEAD" failed" when I run mix deps.get:

$ mix deps.get
* Getting elixometer (https://github.com/pinterest/elixometer.git)
remote: Counting objects: 339, done.
remote: Compressing objects: 100% (12/12), done.
remote: Total 339 (delta 0), reused 0 (delta 0), pack-reused 326
Receiving objects: 100% (339/339), 82.48 KiB | 0 bytes/s, done.
Resolving deltas: 100% (176/176), done.
* Getting exometer (https://github.com/PSPDFKit-labs/exometer_core.git)
remote: Counting objects: 628, done.
remote: Compressing objects: 100% (2/2), done.
remote: Total 628 (delta 0), reused 2 (delta 0), pack-reused 626
Receiving objects: 100% (628/628), 585.82 KiB | 0 bytes/s, done.
Resolving deltas: 100% (385/385), done.
* Getting lager (git://github.com/basho/lager.git)
remote: Counting objects: 3496, done.
remote: Total 3496 (delta 0), reused 0 (delta 0), pack-reused 3496
* Getting parse_trans (git://github.com/uwiger/parse_trans.git)
remote: Counting objects: 797, done.
remote: Total 797 (delta 0), reused 0 (delta 0), pack-reused 797
* Getting setup (git://github.com/uwiger/setup.git)
remote: Counting objects: 582, done.
remote: Total 582 (delta 0), reused 0 (delta 0), pack-reused 582
* Getting edown (git://github.com/uwiger/edown.git)
remote: Counting objects: 965, done.
remote: Compressing objects: 100% (16/16), done.
remote: Total 965 (delta 0), reused 16 (delta 0), pack-reused 949
error: pathspec 'HEAD' did not match any file(s) known to git.
** (Mix) Command "git --git-dir=.git checkout --quiet HEAD" failed

Did some spelunking and I see that the setup dependency pulls in edown like so:

{deps, [{edown, ".*", {git, "git://github.com/uwiger/edown.git", "HEAD"}}]}

which I believe mix is interpreting as a ref (hence the error message above). However, I am not really sure what to do about it.

scohen commented 7 years ago

I think you have a couple of problems; you should have the dep defined like this:

{:exometer_core, github: "PSPDFKit-labs/exometer_core"}

and it looks like you don't have your SSH keys set up. I bet the last line won't work on your command line either; You might need to add your SSH key to your github account or use the ssh-agent to get it to work properly.

smoak commented 7 years ago

Thanks for the reply. The README has the dep as {:exometer, github: "PSPDFKit-labs/exometer_core"}. I can submit a quick PR to get that fixed if you'd like.

I'll look into my ssh keys; you're probably right though. I don't think I have this machine set up all the way just yet.

smoak commented 7 years ago

Hmm,

I changed the dep to:

{:exometer_core, github: "PSPDFKit-labs/exometer_core"}

and made sure my ssh keys are on my account and that ssh-agent is set up properly. However, I am still getting the same error.

scohen commented 7 years ago

Have you tried overriding the edown dep in your mix.exs? Exometer's deps are very tricky, and I have no idea why this one is required all the time; it's just for docs.

blaketan commented 7 years ago

Ran into the same issue, this set-up worked for me in the end (Elixir 1.4):

     [{:elixometer, "~> 1.2.1"},
     {:exometer, github: "PSPDFKit-labs/exometer", override: true},
     {:exometer_core, github: "PSPDFKit-labs/exometer_core", override: true},
     {:setup, github: "uwiger/setup", manager: :rebar, override: true},
     {:edown, "0.8.1", override: true},
     {:lager, "~>3.2.1", override: true}]

Ran into the same issue with edown, then had problems compiling setup.

fishcakez commented 6 years ago

The ideal solution is for exometer to get on hex but that will require coordination among multiple project owners and additional patches for latest OTP release 😅 . Therefore I think this requires someone using exometer (and not just elixometer and/or exometer_core) from the community to pick that up. Likely they would also want exometer to work with the latest exometer_core.

As we want to prevent this blocking 1.3 for a long period the easiest solution would be to try to get PSPDFKit-labs/exometer updated to the latest commits as this should work with exometer_core 1.4. Then users of exometer would need these two lines:

 [{:exometer_core, "~> 1.4.0", override: true},
  {:exometer, github: "PSPDFKit-labs/exometer"}]

Note though that this clashes with https://github.com/pinterest/elixometer/issues/88#issuecomment-337459222. If we go for 1.5+ there would need an alternative solution here. I think that would be getting exometer to work on 1.5 with git and not hex packages. I think that might be our best course of action because likely it would be required for the PSPDKit-labs fork to depend on exometer_core 1.5. Thoughts?

jparise commented 5 years ago

This was fixed by #121.