Closed mbklein closed 11 months ago
I just reproduced the same series of errors and behaviors on MacOS (Apple Silicon) with elixir 1.15.7 and erlang 26.0.2. I also confirmed that it's only Jason
and Mox
that are misbehaving in this way – if I remove them both from the build, the next run works.
Remove applications: ...
entry from the mix.exs. That line says only uberauth should be loaded, which is why other deps are missing (except if they happen to be in memory). :)
Elixir and Erlang/OTP versions
Currently using erlang 26.2.1. But I've gotten the same behavior with elixir 1.15.4 and erlang 26.0.2.
All installed using
asdf
, if that makes a difference.Operating system
Linux (x86), Fedora 36 distro
Current behavior
I thought at first this was just a
mox
problem, but then it spread to other modules and became intermittent enough that I couldn't pin it to any one dependency.I'm trying to run this project's test suite for the first time in a while. I started getting
(UndefinedFunctionError) function Mox.defmock/2 is undefined (module Mox is not available)
. If Irm -rf _build/test
and then runmix test
again, it rebuilds and runs the test suite. But then if I immediately runmix test
again, I get the missing module error. I even tried running with the same seed just to eliminate another variable.Sometimes it's not
Mox
that's missing – sometimes I get 18 test failures telling me thatJason
isn't available instead. But whatever error occurs on the second run after the fresh build is the error that keeps happening until I purge the_build
directory and rebuild everything.Example:
More weird stuff to look at:
In the above example, hitting tab in IEx will autocomplete module names, but those modules aren't actually loaded and have no functions defined (e.g.,
Jason.Codegen
will autocomplete, butJason.Codegen.bytecase
will not).And one more, where I experiment with only deleting the beams for the "missing" modules:
Expected behavior
I'm not sure how to describe it. I guess, “Compiled code should load and run on subsequent invocations.”