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

How to use this in Elixir? #4

Open
edescourtis opened this issue Jun 4, 2018 · 5 comments
Open

How to use this in Elixir? #4

edescourtis opened this issue Jun 4, 2018 · 5 comments

Comments

@edescourtis
Copy link

Hi, I would like to use Elixir with mix to use riak_core? How can I get riak_core_ng to compile with mix?

@Licenser
Copy link
Member

Licenser commented Jun 4, 2018

I don't think you need this with elixis, mix should hopefully let rebar do the compilation of the riak_core_ng package otherwise mix would need to implement a hell lot of things to remain compatible.

@edescourtis
Copy link
Author

edescourtis commented Jun 4, 2018

eric@eric-desktop:~/dev/no_slides$ mix deps.compile gen_fsm_compat
===> Compiling gen_fsm_compat
===> Unable to run pre hooks for 'compile', command 'erl_vsn' not found.
** (Mix) Could not compile dependency :gen_fsm_compat, "/home/eric/.asdf/installs/elixir/1.5.2/.mix/rebar3 bare compile --paths "/home/eric/dev/no_slides/_build/dev/lib/*/ebin"" command failed. You can recompile this dependency with "mix deps.compile gen_fsm_compat", update it with "mix deps.update gen_fsm_compat" or clean it with "mix deps.clean gen_fsm_compat"
eric@eric-desktop:~/dev/no_slides$ 

This is what I am getting when trying to compile https://github.com/gpad/no_slides.git branch riak_core_3 with mix. It's using riak_core_ng.

I tried to change mix.exs to this:

defmodule NoSlides.Mixfile do
  use Mix.Project

  def project do
    [app: :no_slides,
     version: "0.1.0",
     elixir: "~> 1.3",
     build_embedded: Mix.env == :prod,
     start_permanent: Mix.env == :prod,
     deps: deps()]
  end

  # Configuration for the OTP application
  #
  # Type "mix help compile.app" for more information
  def application do
    [applications: [:riak_core, :logger ],
     mod: {NoSlides, []}]
  end

  # Dependencies can be Hex packages:
  #
  #   {:mydep, "~> 0.3.0"}
  #
  # Or git/path repositories:
  #
  #   {:mydep, git: "https://github.com/elixir-lang/mydep.git", tag: "0.1.0"}
  #
  # Type "mix help deps" for more examples and options
  defp deps do
    [
      {:riak_core, "~> 3.0.9", git: "https://github.com/Kyorai/riak_core.git", branch: "r20"},

      #{:riak_core, "~> 3.0.9", hex: :riak_core_ng, },
      {:cuttlefish, git: "https://github.com/gpad/cuttlefish", branch: "develop", override: true},
      {:poolboy, "~> 1.5.1", override: true},
    ]
  end
end

with no luck.

@edescourtis
Copy link
Author

edescourtis commented Jun 5, 2018

I made a minimal elixir project that includes a minimal erlang dependency with rebar_erl_vsn as a provider_hook and I get the same result. Must be an issue between rebar3 and mix however I don't see why that is since other things like pc(port compiler) work just fine.

@Licenser
Copy link
Member

Licenser commented Jun 6, 2018

Hi,
I did try this yesterday and couldn't even get anything to compile form that repo. But it looks like a bug in mix: https://gitlab.com/Project-FiFo/gen_fsm_compat/issues/1

@edescourtis
Copy link
Author

edescourtis commented Jun 6, 2018

I added a hacky workaround to that issue on gitlab. Also started issue on the Elixir repo for mix here.

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