Poncho project module symbols disappearing

I have a Nerves Poncho setup with application projects A and B that are side-by-side:

  • A (Phoenix project with business logic and a couple of dependencies X & Y)
    • X (Some GenServers)
    • Y (Some utility modules used by X, local dependency included with path:)
  • B (Nerves firmware project that is strictly used for building and deploying)

I have been developing and testing with A running on my dev machine. Things work. X GenServers can get to modules in Y when I run Application A standalone.

When I deploy to the target hardware from project B (RPi3), things mostly work. The Phoenix LiveView features from A seem to be fine. But some code in X that refer to Y functions is failing. The Y functions failing are created by macros, if that matters. My next step was that I would try putting some non-macro functions in Y to see if I can call them from X when deployed on the RPi3.

(Edit before anyone responded: I added a normal function to a module in X that was called from the Phoenix LiveView code in A. Worked fine standalone running A. Running on the RPi3, it fails with a “function is undefined” “module is not available” error.)

I’m wondering if anyone has seen this behavior and if it’s unusual. Maybe I’m just significantly misunderstanding how Poncho projects should work.

Looking at this further this morning, my best suspicion is that since A is a path dependency of B, and Y is a path dependency of A, for some reason the B packaging isn’t including Y.

I don’t understand why the path dependency of a path dependency is not being packaged for the firmware bundle. Still digging.

I’m not sure what the issue is, but if it helps debugging, this should be reproducible without Nerves. I.e., replace the Nerves firmware project with a new Elixir project that has a path dep to A. In the new project, make an OTP release and run the release to test.

I’ll give that a try at some point, thank you for the suggestion. For the time being, I just punted and moved all of the code from the external path dependency into A.