benwilson512

benwilson512

Author of Craft GraphQL APIs in Elixir with Absinthe

Help with Dialyzer and nowarn_function

Hey folks!

I’ve got a branch in Absinthe that conditionally uses the :persisten_term module if it’s available. Unfortunately this is causing me issues with dialyzer, for reasons I can’t quite sort out. I’d like to do one of two things:

  1. Figure out why dialyzer things :persistent_term.put/2 is unavailable on OTP 21.2. This would be the best option.
  2. If that fails, mark the function as nowarn. I’ve tried this, but I can’t seem to get the invocation correct.

Branch: https://github.com/absinthe-graphql/absinthe/pull/895/files
Failing Travis job: https://travis-ci.org/github/absinthe-graphql/absinthe/jobs/668979055?utm_medium=notification&utm_source=github_status
Line where I try to tell dialyzer to ignore stuff: https://github.com/absinthe-graphql/absinthe/pull/895/files#diff-84866da0b679965d8a1826c4dc1665e6R63

Marked As Solved

kip

kip

ex_cldr Core Team

Sometime in the past, for reasons I don’t recall (but I think i was heading down the same path as you) I added the following to my .dialyzer_ignore_warnings fie which seemed to quiet things down. Hope it helps make some progress.

:0: Unknown function persistent_term:get/2
:0: Unknown function persistent_term:put/2

I think this may also have been because of the @dialyzer issue you are having - i think I had the same but can’t fully recall.

Also Liked

benwilson512

benwilson512

Author of Craft GraphQL APIs in Elixir with Absinthe

Hi @kip thanks for the suggestion. I added a file with those lines to that file and at first it didn’t work, but then switched it to using the Elixir formatted documented by dialyxir. This worked!

Commit: https://github.com/absinthe-graphql/absinthe/pull/895/commits/445e662ca92b789c23555fe9dcb3b7307f340756

Dialyxir format: https://github.com/jeremyjh/dialyxir#elixir-term-format

I’d still like to sort out why dialyzer doesn’t think persistent_term.put exists for that version of Erlang though.

tristan

tristan

Rebar3 Core Team

We’ve now hit this issue in OpenTelemetry https://github.com/open-telemetry/opentelemetry-erlang-api/pull/82

But what is extra weird is that dialyzer has been working fine, no warnings about persistent_term:put/2. It is only now that Elixir’s dialyxer task has been added that its use of dialyzer warns about the function…

Where Next?

Popular in Questions Top

gshaw
What is the idiomatic way of matching for not nil in Elixir? E.g., First way: defp halt_if_not_signed_in(conn, signed_in_account) when...
New
albydarned
Hello all! I am typing this post from my new MacBook Pro with the M1 chip. I’m loving it so far, and will probably use it as my daily dr...
New
_russellb
I want to try my hand at web scraping. What tools/libraries do I need to use. I’m hoping to turn this into something professional so don’...
New
logicmason
Hi there, I'm working through my first release with elixir/phoenix. I've built a release with distillery and found that it crashes when I...
New
myronmarston
The Elixir Typespec docs show the following syntax for keyword lists in typespecs: # ... | [key: type] # keyword lis...
New
rms.mrcs
Hi, I need to transform a list of numbers into a map where the keys are the indexes and the values are the original values of the list....
New
fayddelight
I tried installing elixir 1.11.2 erlang 23.3.4 via asdf in my zsh shell. Enabled the versions locally and globally. When I list them ...
New
belgoros
I’m not a pro in using Regex and can’t figure out why the following behaviour happens, especially if we take into account the difference ...
New
siddhant3030
Hi, I have to write a raw query for one of my project. But till now I have used ecto queries and don’t have much experience writing raw ...
New
vrod
I am using the Starship cross-shell prompt – it seems pretty nice, but I get some errors: [WARN] - (starship::utils): Executing command ...
New

Other popular topics Top

JDanielMartinez
Hi! May someone helps me, please! I have two apps into an umbrella project: the first one is Database, which manages queries, and the se...
New
Tee
can someone please explain to me how Enum.reduce works with maps
New
aalberti333
As the title describes, I’m trying to run Enum.map() over a list of key/value pairs, where the value is a map. My data looks like this: ...
New
sergio
I couldn’t find any guides that worked well with Phoenix 1.6.0 and esbuild. I hope this helps people test the waters and eases you into t...
New
polypush135
As many of you may have realized by now (sorry for all the posts here) I’ve been working on a db problem where I’m trying to aggregate a ...
New
script
If I have a string “1000 cfu/ml” . I want to remove the characters and / and space . So the string is like this "1000" What is the ...
New
danschultzer
None of the current solutions worked well for me, so I went ahead and built a user management system from scratch. This project took far...
548 27727 240
New
lucidguppy
I have a super simple question about elixir - how would I take a file like this foo bar baz and output a new file that enumerates th...
New
AstonJ
by Lance Halvorsen Elixir and Phoenix are generating tremendous excitement as an unbeatable platform for building modern web application...
460 27162 124
New
Nvim
Elixir appears to be a superior language to Python. I don’t see any advantage of Python over Elixir. Are there any?
New

We're in Beta

About us Mission Statement