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

Avoid clone same repo for Git gems #109

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

JuanitoFatas
Copy link
Collaborator

@JuanitoFatas JuanitoFatas commented Mar 25, 2020

When an application installs rails master, it clones rails for 12 times. By storing Rails‘s subgems under the same name "rails" in the pending queue. We can avoid clone rails gems multiple times.

Tested Gemfile
source "https://rubygems.org"

ruby "2.7.0"

gem "rails", git: "https://github.com/rails/rails.git"
gem 'bootsnap', require: false
gem "sprockets", git: "https://github.com/rails/sprockets.git"
gem "sprockets-rails", git: "https://github.com/rails/sprockets-rails.git"
gem "pg", "~> 1.2"
gem "slim-rails"
gem "sass-rails", "~> 6.0"
gem "uglifier", ">= 1.3.0"
gem "turbolinks", "~> 5"
gem "lograge"
gem "html-pipeline"
gem "commonmarker"
gem "sanitize"
gem "twemoji"
gem "rouge"
gem "secure_headers"
gem "title", git: "https://github.com/calebthompson/title.git"
gem "rack-rewrite"
gem "hiredis"
gem "redis", require: ["redis", "redis/connection/hiredis"]
gem "gemoji"
gem "nokogiri", ">= 1.7.1"
gem "attr_extras"
gem "rack-timeout", require: "rack/timeout/base"
gem "mail", git: "https://github.com/juanitofatas/mail.git", branch: "pr-1343-ragel-bitmap"
gem "barnes"
gem "thor", ">= 1.0.0"
gem "coffee-rails" # because rails-ujs is written in coffee script.
gem "i18n"
gem "json", ">= 2.3.0"
gem "puma"
gem "puma_worker_killer"

group :production do
  gem "rails_12factor"
end

group :development, :test do
  gem "dotenv-rails", git: "https://github.com/juanitofatas/dotenv.git", branch: "support-rails-61"
  gem "pry-rails"
  gem "rspec-rails"
  gem "listen", "~> 3.2.1"
end

group :development do
  gem "rack-mini-profiler"
  gem "octokit"
  gem "spring"
  gem "spring-watcher-listen", "~> 2.0.0"
  gem "memory_profiler"
  gem "httpx"
end

group :test do
  gem "database_rewinder", git: "https://github.com/juanitofatas/database_rewinder.git", branch: "rails62/db-config"
  gem "factory_bot_rails"
  gem "shoulda-matchers"
  gem "webmock"
  gem "launchy"
  gem "capybara"
  gem "webdrivers"
end

Results tested this PR against 00ca7aa

  • gel install should not clone same repo twice
