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

alexlanderzander
Hello everyone, I’m working on a blockchain project in Elixir and I’m implementing some of the core cryptography in a Rust NIF using Rus...
New
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
Ferenc
I have installed it on Phoenix 1.8.1 (without authentication or other packages and got 2 problems). I had to set up things manually the ...
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
wktdev
I tried to learn Elixir a few years ago and stopped. I am trying again. In the code below I have a GenServer that is started by a Superv...
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
jdj_dk
Hi everyone. I’m trying to setup a small cluster with three nodes. I’m using libcluster as I have before. But my nodes doesn’t have a us...
New
pikdum
Hello, I’m trying to upgrade a pretty large project from Elixir 1.18.4 to Elixir 1.19.1 (1321 modules), but seeing some compiler warning...
New
klo
Is there any way to go from a float 1.0 to 1.00 while retaining the float() type?
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

Other popular topics Top

minhajuddin
I have seen a lot of code which picks the first element from a list using Enum.at(0) instead of List.first. Is there a reason why people ...
New
JDanielMartinez
Hi! May someone helps me, please! I have two apps into an umbrella project: the first one is Database, which manages queries, and the se...
New
senggen
Erlang/OTP 25 [erts-13.2.2] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] 15:22:35.803 [error] gen_event {lager_file_backend...
New
openscript
Hello! Sorry for this astonishing simple question, but I’m really stuck. I try to set up the intellij-elixir plugin, but I don’t know ho...
New
grych
Hi folks, Few months ago I have announced the proof-of-concept of the library to manipulate the browsers DOM objects directly from Elixi...
639 49522 488
New
polypush135
As many of you may have realized by now (sorry for all the posts here) I’ve been working on a db problem where I’m trying to aggregate a ...
New
mcarvalho
What is the difference between System.get_env and Application.get_env? For example, what are best practices to use one versus another.
New
stefanluptak
Hello everybody, usually, I use a 29" ultra-wide monitor for VSCode which can easily accomodate explorer (files panel) + file with code ...
New
WestKeys
Currently suffering from paralysis by [HTTP client] analysis. This is rather unusual in Elixirland as there tends to be consensus on the ...
New
AstonJ
by Lance Halvorsen Elixir and Phoenix are generating tremendous excitement as an unbeatable platform for building modern web application...
460 27162 124
New

We're in Beta

About us Mission Statement