Skip to content

Accordingly mark top level optional dependencies from child deps #8035

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

Merged
merged 3 commits into from
Aug 4, 2018

Conversation

josevalim
Copy link
Member

Closes #7990

@josevalim
Copy link
Member Author

This should be backported and we should release v1.7.2.

@josevalim josevalim requested a review from ericmj August 3, 2018 12:48
# is still available means it has been fulfilled.
opts =
dep.opts
|> Keyword.drop(@child_keep_opts)
Copy link
Member

Choose a reason for hiding this comment

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

Is it correct to explicitly drop? I don't think we should remove the :runtime option unless it exist at a higher level for example.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, whatever is given upstream should be ignored. That's because we assume an implicit default of true. So even if downstream specifies false, the dependency still wants it to be true (because it requires it!)

Copy link
Member Author

Choose a reason for hiding this comment

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

I have pushed a new test to emphasize why the drop matters!

%{^app => child_opts} ->
# Only top level dependencies can be optional.
# Any non-top level dependency that is optional and
# is still available means it has been fulfilled.
Copy link
Member

Choose a reason for hiding this comment

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

The comment needs to be updated regarding :runtime.

Copy link
Member Author

Choose a reason for hiding this comment

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

Done!

Mix.Tasks.Deps.Compile.run([])
end)
end)
end
Copy link
Member

Choose a reason for hiding this comment

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

Great test 👏

@josevalim josevalim merged commit 84ab680 into master Aug 4, 2018
@josevalim
Copy link
Member Author

❤️ 💚 💙 💛 💜

@josevalim josevalim deleted the jv-mix-deps-optional branch August 4, 2018 12:08
josevalim added a commit that referenced this pull request Aug 4, 2018
Signed-off-by: José Valim <jose.valim@plataformatec.com.br>
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