-
-
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
Clean built artifacts after building extensions #6133
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.
I like these simplifications a lot, just wanted to add that there might be a secondary bug that was hidden by the build artifacts.
That is: when bundle install a git sourced gem, it adds some non-existing paths to the load path, I've added a check for that on Bundler::Runtime#setup
breaking multiple escenarios.
The problem is that I'm not entirely sure how rubygems and bundler interact when building extensions on git sourced gems.
Hope my comments help somehow.
0afebd2
to
20e84f6
Compare
Yeah, building extensions for git gems is a big hack at the moment, and it indeed has the consequence of some paths to be added to the We should refactoring things further to just be able to |
Some tests check that the shared objects are actually installed, but checking an intermediate build file instead of the installed one.
The installed file not always have the `.so` extension. Co-authored-by: Eloy Espinaco <eloyesp@gmail.com>
20e84f6
to
98b6a95
Compare
After investigating the issues here, I think this is safe to do. I could only see this breaking if someone is intentionally changing the So from my side this is ready. |
Just one more question, will this impact bundler installs? Is bundler installing gems using the |
Yes, Bundler delegates to RubyGems to install extensions, so it will use whatever builder each gem uses. If gems define their extension through an |
Thanks for digging in this @deivid-rodriguez. I did other review of the build artifact handling. I agree this seems safe. I did quick test to see impact on sassc issue sass/sassc-ruby#200 and bundle size went from 65MB to 25MB. |
Thanks @eloyesp for pushing this forward! |
RubyGems started to clean built artifacts after building extensions since Ruby 3.2.0: rubygems/rubygems#6133 Related: rubygems/rubygems#6205
RubyGems cleans built artifacts after building extensions since 3.4.0: rubygems/rubygems#6133 Therefore cld3-ruby now needs to refer the installed binary instead of the binary at the build directory.
Hi 👋 Running |
|
@simi thanks, I should have linked to ohler55/ox#303 (it's still broken on macOS) |
@lipidity No. It works. Please confirm my comment |
I was wrong about ox still being broken. Confirmed that it works. |
to support rubygems 3.4.0 ref: rubygems/rubygems#6133
to support rubygems 3.4.0 ref: rubygems/rubygems#6133
to support rubygems 3.4.0 ref: rubygems/rubygems#6133
What was the end-user or developer problem that led to this PR?
Currently installing extensions leaves around intermediary files that may end up taking a lot of disk space.
What is your fix for the problem, implemented in this PR?
Add a clean step after installing the extension.
This PR is based on the useful work by @eloyesp at #4017.
Fixes #3958.
Make sure the following tasks are checked