Closed ejpcmac closed 5 years ago
I'm having same issues.
I'm cross compiling from ubuntu to raspbian including erts.
When I copy the entire _build/prod
folder to the raspberry it works like a charm.
But trying to copy the generated tar.gz is a headache.
The $ROOTDIR is bad calculated https://github.com/bitwalker/distillery/blob/master/priv/libexec/erts.sh#L301, so it isn't able to reach the erts folder.
After that, when I put it manually, it fails on trying to get the dependencies (https://github.com/bitwalker/distillery/blob/master/priv/libexec/erts.sh#L25-L33)
I think I'm missing something here.
I had the same issue. The following patch seems to fix the issue. I was able to cross compile from ubuntu to raspbian with erts successfully.
diff --git a/lib/mix/lib/releases/archiver.ex b/lib/mix/lib/releases/archiver.ex
index 674ff1e..af50f1b 100644
--- a/lib/mix/lib/releases/archiver.ex
+++ b/lib/mix/lib/releases/archiver.ex
@@ -236,15 +236,15 @@ defmodule Mix.Releases.Archiver do
end)
end
- defp maybe_include_system_libs(archive, %Release{profile: %{include_erts: true}}, tmpdir) do
+ defp maybe_include_system_libs(archive, %Release{profile: %{include_erts: _}}, tmpdir) do
Shell.debug("Including system libs from current Erlang installation")
Archive.add(archive, Path.join(tmpdir, "lib"), "lib")
end
@sujithrs Your patch won’t exclude system libs in case include_erts: false
is set, but I think you’ve spotted where the problem is :)
I’ve made a PR with the patch after reading a bit the code and using it for a project update. Thank you @sujithrs for the spotting the issue.
Steps to reproduce
include_erts: "some/path"
lib/
: there is no Elixir or other Mix dependenciesVerbose Logs
Description of issue
All dependencies should be included in
_build/prod/rel/<app>/lib
and in thelib/
directory inside the.tar.gz
. However, thelib/
directory in the archive contains only applications from OTP and my application. No Mix dependencies, no Elixir. It does work properly when usinginclude_erts: true
.2.0.10
The custom OTP is Erlang/OTP 21.1 built on FreeBSD 11.2-RELEASE-p4 from the ports tree.