github / licensed

A Ruby gem to cache and verify the licenses of dependencies

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

licensed v4.0.0 test failure in Homebrew

p-linnane opened this issue Β· comments

Hello πŸ‘‹ . I'm a maintainer for the Homebrew project. While packaging licensed v4.0.0 we're running into some test failures when running licensed cache. The relevant GitHub actions run can be found here. This is the output of licensed cache:

licensed cache
Traceback (most recent call last):
	10: from /opt/homebrew/Cellar/licensed/4.0.0/libexec/bin/licensed:25:in `<main>'
	 9: from /opt/homebrew/Cellar/licensed/4.0.0/libexec/bin/licensed:25:in `load'
	 8: from /opt/homebrew/Cellar/licensed/4.0.0/libexec/gems/licensed-4.0.0/exe/licensed:5:in `<top (required)>'
	 7: from /opt/homebrew/Cellar/licensed/4.0.0/libexec/gems/thor-1.2.1/lib/thor/base.rb:485:in `start'
	 6: from /opt/homebrew/Cellar/licensed/4.0.0/libexec/gems/thor-1.2.1/lib/thor.rb:392:in `dispatch'
	 5: from /opt/homebrew/Cellar/licensed/4.0.0/libexec/gems/thor-1.2.1/lib/thor/invocation.rb:127:in `invoke_command'
	 4: from /opt/homebrew/Cellar/licensed/4.0.0/libexec/gems/thor-1.2.1/lib/thor/command.rb:27:in `run'
	 3: from /opt/homebrew/Cellar/licensed/4.0.0/libexec/gems/licensed-4.0.0/lib/licensed/cli.rb:18:in `cache'
	 2: from /opt/homebrew/Cellar/licensed/4.0.0/libexec/gems/licensed-4.0.0/lib/licensed/cli.rb:105:in `config'
	 1: from /opt/homebrew/Cellar/licensed/4.0.0/libexec/gems/licensed-4.0.0/lib/licensed/configuration.rb:236:in `load_from'
