tungd / elixir-dns

DNS library for Elixir
BSD 3-Clause "New" or "Revised" License
114 stars 37 forks source link

Fix master #34

Closed Fitblip closed 3 years ago

Fitblip commented 3 years ago

Hi there,

It seems that the master branch is broken, and was broken with #32. I went to implement a feature PR #24 but couldn't get things running without fixing this first!

Specifically I'm seeing this:

$ mix test
Compiling 6 files (.ex)

== Compilation error in file lib/dns/resource.ex ==
** (CompileError) lib/dns/resource.ex:25: DNS.ResourceOpt.__struct__/0 is undefined, cannot expand struct DNS.ResourceOpt. Make sure the struct name is correct. If the struct name exists and is correct but it still cannot be found, you likely have cyclic module usage in your code
    lib/dns/resource.ex:25: (module)

Which is also what has master failing on Travis https://travis-ci.org/github/tungd/elixir-dns/jobs/724809205#L229.

It looks like the PR that introduced this break doesn't actually include a DNS.ResourceOpt module, so I added one, and moved it into its own struct at the bottom of resource.ex. I believe that's what @pzingg was going for and things should now be happy but I'm not 100% sure - @pzingg can you help confirm?

Fitblip commented 3 years ago

Closing in favor of #36

pzingg commented 3 years ago

I submitted PR #37 that contains the code I had sitting on my local repository. Use it if you need it, otherwise close it. I apologize for not getting this file into #32.