gel install without Gemfile.lock should print all rails gems
Fetching sources...........
Resolving dependencies............
Writing lockfile to /Users/fengdi/dev/JuanitoFatas/Gemfile.lock
Installing zeitwerk (2.3.0)
Installing mini_portile2 (2.4.0)
Installing minitest (5.14.0)
Installing i18n (1.8.2)
Installing tzinfo (2.0.2)
Installing crass (1.0.6)
Installing rails-dom-testing (2.0.3)
Installing loofah (2.4.0)
Installing rack (2.2.2)
Installing rails-html-sanitizer (1.3.0)
Installing builder (3.2.4)
Installing concurrent-ruby (1.1.6)
Installing erubi (1.9.0)
Installing globalid (0.4.2)
Installing rack-test (1.1.0)
Installing method_source (1.0.0)
Installing marcel (0.3.3)
Installing thor (1.0.1)
Installing rake (13.0.1)
Using sprockets (git)
Installing mini_mime (1.0.2)
Installing ragel-bitmap (0.2.1)
Using mail (git)
Installing rspec-support (3.9.2)
Installing addressable (2.7.0)
Installing mimemagic (0.3.4)
Using sprockets-rails (git)
Installing websocket-extensions (0.1.4)
Installing public_suffix (4.0.3)
Installing multipart-post (2.1.1)
Installing diff-lcs (1.3)
Installing tilt (2.0.10)
Installing execjs (2.7.0)
Installing rubyzip (2.3.0)
Installing coffee-script-source (1.12.2)
Installing rb-inotify (0.10.1)
Installing childprocess (3.0.0)
Installing faraday (1.0.1)
Using actioncable (git)
Using actionmailbox (git)
Using actionmailer (git)
Using actionpack (git)
Using actiontext (git)
Using actionview (git)
Using activejob (git)
Using activemodel (git)
Using activerecord (git)
Using activestorage (git)
Using activesupport (git)
Using rails (git)
Using railties (git)
Installing rb-fsevent (0.10.3)
Installing coderay (1.1.2)
Installing safe_yaml (1.0.5)
Using dotenv (git)
Using dotenv-rails (git)
Installing temple (0.8.2)
Installing http-2-next (0.2.6)
Installing coffee-script (2.4.1)
Installing request_store (1.5.0)
Installing spring (2.1.0)
Installing sawyer (0.8.2)
Installing websocket-driver (0.7.1)
Installing slim (4.0.1)
Installing regexp_parser (1.7.0)
Installing rails_stdout_logging (0.0.5)
Installing html-pipeline (2.12.3)
Installing crack (0.4.3)
Installing pry (0.13.0)
[Downloading: sassc-rails rails_serve_static_assets hashdiff get_process_mem ffi selenium-webdriver +52;   Compiling: msgpack nio4r nokogiri +                                                                                                                                              [Downloading: sassc-rails rails_serve_static_assets hashdiff get_process_mem ffi selenium-webdriver +52;   Compiling: msgpack nio4r nokogiri +                                                                                                                                              [Downloading: sassc-rails rails_serve_static_assets hashdiff get_process_mem ffi selenium-webdriver +52;   Compiling: msgpack nio4r nokogiri +                                                                                                                                              Installing hashdiff (1.0.1)
[Downloading: sassc-rails rails_serve_static_assets ruby-enum get_process_mem ffi selenium-webdriver +51;   Compiling: msgpack nio4r nokogiri                                                                                                                                               [Downloading: sassc-rails rails_serve_static_assets ruby-enum get_process_mem ffi selenium-webdriver +51;   Compiling: msgpack nio4r nokogiri                                                                                                                                               Installing get_process_mem (0.2.5)
Installing ruby-enum (0.8.0)
Installing sassc-rails (2.1.2)
[Downloading: rspec-core rails_serve_static_assets rspec-mocks listen rspec-expectations selenium-webdriver +47;   Compiling: msgpack nio4r ff                                                                                                                                              [Downloading: rspec-core rails_serve_static_assets rspec-mocks listen rspec-expectations selenium-webdriver +47;   Compiling: msgpack nio4r ff                                                                                                                                              Installing listen (3.2.1)
[Downloading: rspec-core rails_serve_static_assets rspec-mocks nokogumbo rspec-expectations selenium-webdriver +46;   Compiling: msgpack nio4r                                                                                                                                              Installing rails_serve_static_assets (0.0.5)
Installing rspec-mocks (3.9.1)
Installing rspec-expectations (3.9.1)
Installing multi_json (1.14.1)
Installing selenium-webdriver (3.142.7)
Installing rspec-core (3.9.1)
Installing turbolinks-source (5.2.0)
Installing statsd-ruby (1.4.0)
Installing timers (4.3.0)
Installing factory_bot (5.1.2)
Installing memory_profiler (0.9.14)
Installing xpath (3.2.0)
Installing redis (4.1.3)
Installing httpx (0.7.0)
Installing launchy (2.5.0)
Using database_rewinder (git)
Installing sanitize (5.1.0)
Installing octokit (4.18.0)
Installing attr_extras (6.2.3)
Installing webmock (3.8.3)
Installing rspec-rails (4.0.0)
Installing pry-rails (0.3.9)
Installing sass-rails (6.0.0)
Installing puma_worker_killer (0.1.1)
Installing lograge (0.11.2)
Installing rack-mini-profiler (2.0.1)
Installing rack-rewrite (1.5.1)
Installing secure_headers (6.3.0)
Installing capybara (3.32.0)
Installing barnes (0.0.8)
Installing shoulda-matchers (4.3.0)
Installing slim-rails (3.2.0)
[Downloading: coffee-rails rouge spring-watcher-listen rack-timeout factory_bot_rails commonmarker +9;   Compiling: msgpack nio4r ffi nokogiri                                                                                                                                              Installing spring-watcher-listen (2.0.1)
Installing factory_bot_rails (5.1.1)
Installing rack-timeout (0.6.0)
Installing coffee-rails (5.0.0)
Installing turbolinks (5.2.1)
Using title (git)
Installing twemoji (3.1.6)
Installing html-pipeline-ruby_markup (0.9.2)
Installing webdrivers (4.2.0)
Installing rouge (3.17.0)
Installing rails_12factor (0.0.3)
Installing uglifier (4.2.0)
Installing gemoji (3.0.1)
Installing nio4r (2.5.2)
Installing msgpack (1.3.3)
Installing bootsnap (1.4.6)
Installing puma (4.3.3)
Installing hiredis (0.6.3)
Installing commonmarker (0.21.0)
Installing json (2.3.0)
Installing pg (1.2.3)
Installing ffi (1.12.2)
Installing nokogiri (1.10.9)
Installing sassc (2.2.1)
Installing nokogumbo (2.0.2)
Installed 118 gems
gel install with Gemfile.lock should print all rails gems
Installing zeitwerk (2.3.0)
Installing mini_portile2 (2.4.0)
Installing minitest (5.14.0)
Installing i18n (1.8.2)
Installing tzinfo (2.0.2)
Installing rails-dom-testing (2.0.3)
Installing crass (1.0.6)
Installing loofah (2.4.0)
Installing rails-html-sanitizer (1.3.0)
Installing builder (3.2.4)
Installing erubi (1.9.0)
Installing rack (2.2.2)
Installing concurrent-ruby (1.1.6)
Installing rack-test (1.1.0)
Installing globalid (0.4.2)
Installing method_source (1.0.0)
Installing marcel (0.3.3)
Installing thor (1.0.1)
Installing rake (13.0.1)
Installing mini_mime (1.0.2)
Installing ragel-bitmap (0.2.1)
Installing rspec-support (3.9.2)
Installing mimemagic (0.3.4)
Installing public_suffix (4.0.3)
Installing addressable (2.7.0)
Installing websocket-extensions (0.1.4)
Installing multipart-post (2.1.1)
Installing tilt (2.0.10)
Installing diff-lcs (1.3)
Installing rubyzip (2.3.0)
Installing execjs (2.7.0)
Installing coffee-script-source (1.12.2)
Installing faraday (1.0.1)
Installing rb-inotify (0.10.1)
Installing coderay (1.1.2)
Installing childprocess (3.0.0)
Installing rb-fsevent (0.10.3)
Installing safe_yaml (1.0.5)
Installing temple (0.8.2)
Installing http-2-next (0.2.6)
Installing request_store (1.5.0)
Installing spring (2.1.0)
Installing coffee-script (2.4.1)
Installing slim (4.0.1)
Installing regexp_parser (1.7.0)
Installing sawyer (0.8.2)
Installing crack (0.4.3)
Installing pry (0.13.0)
Installing rails_stdout_logging (0.0.5)
[Downloading: sprockets rails_serve_static_assets sprockets-rails dotenv actioncable mail +57;   Compiling: nio4r nokogiri ffi websocket-drive                                                                                                                                              Installing rails_serve_static_assets (0.0.5)
Using sprockets-rails (git)
Installing html-pipeline (2.12.3)
Installing hashdiff (1.0.1)
Installing selenium-webdriver (3.142.7)
Installing sassc-rails (2.1.2)
Installing get_process_mem (0.2.5)
Installing listen (3.2.1)
Installing ruby-enum (0.8.0)
Installing rspec-mocks (3.9.1)
Installing rspec-core (3.9.1)
Installing rspec-expectations (3.9.1)
Installing websocket-driver (0.7.1)
Using dotenv (git)
Using dotenv-rails (git)
Using mail (git)
Installing multi_json (1.14.1)
Using sprockets (git)
Installing factory_bot (5.1.2)
Installing statsd-ruby (1.4.0)
Installing xpath (3.2.0)
Installing turbolinks-source (5.2.0)
Installing timers (4.3.0)
Installing redis (4.1.3)
Installing memory_profiler (0.9.14)
Installing httpx (0.7.0)
Installing webmock (3.8.3)
Installing octokit (4.18.0)
Installing launchy (2.5.0)
Installing sanitize (5.1.0)
Installing rspec-rails (4.0.0)
Installing pry-rails (0.3.9)
Installing attr_extras (6.2.3)
Installing sass-rails (6.0.0)
[Downloading: database_rewinder rack-mini-profiler rouge puma_worker_killer actioncable capybara +21;   Compiling: nio4r nokogiri ffi msgpack                                                                                                                                               Installing puma_worker_killer (0.1.1)
Installing capybara (3.32.0)
Installing rack-mini-profiler (2.0.1)
Installing secure_headers (6.3.0)
Installing rouge (3.17.0)
Installing lograge (0.11.2)
[Downloading: database_rewinder shoulda-matchers slim-rails rack-rewrite actioncable commonmarker +15;   Compiling: nio4r nokogiri ffi msgpack                                                                                                                                              Installing rack-rewrite (1.5.1)
Installing barnes (0.0.8)
Installing slim-rails (3.2.0)
[Downloading: database_rewinder shoulda-matchers rack-timeout bootsnap actioncable commonmarker +12;   Compiling: nio4r nokogiri ffi msgpack +                                                                                                                                              Installing shoulda-matchers (4.3.0)
[Downloading: database_rewinder factory_bot_rails rack-timeout bootsnap actioncable commonmarker +11;   Compiling: nio4r nokogiri ffi msgpack                                                                                                                                               [Downloading: database_rewinder factory_bot_rails rack-timeout spring-watcher-listen actioncable commonmarker +10;   Compiling: nio4r nokogiri                                                                                                                                              Installing rack-timeout (0.6.0)
[Downloading: database_rewinder factory_bot_rails coffee-rails spring-watcher-listen actioncable commonmarker +9;   Compiling: nio4r nokogiri                                                                                                                                               Installing spring-watcher-listen (2.0.1)
[Downloading: database_rewinder factory_bot_rails coffee-rails turbolinks actioncable commonmarker +8;   Compiling: nio4r nokogiri ffi msgpack                                                                                                                                              Installing factory_bot_rails (5.1.1)
Installing turbolinks (5.2.1)
Installing coffee-rails (5.0.0)
Installing twemoji (3.1.6)
Installing uglifier (4.2.0)
[Downloading: database_rewinder rails_12factor webdrivers title actioncable html-pipeline-ruby_markup +1;   Compiling: nio4r nokogiri ffi msgp                                                                                                                                              Installing webdrivers (4.2.0)
Installing html-pipeline-ruby_markup (0.9.2)
Installing rails_12factor (0.0.3)
Installing gemoji (3.0.1)
Using database_rewinder (git)
Installing nio4r (2.5.2)
Using title (git)
Installing msgpack (1.3.3)
Installing bootsnap (1.4.6)
Installing puma (4.3.3)
Installing hiredis (0.6.3)
Installing json (2.3.0)
Installing commonmarker (0.21.0)
Installing pg (1.2.3)
Installing ffi (1.12.2)
Using actioncable (git)
Using actionmailbox (git)
Using actionmailer (git)
Using actionpack (git)
Using actiontext (git)
Using actionview (git)
Using activejob (git)
Using activemodel (git)
Using activerecord (git)
Using activestorage (git)
Using activesupport (git)
Using rails (git)
Using railties (git)
Installing nokogiri (1.10.9)
Installing nokogumbo (2.0.2)
Installing sassc (2.2.1)
Installed 118 gems

When a Gemfile installs rails master, it clones rails for
12 times. By storing Rails‘s subgems in the pending queue under the same name "rails". We can avoid clone rails gems
multiple times.
lib/gel/git_gems_manager.rb Outdated Show resolved Hide resolved
lib/gel/installer.rb Show resolved Hide resolved
@kaspth
Copy link
Collaborator

kaspth commented Mar 28, 2020

After: gel install 354s (this PR)

Wow, that sounds pretty slow still! Curious if there's any other leads as to why this grinds?

@matthewd
Copy link
Member

This is a nice find! I had at one point suspected this was happening, but then failed to prove it.

As @kaspth mentioned, it feels a bit awkward to maintain a hard-coded list of multi-gem repos. I think we could instead use a hash (as an instance variable inside Installer), to keep track of whether we've already seen remote+revision: we don't need to know which gem is canonical, only that one has already started the clone.

Use a hash to keep track of whether we've already checked out a repo by remote+revision.
@JuanitoFatas
Copy link
Collaborator Author

Thanks @kaspth and @matthewd for your reviews!! I updated the PR to check if we already clone a given remote + revision as suggested ☺️ I‘m struggling writing a test for this... 😓

Wow, that sounds pretty slow still! Curious if there's any other leads as to why this grinds?

Sorry this was my mistake. The 354s was from time‘s output for user. The total time for human is about 3 minutes 😅 Which is great because it had to clone many repos (rails, database_rewinder, dotenv, title, mail, sprockets-rails, sprockets) and compile many gems with native extensions (hiredis, msgpack, bootsnap, nio4r, websocket-driver, commonmarker, nokogiri, pg, ffi, sassc, nokogiri, nokogumbo, sassc, json, puma).

I also tried with fresh bundle install and it took about 5 minutes.

bundle install --redownload  236.46s user 65.73s system 84% cpu 5:58.06 total
rm -rf ~/.local/gel ~/.cache/gel ~/.config/gel && gel install 359.42s user 89.76s system 229% cpu 3:15.50 total

.. and then show them all in the "Using" message, too.
@matthewd
Copy link
Member

matthewd commented Apr 1, 2020

@JuanitoFatas I made a small tweak, building off the implementation you had in there ☝🏻 -- does it seem reasonable to you?

As for testing... I haven't tried, but I think you might be able to construct an Installer, then use instance_variable_set to replace its @git_depot with a Minitest::Mock. Maybe? 🤔

@kaspth
Copy link
Collaborator

kaspth commented Apr 1, 2020

Wanted to see the runtime for myself so tried testing the Gemfile locally with @matthewd's commit on top and I get a RuntimeError. I'm assuming there's a Gem I don't have access to, so I'll leave it for here. 3 minutes still sound like a long time, especially with parallelization Gel does. But maybe not worth looking into on top of this.

See the RuntimeError
kaspth-imac 2.7.0 ~/code/geltest rm -rf ~/.local/gel ~/.cache/gel && time ../gel/exe/gel install
Fetching sources....Unhandled exception in work pool "gel-catalog-prep" for job "catalog":
#<RuntimeError: git rev-parse failed>
   /Users/kaspth/code/gel/lib/gel/git_depot.rb:47:in `resolve'
   /Users/kaspth/code/gel/lib/gel/git_depot.rb:55:in `resolve_and_checkout'
   /Users/kaspth/code/gel/lib/gel/git_catalog.rb:20:in `block in checkout_result'
   /Users/kaspth/code/gel/lib/gel/git_catalog.rb:20:in `synchronize'
   /Users/kaspth/code/gel/lib/gel/git_catalog.rb:20:in `checkout_result'
   /Users/kaspth/code/gel/lib/gel/git_catalog.rb:36:in `prepare'
   /Users/kaspth/code/gel/lib/gel/environment.rb:205:in `block (3 levels) in solve_for_gemfile'
   /Users/kaspth/code/gel/lib/gel/work_pool.rb:62:in `block (4 levels) in start'
   /Users/kaspth/code/gel/lib/gel/work_pool.rb:47:in `loop'
   /Users/kaspth/code/gel/lib/gel/work_pool.rb:47:in `block (3 levels) in start'
   /Users/kaspth/code/gel/lib/gel/work_pool.rb:46:in `catch'
   /Users/kaspth/code/gel/lib/gel/work_pool.rb:46:in `block (2 levels) in start'
......
Resolving dependencies...

===== Gel Internal Error =====

Traceback (most recent call last):
	26: from ../gel/exe/gel:13:in `<main>'
	25: from /Users/kaspth/code/gel/lib/gel/command.rb:13:in `run'
	24: from /Users/kaspth/code/gel/lib/gel/command/install.rb:5:in `run'
	23: from /Users/kaspth/code/gel/lib/gel/environment.rb:358:in `activate'
	22: from /Users/kaspth/code/gel/lib/gel/environment.rb:326:in `write_lock'
	21: from /Users/kaspth/code/gel/lib/gel/environment.rb:232:in `solve_for_gemfile'
	20: from /Users/kaspth/.local/gel/ruby/gems/pub_grub-0.5.0/lib/pub_grub/version_solver.rb:40:in `work'
	19: from /Users/kaspth/.local/gel/ruby/gems/pub_grub-0.5.0/lib/pub_grub/version_solver.rb:122:in `choose_package_version'
	18: from /Users/kaspth/code/gel/lib/gel/pub_grub/solver.rb:19:in `next_package_to_try'
	17: from /Users/kaspth/code/gel/lib/gel/pub_grub/solver.rb:19:in `min_by'
	16: from /Users/kaspth/code/gel/lib/gel/pub_grub/solver.rb:19:in `each'
	15: from /Users/kaspth/code/gel/lib/gel/pub_grub/solver.rb:21:in `block in next_package_to_try'
	14: from /Users/kaspth/.local/gel/ruby/gems/pub_grub-0.5.0/lib/pub_grub/basic_package_source.rb:120:in `versions_for'
	13: from /Users/kaspth/.local/gel/ruby/gems/pub_grub-0.5.0/lib/pub_grub/basic_package_source.rb:103:in `block in initialize'
	12: from /Users/kaspth/.local/gel/ruby/gems/pub_grub-0.5.0/lib/pub_grub/basic_package_source.rb:100:in `block in initialize'
	11: from /Users/kaspth/code/gel/lib/gel/pub_grub/source.rb:44:in `all_versions_for'
	10: from /Users/kaspth/code/gel/lib/gel/catalog_set.rb:24:in `entries_for'
	 9: from /Users/kaspth/code/gel/lib/gel/catalog_set.rb:72:in `fetch_package_info'
	 8: from /Users/kaspth/code/gel/lib/gel/catalog_set.rb:72:in `each'
	 7: from /Users/kaspth/code/gel/lib/gel/catalog_set.rb:78:in `block in fetch_package_info'
	 6: from /Users/kaspth/code/gel/lib/gel/git_catalog.rb:28:in `gem_info'
	 5: from /Users/kaspth/code/gel/lib/gel/git_catalog.rb:32:in `path_catalog'
	 4: from /Users/kaspth/code/gel/lib/gel/git_catalog.rb:20:in `checkout_result'
	 3: from /Users/kaspth/code/gel/lib/gel/git_catalog.rb:20:in `synchronize'
	 2: from /Users/kaspth/code/gel/lib/gel/git_catalog.rb:20:in `block in checkout_result'
	 1: from /Users/kaspth/code/gel/lib/gel/git_depot.rb:55:in `resolve_and_checkout'
/Users/kaspth/code/gel/lib/gel/git_depot.rb:47:in `resolve': git rev-parse failed (RuntimeError)

real	1m14.453s
user	0m16.426s
sys	0m5.008s

@matthewd
Copy link
Member

matthewd commented Apr 1, 2020

@kaspth yeah I hit that too -- it definitely reveals some poor error handling 😅, but is because bkeepers/dotenv#404 was merged.

I didn't actually time things out, but in my casual observation, I think it was the git clone of Rails that accounted for most of the time. Possibly we should consider [the tradeoffs of] a shallower clone strategy. (But then again, a first-run git clone of rails is a rare thing to do.)

@kaspth
Copy link
Collaborator

kaspth commented Apr 1, 2020

Ah, cool! If I just use github: "bkeepers/dotenv" (well, git: but you get the idea) now it works and was fairly snappy actually. But I don't see Action Pack or any of the other gems mentioned?

kaspth-imac 2.7.0 ~/code/gel/tmp less-clone-for-git-gems= rm -rf ~/.local/gel ~/.cache/gel && time ../exe/gel install
Fetching sources...........
Resolving dependencies..........
Writing lockfile to /Users/kaspth/code/gel/tmp/Gemfile.lock
Installing zeitwerk (2.3.0)                                                    
Installing mini_portile2 (2.4.0)                                               
Installing i18n (1.8.2)                                               
Installing minitest (5.14.0)                                                       
Installing tzinfo (2.0.1)                                                       
Installing rails-dom-testing (2.0.3)                                           
Installing crass (1.0.6)                                                          
Installing rails-html-sanitizer (1.3.0)                                             
Installing loofah (2.4.0)                                            
Installing builder (3.2.4)                                              
Installing rack (2.2.2)                                                  
Installing erubi (1.9.0)                                                          
Installing rack-test (1.1.0)                                                     
Installing concurrent-ruby (1.1.6)                                          
Installing globalid (0.4.2)                                           
Installing method_source (1.0.0)                                    
Installing thor (1.0.1)                                         
Installing marcel (0.3.3)                                      
Installing rake (13.0.1)                                             
Installing mini_mime (1.0.2)                                                  
Installing rspec-support (3.9.2)                                                  
Installing public_suffix (4.0.3)                                                
Installing mimemagic (0.3.4)                                            
Installing addressable (2.7.0)                                         
Installing diff-lcs (1.3)                                       
Installing tilt (2.0.10)                                                                                 
Installing websocket-extensions (0.1.4)                                                                              
Installing multipart-post (2.1.1)                                                                       
Installing ragel-bitmap (0.2.1)                                                                         
Installing execjs (2.7.0)                                                                            
Installing rubyzip (2.3.0)                                                                          
Installing rb-inotify (0.10.1)                                                                         
Installing safe_yaml (1.0.5)                                                                           
Installing faraday (1.0.1)                                                                          
Installing rb-fsevent (0.10.3)                                                                           
Installing childprocess (3.0.0)                                                                       
Installing temple (0.8.2)                                                                                     
Installing coderay (1.1.2)                                                                                     
Installing coffee-script-source (1.12.2)                                                                               
Installing get_process_mem (0.2.5)                                                                                     
Installing coffee-script (2.4.1)                                                                                   
Installing statsd-ruby (1.4.0)                                                                                         
Installing websocket-driver (0.7.1)                                                                                            
Installing multi_json (1.14.1)                                                                                
Installing spring (2.1.0)                                                                                        
Installing request_store (1.5.0)                                                                                        
Installing rspec-core (3.9.1)                                                                                                  
Installing hashdiff (1.0.1)                                                                                                              
Installing factory_bot (5.1.2)                                                                                                       
Installing regexp_parser (1.7.0)                                                                                                     
Installing selenium-webdriver (3.142.7)                                                                                       
Installing sawyer (0.8.2)                                                                                                  
Installing slim (4.0.1)                                                                                                  
Installing http-2-next (0.2.6)                                                                                                
Installing rails_stdout_logging (0.0.5)                                                                                              
Installing sassc-rails (2.1.2)                                                                                              
Installing ruby-enum (0.8.0)                                                                                          
Installing rspec-expectations (3.9.1)                                                                                                   
Installing pry (0.13.0)                                                                                                     
Installing listen (3.2.1)                                                                                                                 
Installing turbolinks-source (5.2.0)                                                                                                     
Installing timers (4.3.0)                                                                                                      
Installing rspec-mocks (3.9.1)
Installing crack (0.4.3)                                                                                                        
Installing xpath (3.2.0)                                                                                                  
Installing octokit (4.18.0)                                                                                                  
Installing attr_extras (6.2.3)                                                                                               
Installing webmock (3.8.3)                                                                                                                
Installing lograge (0.11.2)                                                                                                                   
Installing factory_bot_rails (5.1.1)                                                                                                           
Installing pry-rails (0.3.9)                                                                                                                    
Installing sanitize (5.1.0)                                                                                                                              
Installing puma_worker_killer (0.1.1)                                                                                                                        
Installing sass-rails (6.0.0)                                                                                                                        
Installing rack-mini-profiler (2.0.1)
Installing rspec-rails (4.0.0)                                                                                                                         
Installing secure_headers (6.3.0)                                                                                                               
Installing rouge (3.17.0)                                                                                                                         
Installing shoulda-matchers (4.3.0)                                                                                                                    
Installing rack-rewrite (1.5.1)                                                                                                                    
Installing slim-rails (3.2.0)                                                                                                                      
Installing coffee-rails (5.0.0)                                                                                                                       
Installing capybara (3.32.0)                                                                                                                    
Installing rack-timeout (0.6.0)                                                                                                              
Installing html-pipeline (2.12.3)                                                                                                                     
Installing gemoji (3.0.1)
Installing httpx (0.7.0)                                                                                                                        
Installing turbolinks (5.2.1)                                                                                                                    
Installing spring-watcher-listen (2.0.1)                                                                                                      
Installing barnes (0.0.8)                                                                                                        
Installing twemoji (3.1.6)                                                                                                           
Installing uglifier (4.2.0)                                                                                                                 
Installing webdrivers (4.2.0)                                                                                                                         
Installing memory_profiler (0.9.14)                                                                                                           
Installing launchy (2.5.0)                                                                                                    
Installing redis (4.1.3)                                                                                              
Installing rails_serve_static_assets (0.0.5)                                                                    
Installing nio4r (2.5.2)                                                 
Installing rails_12factor (0.0.3)                                       
Installing msgpack (1.3.3)               
Installing puma (4.3.3)                  
Installing hiredis (0.6.3)               
Installing json (2.3.0)                       
Installing bootsnap (1.4.6)                       
Installing commonmarker (0.21.0)            
Installing pg (1.2.3)          
Installing ffi (1.12.2)     
Installing nokogiri (1.10.9)  
Installing nokogumbo (2.0.2)
Installing sassc (2.2.1)
Installed 110 gems

real	1m27.697s
user	2m45.017s
sys	0m40.872s

)
fake_download_pool.expect(:queue, true) do |argument|
argument == "actioncable"
end
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if this expect got run twice, Minitest will throw an error

MockExpectationError: No more expects available for :queue: ["actionmailbox"]

simulates checkout twice in real scenario.

@JuanitoFatas
Copy link
Collaborator Author

@kaspth Sorry about the disappear dotenv reference.
@matthewd The changes look good to me, thank you! 😍
I added a test to simulate we don‘t checkout twice in 7e26027.

I also tried f8b9e89 with my rails project it works and emits all gem names:

Result running gel install with PR body‘s Tested Gemfile
Installing zeitwerk (2.3.0)
Installing mini_portile2 (2.4.0)
Installing minitest (5.14.0)
Installing i18n (1.8.2)
Installing tzinfo (2.0.1)
Installing crass (1.0.6)
Installing rails-dom-testing (2.0.3)
Installing rails-html-sanitizer (1.3.0)
Installing concurrent-ruby (1.1.6)
Installing builder (3.2.4)
Installing rack (2.2.2)
Installing loofah (2.4.0)
Installing erubi (1.9.0)
Installing rack-test (1.1.0)
Installing globalid (0.4.2)
Installing method_source (1.0.0)
Installing marcel (0.3.3)
Installing rake (13.0.1)
Installing thor (1.0.1)
Installing ragel-bitmap (0.2.1)
Installing mini_mime (1.0.2)
Installing rspec-support (3.9.2)
Installing public_suffix (4.0.3)
Installing mimemagic (0.3.4)
Installing addressable (2.7.0)
Installing websocket-extensions (0.1.4)
Installing multipart-post (2.1.1)
Installing tilt (2.0.10)
Installing diff-lcs (1.3)
Installing rubyzip (2.3.0)
Installing execjs (2.7.0)
Installing faraday (1.0.1)
Installing coffee-script-source (1.12.2)
Installing rb-inotify (0.10.1)
Installing childprocess (3.0.0)
Installing coderay (1.1.2)
Installing rb-fsevent (0.10.3)
Installing safe_yaml (1.0.5)
Installing temple (0.8.2)
Installing http-2-next (0.2.6)
Installing request_store (1.5.0)
Installing spring (2.1.0)
Installing coffee-script (2.4.1)
Installing slim (4.0.1)
Installing regexp_parser (1.7.0)
Installing sawyer (0.8.2)
Installing crack (0.4.3)
Installing pry (0.13.0)
Installing rails_stdout_logging (0.0.5)
[Downloading: actioncable dotenv sprockets sprockets-rails rails_serve_static_assets mail +57;   Compiling: nio4r ffi nokogiri websocket-driver                                                                                                                                               Installing rails_serve_static_assets (0.0.5)
Installing html-pipeline (2.12.3)
Using sprockets-rails (git)
Installing hashdiff (1.0.1)
Installing selenium-webdriver (3.142.7)
Installing sassc-rails (2.1.2)
Installing get_process_mem (0.2.5)
Installing ruby-enum (0.8.0)
Installing listen (3.2.1)
Installing rspec-mocks (3.9.1)
Installing rspec-expectations (3.9.1)
Installing rspec-core (3.9.1)
Installing websocket-driver (0.7.1)
Using dotenv (git)
Using dotenv-rails (git)
Installing multi_json (1.14.1)
Installing factory_bot (5.1.2)
Installing statsd-ruby (1.4.0)
Installing timers (4.3.0)
Installing turbolinks-source (5.2.0)
Installing xpath (3.2.0)
Installing redis (4.1.3)
Installing httpx (0.7.0)
Installing webmock (3.8.3)
Installing memory_profiler (0.9.14)
Installing octokit (4.18.0)
Using mail (git)
Installing launchy (2.5.0)
Installing rspec-rails (4.0.0)
Installing capybara (3.32.0)
Installing rouge (3.17.0)
Installing sanitize (5.1.0)
Installing puma_worker_killer (0.1.1)
Installing sass-rails (6.0.0)
Installing attr_extras (6.2.3)
[Downloading: actioncable rack-mini-profiler sprockets secure_headers pry-rails database_rewinder +20;   Compiling: nio4r ffi nokogiri msgpack                                                                                                                                                Installing pry-rails (0.3.9)
[Downloading: actioncable rack-mini-profiler sprockets secure_headers lograge database_rewinder +19;   Compiling: nio4r ffi nokogiri msgpack +5                                                                                                                                               Installing lograge (0.11.2)
[Downloading: actioncable rack-mini-profiler sprockets secure_headers shoulda-matchers database_rewinder +18;   Compiling: nio4r ffi nokogiri m                                                                                                                                               Installing secure_headers (6.3.0)
[Downloading: actioncable rack-mini-profiler sprockets rack-rewrite shoulda-matchers database_rewinder +17;   Compiling: nio4r ffi nokogiri msg                                                                                                                                               Installing rack-rewrite (1.5.1)
[Downloading: actioncable rack-mini-profiler sprockets slim-rails shoulda-matchers database_rewinder +16;   Compiling: nio4r ffi nokogiri msgpa                                                                                                                                               Installing rack-mini-profiler (2.0.1)
Installing slim-rails (3.2.0)
Installing shoulda-matchers (4.3.0)
Installing barnes (0.0.8)
[Downloading: actioncable rack-timeout sprockets factory_bot_rails spring-watcher-listen database_rewinder +10;   Compiling: nio4r ffi nokogiri                                                                                                                                               Installing spring-watcher-listen (2.0.1)
[Downloading: actioncable rack-timeout sprockets factory_bot_rails coffee-rails database_rewinder +9;   Compiling: nio4r ffi nokogiri msgpack +                                                                                                                                               Installing factory_bot_rails (5.1.1)
Installing coffee-rails (5.0.0)
Installing turbolinks (5.2.1)
Installing rack-timeout (0.6.0)
Installing uglifier (4.2.0)
Installing twemoji (3.1.6)
[Downloading: actioncable webdrivers sprockets title html-pipeline-ruby_markup database_rewinder +2;   Compiling: nio4r ffi nokogiri msgpack +8                                                                                                                                               Installing html-pipeline-ruby_markup (0.9.2)
Installing webdrivers (4.2.0)
Installing rails_12factor (0.0.3)
Installing gemoji (3.0.1)
Using sprockets (git)
Using database_rewinder (git)
Using title (git)
Installing nio4r (2.5.2)
Installing msgpack (1.3.3)
Installing puma (4.3.3)
Installing bootsnap (1.4.6)
Installing hiredis (0.6.3)
Installing commonmarker (0.21.0)
Installing json (2.3.0)
Installing pg (1.2.3)
Installing ffi (1.12.2)
Using actioncable (git)
Using actionmailbox (git)
Using actionmailer (git)
Using actionpack (git)
Using actiontext (git)
Using actionview (git)
Using activejob (git)
Using activemodel (git)
Using activerecord (git)
Using activestorage (git)
Using activesupport (git)
Using rails (git)
Using railties (git)
Installing nokogiri (1.10.9)
Installing nokogumbo (2.0.2)
Installing sassc (2.2.1)
Installed 118 gems
gel install  362.04s user 88.57s system 250% cpu 3:00.22 total

@matthewd
Copy link
Member

matthewd commented Apr 2, 2020

But I don't see Action Pack or any of the other gems mentioned?

Ah, so this is another thing. Interesting!

The output is missing because of this condition:

if installer && !Dir.exist?(dir)

... and that's false (i.e., the directory exists) because we've already cloned the repository earlier, in order to resolve the lockfile.

So, I think we can drop that condition (load_git_gem should ultimately no-op down in GitDepot anyway) to ensure the message always appears. But to see the clone actually happen during an install, you need to resolve the lockfile then clear local+cache.

When there is no lockfile, we've already cloned the repository earlier to resolve the lockfile. So the check here will return false and some git gems message will not appear.
Copy link
Collaborator

@kaspth kaspth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool! Looks like I blew away the local setup I had for testing this, so I haven't tried again. But from your updated PR description, it seems like it worked. Nice job pulling for this @JuanitoFatas 🙏

Base automatically changed from master to main January 16, 2021 11:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants