Open callmiy opened 3 weeks ago
May be it is related to this line TERMUX_PKG_SRCURL=https://github.com/elixir-lang/elixir/releases/download/v${TERMUX_PKG_VERSION}/elixir-otp-25.zip which is hardcoded to otp-25
while the installed erlang is otp-27
...which is hardcoded to
otp-25
while the installed erlang isotp-27
Thank you for reporting the issue. I have added a pull request with your suggestion. Would you like to test the packages from GitHub Actions artifacts of that pull request? Link https://github.com/termux/termux-packages/actions/runs/10496812629
Thanks for the quick response. The PR fixed the erlang OTP version but does not fix the error I was getting with mix archive.install hex phx_new
.
Could you explain what does those error mean in simple English? The error output is more cryptic than C++ compiler error.
The issue has not been fixed yet. Please feel free to create pull request to fix the issue.
The issue is that the Erlang runtime is not loading the root CA certificates. This might be fixable with a compile-time option for the Erlang package, but I'm not sure. As a workaround, I added the following function call in an Elixir script after ensuring the ca-certificates
package was installed: :pubkey_os_cacerts.load(["/data/data/com.termux/files/usr/etc/tls/cert.pem"])
. This exception was not raised when I ran that script. I expected to need to include this call in any code that needed to make HTTPS connections, but interestingly the :pubkey_os_cacerts.get/0
function no longer raised an exception in subsequent runs, at least for mix-related commands. Maybe I just got lucky. But this suggests that it might be possible to just paste that function call in an iex
shell and not need to run it again, IDK.
@callmiy Your mix archive.install hex phx_new
also worked for me after I ran the above :pubkey_os_cacerts.load(...)
:
$ mix archive.install hex phx_new
Resolving Hex dependencies...
Resolution completed in 0.029s
New:
phx_new 1.7.14
* Getting phx_new (Hex package)
All dependencies are up to date
Compiling 11 files (.ex)
Generated phx_new app
Generated archive "phx_new-1.7.14.ez" with MIX_ENV=prod
Are you sure you want to install "phx_new-1.7.14.ez"? [Yn]
* creating /data/data/com.termux/files/home/.mix/archives/phx_new-1.7.14
@dragon0 Thanks—your fix worked! I posted about the issue on the Erlang forum. Hopefully, someone can confirm your suspicion, and we can move forward.
I have elixir and erlang installed:
When I tried to install an elixir:
I received the following error: