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 specific_platform and cache_all with bundle cache --all-platforms #4022

Merged
merged 7 commits into from Oct 22, 2020

Conversation

deivid-rodriguez
Copy link
Member

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

If using the specific_platform and cache_all setting, it is expected that git gems will be cached.

However, enabling specific_platform causes bundler to look only for platform specific versions of the gemspec in the git source, which is something that hardly ever happens.

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

Specially case this situation so that the git gem is properly cached in this case.

Fixes #3361.

Make sure he following tasks are checked

Since this logic runs before every test and it's quite heavy, an easy
improvement was to split these two different cases. This test file runs
now on my machine in 18 seconds vs the previous 24 seconds.
Commit to source control changes it creates.
So that bundling under Windows doesn't create source control changes,
and so that the resolution is deterministic every bundler developer
running on Windows.
So that working on my environment in bundler 3 mode doesn't generate
source control changes either.
When using the `cache_all` setting, git gems are also cached. Also, when
using `--all-platforms`, gems for all platforms should be cached. Since
`git` gems supporting multiple platforms usually provide a single
gemspec, we need to special case that, otherwise the versions of the git
gems for platforms different than the running one wouldn't be found
because the gemspec would've been evaluated only for the current
platform.
@deivid-rodriguez deivid-rodriguez force-pushed the fix_package_all_specific_platform_issue branch from 0b4defd to 127e56e Compare October 20, 2020 12:00
@deivid-rodriguez deivid-rodriguez merged commit 1f70226 into master Oct 22, 2020
@deivid-rodriguez deivid-rodriguez deleted the fix_package_all_specific_platform_issue branch October 22, 2020 10:22
deivid-rodriguez added a commit that referenced this pull request Dec 7, 2020
…orm_issue

Fix `specific_platform` and `cache_all` with `bundle cache --all-platforms`

(cherry picked from commit 1f70226)
deivid-rodriguez added a commit that referenced this pull request Dec 7, 2020
…orm_issue

Fix `specific_platform` and `cache_all` with `bundle cache --all-platforms`

(cherry picked from commit 1f70226)
deivid-rodriguez added a commit that referenced this pull request Dec 7, 2020
…orm_issue

Fix `specific_platform` and `cache_all` with `bundle cache --all-platforms`

(cherry picked from commit 1f70226)
deivid-rodriguez added a commit that referenced this pull request Dec 7, 2020
…orm_issue

Fix `specific_platform` and `cache_all` with `bundle cache --all-platforms`

(cherry picked from commit 1f70226)
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.

bundle package: Could not find <GEM> in any of the sources
2 participants