Shopify/packwerk

[Bug Report] Unable to execute packwek init

jasonlor opened this issue · 1 comments

Description
Attempting to initialize/setup packwerk, but hitting a relative_path_from issue.

To Reproduce

  • Initialize a fresh packwerk installation

Expected Behaviour

  • It should work.

Version Information

  • ruby 2.6.6p146 (2020-03-31 revision 67876) [x86_64-darwin19]

Additional Context

➜  web git:(master) ✗ be packwerk init
📦 Initializing Packwerk...
📦 Generating application validator...
✅ Packwerk application validation bin script generated in /Users/jasonlor/Documents/GitHub/app/web/bin
Version: 2.1.1

Usage: spring COMMAND [ARGS]

Commands for Spring itself:

  binstub         Generate Spring based binstubs. Use --all to generate a binstub for all known commands. Use --remove to revert.
  help            Print available commands.
  server          Explicitly start a Spring server in the foreground
  status          Show current status.
  stop            Stop all Spring processes for this project.

Commands for your application:

  rails           Run a rails command. The following sub commands will use Spring: console, runner, generate, destroy, test.
  rake            Runs the rake command
Traceback (most recent call last):
	9: from bin/packwerk:22:in `<main>'
	8: from bin/packwerk:22:in `new'
	7: from /Users/jasonlor/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/packwerk-1.0.0/lib/packwerk/cli.rb:23:in `initialize'
	6: from /Users/jasonlor/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/packwerk-1.0.0/lib/packwerk/configuration.rb:18:in `from_path'
	5: from /Users/jasonlor/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/packwerk-1.0.0/lib/packwerk/configuration.rb:18:in `new'
	4: from /Users/jasonlor/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/packwerk-1.0.0/lib/packwerk/configuration.rb:45:in `initialize'
	3: from /Users/jasonlor/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/packwerk-1.0.0/lib/packwerk/configuration.rb:61:in `all_application_autoload_paths'
	2: from /Users/jasonlor/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/packwerk-1.0.0/lib/packwerk/configuration.rb:61:in `map'
	1: from /Users/jasonlor/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/gems/packwerk-1.0.0/lib/packwerk/configuration.rb:65:in `block in all_application_autoload_paths'
/Users/jasonlor/.rbenv/versions/2.6.6/lib/ruby/2.6.0/pathname.rb:522:in `relative_path_from': different prefix: "" and "/Users/jasonlor/Documents/GitHub/app/web" (ArgumentError)

This should be fixed in the main branch and released as packwerk 1.3.0. Let us know if you still have the issue. Thank you.