Skip to content
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

Deep clean the .erl files generated by yecc/leex. #10153

Closed

Conversation

vgsantoniazzi
Copy link

When cleaning with --deps flag, iterate over dependencies and remove generated .erl files.

This feature was discussed in #8262.

@vgsantoniazzi vgsantoniazzi force-pushed the deep-clean-build-deps branch from b35a79e to e78c866 Compare July 4, 2020 19:21
When cleaning with --deps flag, iterate over dependencies and remove generated .erl files.

This feature was discussed in elixir-lang#8262.
@vgsantoniazzi vgsantoniazzi force-pushed the deep-clean-build-deps branch from e78c866 to 032da45 Compare July 4, 2020 19:47
deps_paths =
Mix.Project.deps_paths()
|> Map.values()
|> Enum.map(&Path.join(&1, "**/*.erl"))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately we cannot simply remove all .erl files because we will remove source files for many erlang projects, that have .erl files in their deps. The implementation of this functionality needs to be tied to the Mix.Task.Compiler behaviour and it is likely quite more complex than this. :(

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

An alternative could be to modify the compilers that output the .erl files either not to do that at all, our output them inside _build.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about removing .erl files that have their uncompiled version?

If the only way that you saw is going through the Mix.Task.Compiler I can try to do this.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@michalmuskala I tried that back then but unfortunately I ran into major issues, I don't recall them right now. Modifying the compilers to not output the .erl files actually sounds great. It solves the problem altogether.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, it will also be a fair bit of work, unfortunately. There are some limitations of the yecc and leex compilers themselves to work around to do this

@vgsantoniazzi
Copy link
Author

Ok, based on the comments, this PR should not be forward. Thanks for reviewing it.

@vgsantoniazzi vgsantoniazzi deleted the deep-clean-build-deps branch September 6, 2021 20:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants