sasa1977 / boundary

Manage and restrain cross-module dependencies in Elixir projects
MIT License
825 stars 22 forks source link

Wrong positive after 1.10.2 with incremental recompilation #64

Closed Miradorn closed 7 months ago

Miradorn commented 7 months ago

Hey and thanks for the library and all the work!

I think a bug might have snug into the latest version.

We're using Mox to implicitly define modules for tests, before we had them explicitly as part of a boundary, with the upgrade we did remove them (as expected).

This works great for the first run of mix compile but any subsequent incremental runs will fail with the mock modules being reported as not exported by its boundary.

reproduction steps:

run MIX_ENV=test COMPILE_BOUNDARY=true mix compile --force --warnings-as-errors , which succeeds, and directly after without any changes do MIX_ENV=test COMPILE_BOUNDARY=true mix compile --warnings-as-errors which fails.

sasa1977 commented 7 months ago

Thanks for the report. Do you have a link to the repo?

Miradorn commented 7 months ago

sorry, it's the private one from work Xx. I can try to setup a reproduction if I have time today 🙈

sasa1977 commented 7 months ago

Yes please, that would be very helpful

Miradorn commented 7 months ago

here you go: https://github.com/Miradorn/boundary_example Step 1: MIX_ENV=test mix compile --force -> suceeds Step 2: MIX_ENV=test mix compile fails

sasa1977 commented 7 months ago

Pushed the fix to master. Would you mind giving it a try on the real project, before I push the new version?

Miradorn commented 7 months ago

thanks, works beautifully!

sasa1977 commented 7 months ago

Pushed 0.10.3 to hex.