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

recompile only if new option effects code generation #1584

Merged
merged 1 commit into from
Jul 13, 2017

Conversation

tsloughter
Copy link
Collaborator

This was technically an issue before OTP20 but the changes here https://github.com/erlang/otp/pull/1367/files#diff-7a0a8b020276e896d2ae816ccfcfe62eL1481 resulted it modules being recompiled on every run with no changes by the user.

The issue is Erlang does not store all options in the beam chunks, before this was not noticed because the ones it leaves out are not commonly used. With the above changes this was always the case because rebar3 adds an {outdir, ...} option. So when comparing the past compilation options to the new it would find they have changed and recompile every module.

This patch instead checks that any of the new options are those considered to effect compilation by Erlang and only then is the module recompiled.

In my opinion warnings_as_errors should be removed from the list and the function should be exported by compile but that is an issue to be taken up with a PR to OTP.

@ferd
Copy link
Collaborator

ferd commented Jul 13, 2017

Nice, +1 when tests pass (if CI is fixed now?)

@ferd ferd merged commit 2326ad0 into erlang:master Jul 13, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants