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

Compilation fails in file lib/nebulex/rpc.ex #123

Closed
johannesE opened this issue Jun 11, 2021 · 6 comments
Closed

Compilation fails in file lib/nebulex/rpc.ex #123

johannesE opened this issue Jun 11, 2021 · 6 comments

Comments

@johannesE
Copy link

$ mix compile
==> nebulex
Compiling 44 files (.ex)

== Compilation error in file lib/nebulex/rpc.ex ==
** (ArgumentError) argument error

could not compile dependency :nebulex, "mix compile" failed. You can recompile this dependency with "mix deps.compile nebulex", update it with "mix deps.update nebulex" or clean it with "mix deps.clean nebulex"

config.exs

config :ex_owm, ExOwm.Cache,
  gc_interval: :timer.hours(1),
  max_size: 1_000,
  # 20MB
  allocated_memory: 20_000_000,
  gc_cleanup_min_timeout: :timer.seconds(10),
  gc_cleanup_max_timeout: :timer.minutes(10),
  backend: :shards,
  stats: true
defmodule ExOwm.Cache do
  use Nebulex.Cache, otp_app: :ex_owm, adapter: Nebulex.Adapters.Local
end

mix.exs

defmodule ExOwm.Mixfile do
  use Mix.Project
  def project do
    [...]
  end
  # Run "mix help compile.app" to learn about applications.
  def application do
    [
      extra_applications: [:logger],
      mod: {ExOwm.Application, []}
    ]
  end
  # Run "mix help deps" to learn about dependencies.
  defp deps do
    [
      {:httpoison, "~> 1.7"},
      {:jason, "~> 1.2"},
      {:nebulex, "~> 2.0"},
      {:ex_doc, "~> 0.22", only: :dev, runtime: false},
      {:credo, "~> 1.4", only: [:dev, :test], runtime: false}
    ]
  end
end

Nebulex Version is 2.1.0 according to mix.lock
I tried to find out more, but this is really weird. I'm running this on ubuntu with elixir 1.9. Maybe I'm lacking some dependencies? I tried mix clean etc. Any tipps?

@cabol
Copy link
Owner

cabol commented Jun 11, 2021

Hey 👋 ! Yeah it is weird, I hadn't seen that error when using Nebulex before. Anyway, I see you are using :shards as backend (backend: :shards), then you need to add :shards to the dependencies {:shards, "~> 1.0"}, but I'm not sure that is the cause of the error. What Elixir and OTP version are you using?

@johannesE
Copy link
Author

I added the shards dependency. That worked, but did not fix the issue.

$ mix compile
===> Compiling shards
==> nebulex
Compiling 44 files (.ex)

== Compilation error in file lib/nebulex/rpc.ex ==
** (ArgumentError) argument error

could not compile dependency :nebulex, "mix compile" failed. You can recompile this dependency with "mix deps.compile nebulex", update it with "mix deps.update nebulex" or clean it with "mix deps.clean nebulex"

$ elixir -v
Erlang/OTP 23 [erts-11.2] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] [hipe]

Elixir 1.9.4 (compiled with Erlang/OTP 20)

@johannesE
Copy link
Author

The project is actually open source, so it is available here: https://github.com/johannesE/ex_owm

@cabol
Copy link
Owner

cabol commented Jun 14, 2021

Ok, will try to reproduce the issue.

@cabol
Copy link
Owner

cabol commented Jun 14, 2021

@johannesE I think the issue could be because you are using OTP 20, and Nebulex uses persistent_term which is included since OTP 21. Could you try with a higher OTP version, at least 21?

@johannesE
Copy link
Author

You are right. Upgrading to elixir 1.12.1 solved it. Sorry for taking your time with this.

johannesE pushed a commit to johannesE/ex_owm that referenced this issue Jun 14, 2021
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