-
Notifications
You must be signed in to change notification settings - Fork 184
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
Populate managers when checking out dep #426
Conversation
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.
😍
Thanks @wojtekmach! The issue is that returning the lock was done by design: #372 (comment) deps.get should not change the lock and this change would cause the lock to be modified. Is there any reason why the manager is not set on the lock returned by the remote converger? |
If computing the managers in the converger is a big change, one alternative is to check if the lock in |
We can't compute the the managers in the converger because the dependency is not fetched yet and this information is only in the package metadata. I like @josevalim's idea, I think we can set the managers to |
sounds good. I can work on this next week (feel free to pick it up in the meantime) |
Fixes elixir-lang/elixir#6570 Regression was introduced in #372
2ae11c0
to
9c31ea7
Compare
Ok, I reverted the change and working on a different approach. I was able to manually reproduce the issue with my previous change where
So yes, with f7e936c |
Okay, I think this is ready for a 2nd pass. I tried making the change in the converger but I got stuck. Anyhow, pattern matching on |
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.
Thanks for investigating. Build tools should always be non-empty so this looks good.
update(opts) | ||
opts[:lock] | ||
updated_lock = update(opts) | ||
maybe_use_updated_lock(opts[:lock], updated_lock) |
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.
Just leave a comment here about why we need this weirdness.
lib/hex/scm.ex
Outdated
end | ||
|
||
defp maybe_use_updated_lock({:hex, _, _, _, [], _, _}, updated_lock), do: updated_lock | ||
defp maybe_use_updated_lock(old_lock, _updated_lock), do: old_lock |
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.
Do the pattern match here also, so we don't automatically fall through if we forget to update when we change the lock format.
defp maybe_use_updated_lock({:hex, _, _, _, [] = _managers, _, _}, updated_lock), do: updated_lock
defp maybe_use_updated_lock({:hex, _, _, _, _managers, _, _} = old_lock, _updated_lock), do: old_lock
@ericmj fyi: I got a crash when testing on https://github.com/wojtekmach/shipit. Will fix in a day or two.
|
👍 Use |
Fixes elixir-lang/elixir#6570
Regression was introduced in #372
cc @josevalim