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

Fix platform issues when running under a frozen bundle #3909

Merged
merged 6 commits into from
Sep 3, 2020

Conversation

deivid-rodriguez
Copy link
Member

@deivid-rodriguez deivid-rodriguez commented Aug 27, 2020

What was the end-user or developer problem that led to this PR?

In the case of running under jruby, on a frozen bundle, and against a lockfile only including the ruby platform, expand_dependencies would end up filtering out all dependencies, causing errors.

The reason is that on a frozen bundle, the local platform is not added to the array of definition platforms, since only platform information from the lockfile should be used. That means that under the previous logic, expand_dependencies would filter out everything.

What is your fix for the problem, implemented in this PR?

The solution is to make sure to always at least expand all dependencies with the local platform.

Note that it should still be preferred to "unfreeze" the application, and rebundle using jruby, so that platform specific dependencies are picked up. But if the desired to use only pure ruby versions of dependencies, this changes gets that case working too without weird errors.

Fixes #3874.

Tasks:

  • Describe the problem / feature
  • Write tests
  • Write code to solve the problem
  • Get code review from coworkers / friends

I will abide by the code of conduct.

In the case of running under jruby, on a frozen bundle, and against a
lockfile only including the ruby platform, `expand_dependencies` would
end up filtering out all dependencies, causing errors.

The reason is that on a frozen bundle, the local platform is not added
to the array of definition platforms, since only platform information
from the lockfile should be used. That means that under the previous
logic, `expand_dependencies` would filter out everything.

The solution is to make sure to always _at least_ expand all
dependencies with the local platform.
@deivid-rodriguez
Copy link
Member Author

I'll merge this. @headius if you have time to verify the fix, try out the default branch and we can address any issues post-merge.

@deivid-rodriguez deivid-rodriguez merged commit 0ab446f into master Sep 3, 2020
@deivid-rodriguez deivid-rodriguez deleted the platform_issues branch September 3, 2020 21:22
deivid-rodriguez added a commit that referenced this pull request Oct 5, 2020
Fix platform issues when running under a frozen bundle

(cherry picked from commit 0ab446f)
deivid-rodriguez added a commit that referenced this pull request Oct 5, 2020
Fix platform issues when running under a frozen bundle

(cherry picked from commit 0ab446f)
deivid-rodriguez added a commit that referenced this pull request Oct 5, 2020
Fix platform issues when running under a frozen bundle

(cherry picked from commit 0ab446f)
deivid-rodriguez added a commit that referenced this pull request Oct 6, 2020
Fix platform issues when running under a frozen bundle

(cherry picked from commit 0ab446f)
deivid-rodriguez added a commit that referenced this pull request Oct 6, 2020
Fix platform issues when running under a frozen bundle

(cherry picked from commit 0ab446f)
deivid-rodriguez added a commit that referenced this pull request Oct 6, 2020
Fix platform issues when running under a frozen bundle

(cherry picked from commit 0ab446f)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bundler local filters out all "ruby" platform gems on JRuby
2 participants