-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
Conversation
This should be backported and we should release v1.7.2. |
lib/mix/lib/mix/dep.ex
Outdated
# is still available means it has been fulfilled. | ||
opts = | ||
dep.opts | ||
|> Keyword.drop(@child_keep_opts) |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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!)
There was a problem hiding this comment.
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!
lib/mix/lib/mix/dep.ex
Outdated
%{^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. |
There was a problem hiding this comment.
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
.
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great test 👏
❤️ 💚 💙 💛 💜 |
Signed-off-by: José Valim <jose.valim@plataformatec.com.br>
Closes #7990