the_wildgoose

the_wildgoose

Compile error in syslog since upgrading to erlang 27

Since upgrading to erlang 27 my projects which import the syslog library fail to compile. This can be trivially reproduced with

  • mix new test
  • edit mix.exs to include dependency on: {:syslog, “~> 1.1.0”},
  • mix compile - will now error with:
===> Fetching pc v1.13.0
===> Analyzing applications...
===> Compiling pc
===> Compiling _build/default/plugins/pc/src/pc_port_env.erl failed
_build/default/plugins/pc/src/pc_port_env.erl:190:10: code:lib_dir/2 is deprecated; this functionality will be removed in a future release

===> Errors loading plugin pc. Run rebar3 with DEBUG=1 set to see errors.
===> Analyzing applications...
===> Compiling pc
===> Analyzing applications...
===> Compiling syslog
===> Uncaught error in rebar_core. Run with DIAGNOSTIC=1 to see stacktrace or consult rebar3.crashdump
===> When submitting a bug report, please include the output of `rebar3 report "your command"`
** (Mix) Could not compile dependency :syslog, "/Users/edward/.mix/elixir/1-17/rebar3 bare compile --paths /Users/edward/Documents/src/elixir/temp/test_syslog/_build/dev/lib/*/ebin" command failed. Errors may have been logged above. You can recompile this dependency with "mix deps.compile syslog --force", update it with "mix deps.update syslog" or clean it with "mix deps.clean syslog"

I cannot make head nor tail of the debug or error reports. For completeness, here is the output from rebar3.crashdump (edit, it’s too long for the post. Here are the first few lines)

Error: undef
[{pc_port_env,construct,
     [{state_t,
          "/Users/edward/Documents/src/elixir/temp/test_syslog/deps/syslog",
          {dict,13,16,16,8,80,48,
              {[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]},
              {{[],
                [[{deps,default}],
                 [{plugins,default},pc],
                 [{project_plugins,default}]],
                [[base_dir,47,85,115,101,114,115,47,101,100,119,97,114,100,47,
                  68,111,99,117,109,101,110,116,115,47,115,114,99,47,101,108,
                  105,120,105,114,47,116,101,109,112,47,116,101,115,116,95,
                  115,121,115,108,111,103,47,100,101,112,115,47,115,121,115,
                  108,111,103,47,95,98,117,105,108,100],
                 [deps_dir,108,105,98]],
                [[erl_opts,debug_info,warn_untyped_record,
                  {platform_define,"^[0-9]+",namespaced_types}],
                 [plugins,pc],
                 [artifacts,"priv/syslog_drv.so"],
                 [provider_hooks,
                  {post,[{compile,{pc,compile}},{clean,{pc,clean}}]}],
                 [overrides],
                 [profiles,
                  {test,
                      [{erl_opts,[{d,'TEST'}]},
                       {extra_src_dirs,[{"test",[{recursive,false}]}]}]}]],

Marked As Solved

jstimps

jstimps

I’ve also run into something similar lately but was not able to get to the root cause. However, the symptom appears to be that rebar is pulling version 1.13.0 of pc from hex instead of the latest 1.15.0.

Since rebar does not lock plugins, I’m not sure what its mechanism is for discovery of “latest version” from hex that is causing it to grab 1.13.0.

For my own purposes, I was able to workaround this by changing my rebar.config like so

% rebar.config
{project_plugins, [{pc, "1.15.0"}]}.

My actual commit here for the curious

Unfortunately this workaround won’t be directly helpful to you since the rebar.config is not under your control.

Also Liked

the_wildgoose

the_wildgoose

OK, thanks to both of you! That got me to the solution!

So it seems that rebar3 has a dependency cache and for whatever reason it doesn’t refresh it?! So blowing away the rebar3 cache is enough to resolve this problem!

Solutions are either (note I’m on Mac):

~/.mix/elixir/1-17/rebar3 clean --all
or
rm -rf ~/.cache

Then in my project I need to mix deps.clean syslog; mix deps.get in order to get it to notice the change

Thanks all!

Where Next?

Popular in Questions Top

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
marius95
Hello everyone, I try to use an Javascript Event Handler in my root.html.leex file. Therefore I created a function in the app.js file: ...
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
tduccuong
Hi, is there any work on GUI with Elixir, that is similar to Electron/Javascript? My idea is to bundle Phoenix and BEAM into a single se...
New
Fl4m3Ph03n1x
About me? ( if you have nothing better to do than reading about some random guy in the internet :stuck_out_tongue: ) Hello all, this is ...
New
jerry
Good day to you all. I have been struggling to get a query involving like and ilike to work. Can anyone assist me on this, please? pro...
New
romenigld
I am trying to run a deploy with docker and I successfully runned with this command: docker build -t romenigld/blog-prod . but when I t...
New
earth10
Hi, I’m just starting to build a side-project with Elixir and Phoenix and doing some basic test with Elixir alone. What strikes me is th...
New
vegabook
I’m brand new to Phoenix and I have stripped one of the demo applications to the bone. I just want to get an svg up on the screen. Here i...
New
jononomo
For some reason my phoenix channels are working for me in my local dev environment, but as soon as I deploy via Docker, I get a 403 error...
New

Other popular topics Top

danschultzer
None of the current solutions worked well for me, so I went ahead and built a user management system from scratch. This project took far...
548 29603 241
New
chrismccord
This release brings a number of exciting features, including integration with the new Phoenix LiveDashboard and Phoenix LiveView. There h...
New
jay1
Why is it that the mnesia database isn’t the most preferred database for use in Elixir/Phoenix?
New
Emily
I have VueJS GUIs with the project generated using Webpack. I have Elixir modules that will need to be used by the VueJS GUIs. I forese...
New
sergio_101
I am VERY much an elixir newbie. I have taken one elixir course and one phoenix course on Udemy. During that course, I saw the instructor...
New
Brian
What is the proper way to load a module from a file in to IEX? In the python world, doing something like this pretty standard: from ....
New
Qqwy
Update: How to use the Blogs & Podcasts section You can post links to your blog posts or podcasts either in one of the Official Blog...
3271 127089 1222
New
hariharasudhan94
Lets say I have map like this fetching from my database %{"_id" => #BSON.ObjectId<58eb1a7a9ad169198c3dXXXX>, "email" => ...
New
jaysoifer
Is there a way to rollback a specific migration and only that one (“skipping” all the other ones)? Would mix ecto.rollback -v 200809061...
New
vegabook
I’m brand new to Phoenix and I have stripped one of the demo applications to the bone. I just want to get an svg up on the screen. Here i...
New

Latest on Elixir Forum

Elixir Forum

We're in Beta

About us Mission Statement