Hi.
I’m using the :syn
library as a dependency in an umbrella app.
In my root level mix.exs it is defined like this:
def project do
[ apps_path: "apps",
build_embedded: Mix.env == :prod,
start_permanent: Mix.env == :prod,
deps: deps(),
releases: releases() ]
end
def deps do
[ {:syn, path: "deps/syn", override: true, app: false},
[...]
(I copy my dependencies into the deps folder before compiling because we have a policy of not pulling from the internet during compilation.)
And my releases for the build I’m running looks like this:
defp releases do
[ unified_host: unified_host(),
unified_target: unified_target() ]
end
defp unified_host do
[ steps: [ :assemble, &create_tarball/1 ],
include_executables_for: [:unix],
include_erts: true,
[...]
applications: unified_apps() ]
end
[...]
defp unified_apps do
[ runtime_tools: :none,
poison: :load,
sweet_xml: :load,
syn: :load,
(I only “load” :syn since I manually start it later during application start.)
I have an in-umbrella app named “common” that requires :syn. Its mix.exs looks like this:
def project do
[app: :common,
[...]
compilers: compilers(),
elixirc_options: [ warnings_as_errors: true, long_compilation_threshold: 30 ],
deps: deps()]
end
# replace default Erlang compilation with parallel one
# this one is specifically tuned for compiling our
# huge Erlang files faster
Code.require_file("erlang.parallel.ex", "lib")
Code.require_file("compile.erlparallel.ex", "lib")
defp compilers, do: [ :erlparallel | List.delete(Mix.compilers, :erlang) ]
[...]
def deps do
[{:syn, in_umbrella: true, override: true, app: false},
[...]
end
Compilation is done within a Docker image. When I run this “locally,” all works fine. My applications are compiled - dependencies first - and I see both dependencies from umbrella mix.exs and apps/common/mix.exs. Then it starts compiling the “common” app. It passes and continues to compile other umbrella apps that are dependent on common, etc.
===> Compiling syn
==> common
Compiling 8 files (.erl)
If the same Docker image and code is run on a CI host, the console is flooded with warnings like this one:
warning: :syn.send/2 is undefined (module :syn is not available or is yet to be defined)
Invalid call found at 2 locations:
lib/interface.ex:30: If.Dispatcher.Registry.send/1
lib/interface.ex:30: If.Dispatcher.Registry.strict_send/1
Even though:
11:32:23 ===> Compiling syn
11:32:29 ==> common
11:32:29 Compiling 8 files (.erl)
The same steps, same tooling from Docker image, the same mix.exs files, different machine. Unfortunately I have no access to the machine to start the same build manually. The only difference I can immediately see is that the “CI machine” (where it fails) has 16 cores and the “local” work server I have access to has 48 cores.
With elixir 1.10.4 this approach was working locally and in CI.
With elixir 1.13.4 this approach is working locally but not in CI.
I’m really stumped and would appreciate some help.