First attempt, dialyzer complains:
lib/node_state.ex:5:unknown_function
Function :mnesia.add_table_copy/3 does not exist.
________________________________________________________________________________
lib/node_state.ex:5:unknown_function
Function :mnesia.create_table/2 does not exist.
________________________________________________________________________________
lib/node_state.ex:35:unknown_function
Function :mnesia.transaction/1 does not exist.
________________________________________________________________________________
lib/node_state.ex:36:unknown_function
Function :mnesia.write/1 does not exist.
________________________________________________________________________________
lib/node_state.ex:45:unknown_function
Function :mnesia.transaction/1 does not exist.
________________________________________________________________________________
lib/node_state.ex:46:unknown_function
Function :mnesia.read/1 does not exist.
________________________________________________________________________________
OK, fair enough, so need to add :mnesia
to extra_applications
in `mix.exs. Now dialyzer is happy. But release is sad:
** (Mix) :mnesia is listed both as a regular application and as an included application
So it it seems to be getting confused now that both mnesiac and my app require this :mnesia
.
OK, so how do I find this?
If I add {:mnesia, :optional}
to extra_applications
that seems to solve both problems. But seems wrong. - mnesia is not optional
.