Detects a mob.exs mob_dir that names a different mob than the :mob
dependency.
The native build compiles mob's C/ObjC/Swift sources (-Dmob_dir=…) from
mob_dir, while Mix compiles mob's Elixir side from the resolved :mob
dependency (Mix.Project.deps_paths()[:mob]). When those are two checkouts,
the app ships native code from one commit and BEAMs from another, and
nothing fails: a fix in one half silently doesn't reach the device (MOB-351).
Native builds stop on a mismatch; see
decisions/2026-10-01-mob-dir-must-match-mob-dep.md.
Summary
Functions
Whether mob_dir and dep_path are the same directory: :ok, or
{:mismatch, mob_dir, dep_path} with both paths expanded.
Raises Mix.Error naming both paths when the configured mob_dir isn't the
current project's :mob dependency. Call before compiling native code.
The resolved :mob dependency path of the current Mix project, or nil.
How to make the two agree.
The full error for a mismatch, naming both paths and the fixes.
When the two checkouts' NIF tables differ, a paragraph saying so and that the
app would crash at boot with undef mob_nif:log/1 (MOB-227), the symptom
someone in this state actually sees; otherwise "".
Functions
Whether mob_dir and dep_path are the same directory: :ok, or
{:mismatch, mob_dir, dep_path} with both paths expanded.
:ok when either is nil: an unset mob_dir or a project without a :mob
dependency has nothing to compare. Two existing directories are compared by
identity (device + inode), so a symlinked or differently-cased path to the
same checkout matches; otherwise by resolved real path.
@spec check!(Path.t() | nil) :: :ok
Raises Mix.Error naming both paths when the configured mob_dir isn't the
current project's :mob dependency. Call before compiling native code.
@spec dep_path() :: Path.t() | nil
The resolved :mob dependency path of the current Mix project, or nil.
How to make the two agree.
The full error for a mismatch, naming both paths and the fixes.
When the two checkouts' NIF tables differ, a paragraph saying so and that the
app would crash at boot with undef mob_nif:log/1 (MOB-227), the symptom
someone in this state actually sees; otherwise "".