vector icon indicating copy to clipboard operation
vector copied to clipboard

Guide users into install missing environment dependencies when working on Vector

Open binarylogic opened this issue 5 years ago • 1 comments
trafficstars

I think we can do better to guide users into setting up their local environments when they opt not to use make environment.

Example

For example, running make release resulted in the following output for me:

➜ make release
Traceback (most recent call last):
	10: from scripts/release-prepare.rb:16:in `<main>'
	 9: from scripts/release-prepare.rb:16:in `require_relative'
	 8: from /Users/benjohnson/Code/timber/vector/scripts/setup.rb:22:in `<top (required)>'
	 7: from /Users/benjohnson/.asdf/installs/ruby/2.7.1/lib/ruby/2.7.0/bundler.rb:174:in `require'
	 6: from /Users/benjohnson/.asdf/installs/ruby/2.7.1/lib/ruby/2.7.0/bundler.rb:151:in `setup'
	 5: from /Users/benjohnson/.asdf/installs/ruby/2.7.1/lib/ruby/2.7.0/bundler/runtime.rb:20:in `setup'
	 4: from /Users/benjohnson/.asdf/installs/ruby/2.7.1/lib/ruby/2.7.0/bundler/definition.rb:237:in `specs_for'
	 3: from /Users/benjohnson/.asdf/installs/ruby/2.7.1/lib/ruby/2.7.0/bundler/definition.rb:170:in `specs'
	 2: from /Users/benjohnson/.asdf/installs/ruby/2.7.1/lib/ruby/2.7.0/bundler/spec_set.rb:80:in `materialize'
	 1: from /Users/benjohnson/.asdf/installs/ruby/2.7.1/lib/ruby/2.7.0/bundler/spec_set.rb:80:in `map!'
/Users/benjohnson/.asdf/installs/ruby/2.7.1/lib/ruby/2.7.0/bundler/spec_set.rb:86:in `block in materialize': Could not find minitest-5.14.1 in any of the sources (Bundler::GemNotFound)
make: *** [release-prepare] Error 1

My environment is missing a Ruby gem dependency that is solved by:

cd scripts
bundle install

But I would not expect a contributor to know that. I'd prefer something like:

➜ make release
You're missing a required Ruby gem dependency:

   Could not find minitest-5.14.1 in any of the sources

Make sure you've installed all gems:

   cd scripts
   bundle install

Alternatively, you can use our Docker environment via

   make environment
   make <your-target>

make: *** [release-prepare] Error 1

Proposal

I'm curious how we can solve this at a higher level so that users are always guided towards a solution. There might not be a good answer beyond handling errors inline, but I wanted to open this for discussion.

binarylogic avatar Jul 13 '20 16:07 binarylogic

I should be able to detect if they've run bundle install and do it for them. :)

Would love to pick this up and solve it.

Hoverbear avatar Jul 13 '20 17:07 Hoverbear

Closing since no external users have seemed to run into this.

jszwedko avatar Jul 20 '23 15:07 jszwedko