-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Stop bundler eagerly loading all specs with exts #6945
Stop bundler eagerly loading all specs with exts #6945
Conversation
We were setting the wrong `extension_dir` for git specs stubs Additionally, the call to `self.extension_dir` was loading the remote spec, which was avoidable since the stub had an extension dir (and in fact its #gem_build_complete_path does exactly what we want anyway) Finally, now set the base_dir when loading the remote_spec from a stub specification, since the git source sets the base dir for stubs based on where the spec _will_ be installed to, and we want to preserve that so the base_dir for the loaded spec & the stub are the same
e1833cf
to
a94acb4
Compare
…ng-specs-with-extensions Stop bundler eagerly loading all specs with exts (cherry picked from commit 1549d5e)
…ng-specs-with-extensions Stop bundler eagerly loading all specs with exts (cherry picked from commit 1549d5e)
…ng-specs-with-extensions Stop bundler eagerly loading all specs with exts (cherry picked from commit 1549d5e)
…ng-specs-with-extensions Stop bundler eagerly loading all specs with exts (cherry picked from commit 1549d5e)
For universal rubies, the change to The problem arise when in bundler, we replace the 'universal' part of So, we install native extensions to 'extensions/universal-darwin-22/', but finding them in 'extensions/x86_64-darwin-22/'. Leading to native extension gems can never be installed on universal ruby. |
Since rubygems#6945 the extension dir changed to Gem::BasicSpecification's implementation, we didn't hook that in rubygems_ext.rb. So for universal rubies, we ended up using the universal platform name when installing, but arch replaced platform name when checking. This lead to native extensions can never be correctly installed on universal rubies. Hook Gem::BasicSpecifications so the behavior is consistent on installing and checking.
Since rubygems#6945 the extension dir changed to Gem::BasicSpecification's implementation, we didn't hook that in rubygems_ext.rb. So for universal rubies, we ended up using the universal platform name when installing, but arch replaced platform name when checking. This lead to native extensions can never be correctly installed on universal rubies. Hook Gem::BasicSpecifications so the behavior is consistent on installing and checking.
Since rubygems#6945 the extension dir changed to Gem::BasicSpecification's implementation, we didn't hook that in rubygems_ext.rb. So for universal rubies, we ended up using the universal platform name when installing, but arch replaced platform name when checking. This lead to native extensions can never be correctly installed on universal rubies. Hook Gem::BasicSpecifications so the behavior is consistent on installing and checking.
Since rubygems#6945 the extension dir changed to Gem::BasicSpecification's implementation, we didn't hook that in rubygems_ext.rb. So for universal rubies, we ended up using the universal platform name when installing, but arch replaced platform name when checking. This lead to native extensions can never be correctly installed on universal rubies. Hook Gem::BasicSpecifications so the behavior is consistent on installing and checking.
Since rubygems#6945 the extension dir changed to Gem::BasicSpecification's implementation, we didn't hook that in rubygems_ext.rb. So for universal rubies, we ended up using the universal platform name when installing, but arch replaced platform name when checking. This lead to native extensions can never be correctly installed on universal rubies. Hook Gem::BasicSpecifications so the behavior is consistent on installing and checking.
Since rubygems#6945 the extension dir changed to Gem::BasicSpecification's implementation, we didn't hook that in rubygems_ext.rb. So for universal rubies, we ended up using the universal platform name when installing, but arch replaced platform name when checking. This lead to native extensions can never be correctly installed on universal rubies. Hook Gem::BasicSpecifications so the behavior is consistent on installing and checking.
Since rubygems#6945 the extension dir changed to Gem::BasicSpecification's implementation, we didn't hook that in rubygems_ext.rb. So for universal rubies, we ended up using the universal platform name when installing, but arch replaced platform name when checking. This lead to native extensions can never be correctly installed on universal rubies. Hook Gem::BasicSpecifications so the behavior is consistent on installing and checking.
Since rubygems#6945 the extension dir changed to Gem::BasicSpecification's implementation, we didn't hook that in rubygems_ext.rb. So for universal rubies, we ended up using the universal platform name when installing, but arch replaced platform name when checking. This lead to native extensions can never be correctly installed on universal rubies. Hook Gem::BasicSpecifications so the behavior is consistent on installing and checking.
Since rubygems#6945 the extension dir changed to Gem::BasicSpecification's implementation, we didn't hook that in rubygems_ext.rb. So for universal rubies, we ended up using the universal platform name when installing, but arch replaced platform name when checking. This lead to native extensions can never be correctly installed on universal rubies. Hook Gem::BasicSpecifications so the behavior is consistent on installing and checking.
Since rubygems#6945 the extension dir changed to Gem::BasicSpecification's implementation, we didn't hook that in rubygems_ext.rb. So for universal rubies, we ended up using the universal platform name when installing, but arch replaced platform name when checking. This lead to native extensions can never be correctly installed on universal rubies. Hook Gem::BasicSpecifications so the behavior is consistent on installing and checking.
We were setting the wrong
extension_dir
for git specs stubsAdditionally, the call to
self.extension_dir
was loading the remote spec, which was avoidable since the stub had an extension dir (and in fact its #gem_build_complete_path does exactly what we want anyway)Finally, now set the base_dir when loading the remote_spec from a stub specification, since the git source sets the base dir for stubs based on where the spec will be installed to, and we want to preserve that so the base_dir for the loaded spec & the stub are the same
What was the end-user or developer problem that led to this PR?
Bundler was eagerly loading all gemspecs that had extensions in their stubs
What is your fix for the problem, implemented in this PR?
Avoid calling methods that force loading the remote spec inside of
#missing_extensions?
Make sure the following tasks are checked