Building from source: issues with git

Hello,

I am following steps on the following page to install Elixir on my Centos 6 32-bit VM: https://www.unixmen.com/install-erlang-elixir-centos-7/

I have the latest version of Erlang/OTP installed, and now I’m following steps in the “Install Elixir” section. I cloned the git repo but when I run “make clean test”, I’m getting errors when the script is trying to test the mix tool:

(Mix.Error) Command “git -c core.hooksPath=’’ init --quiet” failed

My git does not recognize the “-c” option. Is there a way for me to somehow circumvent this, e.g. by providing the necessary custom options via a config file? Where in the source code would I have to look for this?

Regards,
Michal

What version of git (git --version) do you have? The -c option is ancient… I don’t recall what version it was added but way way back in the v1 era as I recall. You do have at least version 2.x of git installed to start with (even v2 is many many years old, like 6 or 7 years old I think)?

EDIT: If you do have a git version older than v2 then you really badly need to update it. V1 had insecure hash generation (not just theoretically) that has since been updated along with a lot of other security fixes, not to mention all the other security and other fixes since v2.0.0 first came out.

According to CentOS Mirror, a git 1.8.3.1 is served. Which again is from 2013 according to the tag (Release v1.8.3.1 · git/git · GitHub).

So yes, that system needs an update…


This means nothing to me on any distribution, especially not on RHEL or CentOS. Especially after “latest” in EPEL seems to be OTP 16B3. Elixir 1.0 needs at least OTP 17. A current elxir needs at least OTP 19.

2 Likes

You probably want to at least install CentOS 7 instead of 6.

Thanks, guys. I was expecting that - people telling me to upgrade instead of answering my question :slight_smile:

Yes, my git is ancient (1.7) so that explains the problem. Elixir does however seems to have built properly once I skipped the tests. So I think I’m set for now.

A VM upgrade is planned but it will definitely take longer than the free time I have now :wink:

BTW, I did build Erlang/OTP 22 from source. It was actually quite painless.

Thanks,
Michal

It’s also painless to build git, it’s literally a download source, extract, make, make install # as root, and I would highly highly recommend it. Running such an old git version is extremely insecure!

Thanks, good point.

Based on your feedback, I’ve decided to bite the bullet and move my server to a current distro :slight_smile:

BTW, I’ve encountered some other strange errors when building Elixir from scratch. Is this the right place to share them with the community? Or should I open a ticket somewhere?

Best,
Michal

What kind of strange errors?

If they all are because of outdated dependencies, I don’t think you need to share them.

I have never encountered on systems I operate. I have to admit though, that I preferably use arch, ubuntu (latest LTS) and sometimes at work I have to use some CentOS7, but except for a single experiment a year ago, I didn’t need to install elixir on it. For docker based deploys I tend to reach out for alpine and also never had issues, even though I roll my Dockerfiles by hand.

The following unit tests were failing (see exception_test.exs):

test “annotates band arithmetic errors” do
use Bitwise

    assert blame_message(:foo, &band(10, &1)) ==
             "bad argument in arithmetic expression: Bitwise.band(10, :foo)"

    assert blame_message(:foo, &(10 &&& &1)) ==
             "bad argument in arithmetic expression: Bitwise.band(10, :foo)"
  end

  test "annotates bor arithmetic errors" do
    use Bitwise

    assert blame_message(:foo, &bor(10, &1)) ==
             "bad argument in arithmetic expression: Bitwise.bor(10, :foo)"

    assert blame_message(:foo, &(10 ||| &1)) ==
             "bad argument in arithmetic expression: Bitwise.bor(10, :foo)"
  end

  test "annotates bxor arithmetic errors" do
    use Bitwise

    assert blame_message(:foo, &bxor(10, &1)) ==
             "bad argument in arithmetic expression: Bitwise.bxor(10, :foo)"

    assert blame_message(:foo, &(10 ^^^ &1)) ==
             "bad argument in arithmetic expression: Bitwise.bxor(10, :foo)"
  end

Best,
Michal

I never run unit tests when compiling from a tag, so perhaps you should provide additional info, as exact fail message, tag/sha you built from and which OTP you used.