Closed SaphiraKai closed 1 month ago
You are right, port_compiler 1.14 cannot be compiled using Erlang/OTP 27.
That was solved seven months ago in commit 7902cbeefaf18ce59878330b0f7bd946cc6ed963, and port_compiler 1.15 was released later. With that, port_compiler compiles perfectly with Erlang/OTP 27 and all the older versions :)
Let's see your case:
$ nano rebar.config # add `pc` to deps
...
$ rebar3 compile
===> Verifying dependencies...
===> Fetching pc v1.14.0
It seems you don't tell rebar3 what exact version of pc you want to install, so rebar3 searches its cache (in $HOME/.cache/rebar3/
) if it has already downloaded one... and it seems you have downloaded pc 1.14 some time ago.
Solutions:
A) Tell rebar3 explicitely that you want to use pc 1.15, not any other. Maybe something like:
{pc, "1.15.0"}
B) Update your cached pc download. Looking at the documentation, I'd say something like this would help:
$ rebar3 plugins list
$ rebar3 plugins upgrade pc
Thanks @badlop! Definitely an annoying case of rebar3 not fetching the latest dep. It does this to not make network calls unless it has to, so if it a version in the cache matches the constraint in a config there is no update. Another way to "fix" this would have been:
rebar3 update
This updates the available versions in the local cache of hex packages. So it'd then know about pc
1.15.0
. But if you had already run compile
it would be "happily" using 1.14.0
and not update without an explicit change to the dep as @badlop shows or after cleaning out the plugins dir so it has to refetch pc
.
Ahh, well that explains my test project at least.
It seems that a different project mine depends on (fs
) is using the outdated version of pc
, that's the real issue.
Thanks for the guidance!
I'm very unfamiliar with Erlang (I ran into this from a Gleam project), apologies if I confuse anything here.
I cannot compile
pc
on my machine when using Erlang/OTP 27:Erlang/OTP 26 works: