jeremyjh / dialyxir

Mix tasks to simplify use of Dialyzer in Elixir projects.
Apache License 2.0
1.7k stars 140 forks source link

Elixir 1.15 #512

Closed danschultzer closed 1 year ago

danschultzer commented 1 year ago

Resolves #511

This uses Mix.ensure_application!/1 instead of Code.ensure_loaded?/1. This is similar to how missing erlang libraries are dealt with in other repos:

https://github.com/nccgroup/sobelow/pull/143 https://github.com/phoenixframework/tailwind/commit/68185c77c7f83c6b634cc7624b19633cb61b83d2

This PR also tests on Elixir 1.15 and OTP 26, but there are issues getting the tests to succeed. I'll see if I can get the tests to succeed.

danschultzer commented 1 year ago

@jeremyjh it would be helpful to me if you can approve the workflow so the CI can run. I have to switch in local right now to test between them.

jeremyjh commented 1 year ago

I changed the workflow settings so it shouldn't prompt again.

jonnystorm commented 1 year ago

@danschultzer FYI: I just got around to engaging those errors for my own project. For what it's worth, I cleaned up tests with this commit. Some additions are reasonable while others are clearly kludges, but none of the added requires, etc. are superfluous (that I can see), and none can be pushed down deeper into the dependency tree.

I plan to take a similar inventory of the various errors observed while running as an archive with mix, but feel free to take whatever is useful from the above and throw away the rest.

danschultzer commented 1 year ago

Thanks @jonnystorm! I noticed that the dialyxir load path disappears with certain test cases using :code.get_path, and this only happens after the Mix.Project.in_project calls. So I've set prune_code_paths: false on all fixtures.

This may break in the future and I would rather ensure that the Mix.Project.in_project callback doesn't cause the dialyxir path to be unloaded. I couldn't grok how to fix that. I guess all fixtures has to be updated to load the dialyxir dependency, but I couldn't get it to work properly.

@jeremyjh this should be ready for review!

elishagreenwald commented 1 year ago

Hi is there a plan to merge this soon? Wondering if I should explore a workaround / hold off on upgrading etc... any timelines would be super helpful. Thanks for all the great work folks!

jeremyjh commented 1 year ago

@danschultzer @elishagreenwald Hi guys, sorry to leave this languishing, I'd somehow missed it was complete. Been super busy lately. I have just a couple of small asks to change before we merge.