the_wildgoose

the_wildgoose

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}]}]}]}]],

Showing Posts 1 to 3

dimitarvp

dimitarvp

I have the same problem but did not pursue it yet. I assumed I need to upgrade a dependency because it has a transitive dependency on pc and it’s a lower version than the latest one. I did that but even the latest version is stuck on a lower version of pc so nothing much I can do except fork the library which is not necessary as I am literally swapping it out for another one this week.

I am assuming pc itself had to fix these errors due to OTP 27 but if you can’t upgrade it due to transitive dependencies then you’d be out of luck.

I plan to pursue this Soon™ because it annoys me. Let us know if you find a fix in the meantime.

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.

the_wildgoose

the_wildgoose OP

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!

— All posts loaded —

Where Next? Top

Trending in Questions Top

RSP87
I’m working on a project that simulates the bumbl example in the programming phoenix book. It acts almost like an email client. We have a...
New
kpanic
Hi everyone, I am toying with the idea of building a “match maker” for giving personal help to people that wants to start coding. I sta...
New
nseaSeb
Hello, I know there is an approach for handling lists that allows for optimized traversal, but I can’t recall the specific method (somet...
New
brecabral
Documentation While reading the Scoped Routes section, I noticed that the documentation currently refers to a problem without explainin...
New
velrest
So my question is quite simple and i have found no conclusive answer on forum, google or AI. Should we use :erlang.float for Integer to ...
New
asweet-confluent
I recently noticed that Elixir’s Logger defaults its primary log level to :debug when no :logger, :level application configuration is pre...
New
apz
I’m new to elixir and just tried to install the elixirLS extension for VScode(ium) and it is throwing some errors that I would like help ...
New

Other Trending Topics Top

GenericJam
Edit: 2026 May 15 - This post is archived. Mob is alive!! Main docs: mob v0.7.11 — Documentation A bit of explanation for the slightly c...
New
JesseHerrick
Hey, I’m Jesse and I’m the main contributor behind Dexter, a full-featured, lightning-fast Elixir LSP optimized for large codebases. It s...
New
mudasobwa
I am happy to introduce the very α version of the new programming language compiled to BEAM. Welcome Cure. It has literally three kille...
New
marciok
Hi there! We created Gust: A task orchestrator inspired by Airflow. For those who have never heard about Aiflow, it’s a Python-based wor...
New
mhanberg
Hi everyone! The first release candidate for the Expert language server project is now available! We’ve published a press release detai...
New
jimsynz
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews