-
Notifications
You must be signed in to change notification settings - Fork 3.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
mix clean --deps does not clean out .erl files generated by yecc/leex #8262
Comments
I was checking the If so, I also notice that |
@ggcampinho unfortunately I'm not familiar with the codebase enough to definitely answer your questions (assuming they are for me :)), but from a common sense point of view it would be much better to use the same logic for the dependencies as for the project itself. Also, the dependencies might be built by something other than Mix, e.g. rebar, and probably should be cleaned using that as well to accommodate for custom scripts/hooks, so maybe the cleaning logic should mirror the dependency compilation. |
@ggcampinho yes, I think we need to traverse the deps but we need to be careful with some things:
As long as we have those in mind, we should be good. I would start with changing deps.clean and then we can figure out a way of changing |
I think a simple approach might be to change how the |
I am on this! |
Ok, I am not on this. I think the solution of changing the compiler is not going to fly. 🗡 We probably need to change deps.clean instead, as @ggcampinho first suggested. @ggcampinho are you planning to tackle this? |
Just reading through this thread, I gave it a go on removing those
how do we accomplish making sure the dependency is OK? Just thought I would try and give this a go! |
@drincruz right. We cannot hardcode the "src" directory because any dependency may have multiple compilers and any other directory can have compiled artefacts. It may be that the best way to solve this is to actually simplify the depending cleaning into two: "build" and "source" and it is always all or nothing, instead of being granular. |
@josevalim yeah, i figured it wouldn't have been as straight forward as i thought! i think i have a bit of free time before i get busy some again, so i'll try and take a look some more later! 👍 |
When cleaning with --deps flag, iterate over dependencies and remove generated .erl files. This feature was discussed in elixir-lang#8262.
Another suggestion given by @michalmuskala in #10153 is to emit the .beam files directly from .yrl/.xrl compilers. |
@michalmuskala I looked into your solution and it has complexities too. Namely, the .yrl and .xrl files may depend on other files as behaviours and parse transforms, and we would need to compile those first. It is hard for this to happen in practice but it is technically a limitation (and a backwards incompatible change).
|
Current behavior
When running
mix clean --deps
, the.erl
files generated from.xrl
/.yrl
are left behind.Expected behavior
All artefacts and intermediate files for the dependencies are deleted after running
mix clean --deps
, leaving the tree as it looked aftermix deps.get
, before the compilation.Steps to reproduce
I'll use Absinthe as an example dependency. I'm using a GitHub tag instead of Hex version, because the artefact pushed to Hex has the
.erl
files in question included for some reason (which might be a separate issue aroundmix hex.publish
that's outside of the scope for this bug report).mix new mix_bug && cd mix_bug
{:absinthe, git: "https://github.com/absinthe-graphql/absinthe.git", tag: "v1.4.13"}
to the list of deps.mix deps.get
.erl
files:mix compile && mix clean --deps
.erl
files should be gone after cleaning, but they are not:Environment
macOS Mojave 10.14
The text was updated successfully, but these errors were encountered: