rayex

rayex

Cannot compile an Erlang dependency in an Elixir project

Hi,
I am using the following versions:
Erlang/OTP 27 [erts-15.1] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] [jit:ns]
Elixir 1.18.4 (compiled with Erlang/OTP 27)

I am compiling an Identicon project based on the one by Stephen Grider.
In this project, I use the following dependency:
{:egd24, “~> 0.10”}

Unfortunately, when compiling this dependency, I get a compile error:

  mix deps.compile egd24
===> Analyzing applications...
===> Compiling string_compat
===> Compiling bbmustache
===> Compiling _build/default/plugins/bbmustache/src/bbmustache.erl failed
     ââ _build/default/plugins/bbmustache/src/bbmustache.erl:
     â
 622 â  -spec check_data_type(data() | term()) -> boolean() | maybe.
     â                                                        â°ââ syntax error before: 'maybe'

     ââ _build/default/plugins/bbmustache/src/bbmustache.erl:
     â
 624 â  check_data_type([])                               -> maybe;
     â                                                            â°ââ syntax error before: ';'


     ââ _build/default/plugins/bbmustache/src/bbmustache.erl:
     â
 181 â      case check_data_type(Data) of
     â           â°ââ function check_data_type/1 undefined

     ââ _build/default/plugins/bbmustache/src/bbmustache.erl:
     â
 207 â      case check_data_type(Value) of
     â           â°ââ function check_data_type/1 undefined

     ââ _build/default/plugins/bbmustache/src/bbmustache.erl:
     â
 592 â      case check_data_type(Data) =:= true andalso find_data(convert_keytype(Key, State), Data) of
     â           â°ââ function check_data_type/1 undefined

Any help appreciated…
Thanks, :slight_smile:

Most Liked

al2o3cr

al2o3cr

maybe was introduced as an Erlang feature in OTP 27.

You can disable it partially using a couple different methods:

I suspect there’s a way to pass the required options for just one dependency when building with mix deps, but I don’t see a good example of it.

The easiest approach would be to copy bbmustache locally and add -feature(maybe_expr, disable) to the top of bbmustache.erl.

rayex

rayex

Hi,

I found a better solution thanks to the advise of Hinagiku Soranoba (the publisher of bbmustache).

I updated file rebar.config of the egd app to use the latest version of rebar3_appup_pluginlike so:

%% -*- erlang -*-
% {plugins, [rebar3_appup_plugin]}.
{plugins, [{rebar3_appup_plugin, "2.4.8"}]}.

{provider_hooks, [{post, [{compile, {appup, compile}},
                          {clean, {appup, clean}}]}
                 ]}.

{otpdoc_opts, [{edoc_modules, [egd]}]}.

%% vim: ft=erlang

Where Next?

Popular in Troubleshooting Top

tomekowal
Hi! I am trying to pinpoint why my project has issue on incremental compilation when running tests in elixir 1.19.0-rc.0-otp-26 I am ru...
New
chocolatedonut
Besides (over)logging every code-path leading to Repo.insert_all, is it possible to make Postgrex and/or ecto_sql log the exact, failing ...
New
mooreryan
In a project I’m working on, I cannot get tests with breakpoints or pry working. Here is an example in a new mix project. Create a fresh...
New
harmon25
Hi All, I am bumping into a weird issue with an umbrella app while upgrading to latest Elixir 1.19.x + otp28. A couple apps in the umbr...
New
runyonave
We have been stuck on this for a few days now and I am really not sure what could be missing. I can get chromic_pdf to work perfectly fin...
New
michaelterryio
Hey, I’ve got a project with several path dependencies. Some are phoenix apps, but this likely isn’t relevant. I don’t fully understand...
New
onelastdance
Hey there, Using the install script method recommended here on Ubuntu 24.04: And then running the following commands: iex> :obser...
New
klo
Is there any way to go from a float 1.0 to 1.00 while retaining the float() type?
New
rayex
Hi, I am using the following versions: Erlang/OTP 27 [erts-15.1] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] [jit:ns] El...
New
apoorv-2204
The Issue of Enums in Elixir Elixir doesn’t have a native enum construct, so we usually rely on atoms, strings, or macros to represent na...
New

Other popular topics Top

yurko
Here are few pieces of (common) Linux knowledge that we use for reasonably small one server apps. We use Ubuntu but this should work for ...
New
sergio
In Ruby, I can go: User.find_by(email: "foobar@email.com").update(email: "hello@email.com") How can I do something similar in Elixir? ...
New
dotdotdotPaul
Okay, I'm having a heck of a time trying to figure out how to best handle the validation of belongs_to associations in Ecto. I'm sure I'...
New
Tee
can someone please explain to me how Enum.reduce works with maps
New
William
I would like to know that is there any online source for learning Phoenix Framework for building E-Commerce Store? Any advantage on build...
New
aalberti333
As the title describes, I’m trying to run Enum.map() over a list of key/value pairs, where the value is a map. My data looks like this: ...
New
SoCreat
i’m a new one to elixir which editor can i use vs code? or atom? Thanks! :smiley:
New
script
If I have a string “1000 cfu/ml” . I want to remove the characters and / and space . So the string is like this "1000" What is the ...
New
baxterw3b
Hi guys, i’m new in the Elixir world, and i have to say, that i love it! i’m having some problem to understand anonymous functions with ...
New
Nvim
Elixir appears to be a superior language to Python. I don’t see any advantage of Python over Elixir. Are there any?
New

We're in Beta

About us Mission Statement