/opt/homebrew/Cellar/licensed/4.0.0/libexec/gems/licensed-4.0.0/lib/licensed/configuration.rb:317:in `find_config': Licensed configuration not found in /opt/homebrew/Library/Taps/homebrew/homebrew-core/Formula (Licensed::Configuration::LoadError)

Any guidance here would be appreciated.

πŸ‘‹ I don't see the error you included here in the action logs, it looks like the job was failing because it was trying to run some tests without the required tool (gradle) available.

   Traceback (most recent call last):
  	33: from /opt/homebrew/Cellar/licensed/4.0.0/libexec/bin/licensed:25:in `<main>'
  	32: from /opt/homebrew/Cellar/licensed/4.0.0/libexec/bin/licensed:25:in `load'
  	31: from /opt/homebrew/Cellar/licensed/4.0.0/libexec/gems/licensed-4.0.0/exe/licensed:5:in `<top (required)>'
  	30: from /opt/homebrew/Cellar/licensed/4.0.0/libexec/gems/thor-1.2.1/lib/thor/base.rb:485:in `start'
  	29: from /opt/homebrew/Cellar/licensed/4.0.0/libexec/gems/thor-1.2.1/lib/thor.rb:392:in `dispatch'
  	28: from /opt/homebrew/Cellar/licensed/4.0.0/libexec/gems/thor-1.2.1/lib/thor/invocation.rb:127:in `invoke_command'
  	27: from /opt/homebrew/Cellar/licensed/4.0.0/libexec/gems/thor-1.2.1/lib/thor/command.rb:27:in `run'
  	26: from /opt/homebrew/Cellar/licensed/4.0.0/libexec/gems/licensed-4.0.0/lib/licensed/cli.rb:18:in `cache'
  	25: from /opt/homebrew/Cellar/licensed/4.0.0/libexec/gems/licensed-4.0.0/lib/licensed/cli.rb:115:in `run'
  	24: from /opt/homebrew/Cellar/licensed/4.0.0/libexec/gems/licensed-4.0.0/lib/licensed/commands/command.rb:23:in `run'
  	23: from /opt/homebrew/Cellar/licensed/4.0.0/libexec/gems/licensed-4.0.0/lib/licensed/commands/cache.rb:24:in `run_command'
  	22: from /opt/homebrew/Cellar/licensed/4.0.0/libexec/gems/licensed-4.0.0/lib/licensed/commands/command.rb:64:in `run_command'
  	21: from /opt/homebrew/Cellar/licensed/4.0.0/libexec/gems/licensed-4.0.0/lib/licensed/commands/command.rb:64:in `map'
  	20: from /opt/homebrew/Cellar/licensed/4.0.0/libexec/gems/licensed-4.0.0/lib/licensed/commands/command.rb:67:in `block in run_command'
  	19: from /opt/homebrew/Cellar/licensed/4.0.0/libexec/gems/licensed-4.0.0/lib/licensed/commands/cache.rb:39:in `run_app'
  	18: from /opt/homebrew/Cellar/licensed/4.0.0/libexec/gems/licensed-4.0.0/lib/licensed/commands/cache.rb:166:in `with_licensee_configuration'
  	17: from /opt/homebrew/Cellar/licensed/4.0.0/libexec/gems/licensed-4.0.0/lib/licensed/commands/cache.rb:40:in `block in run_app'
  	16: from /opt/homebrew/Cellar/licensed/4.0.0/libexec/gems/licensed-4.0.0/lib/licensed/commands/command.rb:95:in `run_app'
  	15: from /opt/homebrew/Cellar/licensed/4.0.0/libexec/gems/licensed-4.0.0/lib/licensed/commands/command.rb:95:in `chdir'
  	14: from /opt/homebrew/Cellar/licensed/4.0.0/libexec/gems/licensed-4.0.0/lib/licensed/commands/command.rb:96:in `block in run_app'
  	13: from /opt/homebrew/Cellar/licensed/4.0.0/libexec/gems/licensed-4.0.0/lib/licensed/commands/command.rb:96:in `select'
  	12: from /opt/homebrew/Cellar/licensed/4.0.0/libexec/gems/licensed-4.0.0/lib/licensed/sources/gradle.rb:45:in `enabled?'
  	11: from /opt/homebrew/Cellar/licensed/4.0.0/libexec/gems/licensed-4.0.0/lib/licensed/sources/gradle.rb:66:in `gradle_runner'
  	10: from /opt/homebrew/Cellar/licensed/4.0.0/libexec/gems/licensed-4.0.0/lib/licensed/sources/gradle.rb:66:in `new'
  	 9: from /opt/homebrew/Cellar/licensed/4.0.0/libexec/gems/licensed-4.0.0/lib/licensed/sources/gradle.rb:121:in `initialize'
  	 8: from /opt/homebrew/Cellar/licensed/4.0.0/libexec/gems/licensed-4.0.0/lib/licensed/sources/gradle.rb:154:in `create_init_script'
  Error: test failed
  	 7: from /opt/homebrew/Cellar/licensed/4.0.0/libexec/gems/licensed-4.0.0/lib/licensed/sources/gradle.rb:154:in `chdir'
  	 6: from /opt/homebrew/Cellar/licensed/4.0.0/libexec/gems/licensed-4.0.0/lib/licensed/sources/gradle.rb:169:in `block in create_init_script'
  	 5: from /opt/homebrew/Cellar/licensed/4.0.0/libexec/gems/licensed-4.0.0/lib/licensed/sources/gradle.rb:139:in `gradle_version'
  	 4: from /opt/homebrew/Cellar/licensed/4.0.0/libexec/gems/licensed-4.0.0/lib/licensed/shell.rb:10:in `execute'
  	 3: from /opt/homebrew/Cellar/ruby@2.7/2.7.7/lib/ruby/2.7.0/open3.rb:281:in `capture3'
  	 2: from /opt/homebrew/Cellar/ruby@2.7/2.7.7/lib/ruby/2.7.0/open3.rb:101:in `popen3'
  	 1: from /opt/homebrew/Cellar/ruby@2.7/2.7.7/lib/ruby/2.7.0/open3.rb:213:in `popen_run'
  /opt/homebrew/Cellar/ruby@2.7/2.7.7/lib/ruby/2.7.0/open3.rb:213:in `spawn': no implicit conversion of nil into String (TypeError)

If you ran licensed cache in a random directory that doesn't contain a configuration file, I would expect to see something like what you posted.

The bug from the CI job is related to a change in the 4.0.0 release, and I'll have it fixed with a 4.0.1 release shortly. Thanks for the report!

Apologies, the error I posted was from me running the test locally. I will check again once 4.0.1 is out. Thank you!

The fix has been merged and 4.0.1 is released πŸ‘ . Thanks again for the report and sorry that the update caused problems πŸ™

No problem at all and thank you very much! I've pushed 4.0.1 to our PR and will run it through CI right now.