I recently upgraded an erlang.mk-using project from OTP-25 to OTP-27, and the build (specifically make dialyze) started failing with “Unknown functions” and “Unknown types” warnings.
I’m aware that this is because the default changed to -Wunknown in OTP-26.
What bothers me is that these aren’t unknown functions and types – they’re documented, exported, functions in OTP-27, such as crypto:strong_rand_bytes/1.
How do I get dialyzer – specifically when using erlang.mk and make dialyze – to recognise that all of these functions and types are known, and to not issue these warnings?
According to the erlang.mk docs, as long as I have DEPS set correctly (and I do, 'cos otherwise my application wouldn’t work), I shouldn’t need to do anything else.
Later, I discovered that I had PLT_APPS = public_key elsewhere in the Makefile meaning that my first attempt to suppress the warning with PLT_APPS += crypto didn’t work. Setting PLT_APPS = crypto public_key fixes my immediate problem.
But it still leaves two questions: Why do I need to specify OTP applications? Surely they should be included by default. Further: Why do I need to include transitive dependencies? Surely they should be included if DEPS is set correctly.