apache / whimsy

Apache Whimsy
Apache License 2.0
68 stars 69 forks source link

rake svn:update git:pull fails #162

Closed grobmeier closed 2 years ago

grobmeier commented 2 years ago

After a succesful rake docker:update, I wanted to run:

rake svn:update git:pull

The result is:

** Invoke svn:update (first_time)
** Invoke config (first_time)
** Execute config
rake aborted!
LoadError: cannot load such file -- whimsy/asf/config
/Users/cy/.rvm/rubies/ruby-2.6.3/lib/ruby/site_ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
/Users/cy/.rvm/rubies/ruby-2.6.3/lib/ruby/site_ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
/Users/cy/Development/apache-whimsy/whimsy/Rakefile:112:in `block in <top (required)>'
/Users/cy/.rvm/rubies/ruby-2.6.3/lib/ruby/gems/2.6.0/gems/rake-12.3.2/lib/rake/task.rb:273:in `block in execute'
/Users/cy/.rvm/rubies/ruby-2.6.3/lib/ruby/gems/2.6.0/gems/rake-12.3.2/lib/rake/task.rb:273:in `each'
/Users/cy/.rvm/rubies/ruby-2.6.3/lib/ruby/gems/2.6.0/gems/rake-12.3.2/lib/rake/task.rb:273:in `execute'
/Users/cy/.rvm/rubies/ruby-2.6.3/lib/ruby/gems/2.6.0/gems/rake-12.3.2/lib/rake/task.rb:214:in `block in invoke_with_call_chain'
/Users/cy/.rvm/rubies/ruby-2.6.3/lib/ruby/2.6.0/monitor.rb:230:in `mon_synchronize'
/Users/cy/.rvm/rubies/ruby-2.6.3/lib/ruby/gems/2.6.0/gems/rake-12.3.2/lib/rake/task.rb:194:in `invoke_with_call_chain'
/Users/cy/.rvm/rubies/ruby-2.6.3/lib/ruby/gems/2.6.0/gems/rake-12.3.2/lib/rake/task.rb:238:in `block in invoke_prerequisites'
/Users/cy/.rvm/rubies/ruby-2.6.3/lib/ruby/gems/2.6.0/gems/rake-12.3.2/lib/rake/task.rb:236:in `each'
/Users/cy/.rvm/rubies/ruby-2.6.3/lib/ruby/gems/2.6.0/gems/rake-12.3.2/lib/rake/task.rb:236:in `invoke_prerequisites'
/Users/cy/.rvm/rubies/ruby-2.6.3/lib/ruby/gems/2.6.0/gems/rake-12.3.2/lib/rake/task.rb:213:in `block in invoke_with_call_chain'
/Users/cy/.rvm/rubies/ruby-2.6.3/lib/ruby/2.6.0/monitor.rb:230:in `mon_synchronize'
/Users/cy/.rvm/rubies/ruby-2.6.3/lib/ruby/gems/2.6.0/gems/rake-12.3.2/lib/rake/task.rb:194:in `invoke_with_call_chain'
/Users/cy/.rvm/rubies/ruby-2.6.3/lib/ruby/gems/2.6.0/gems/rake-12.3.2/lib/rake/task.rb:183:in `invoke'
/Users/cy/.rvm/rubies/ruby-2.6.3/lib/ruby/gems/2.6.0/gems/rake-12.3.2/lib/rake/application.rb:160:in `invoke_task'
/Users/cy/.rvm/rubies/ruby-2.6.3/lib/ruby/gems/2.6.0/gems/rake-12.3.2/lib/rake/application.rb:116:in `block (2 levels) in top_level'
/Users/cy/.rvm/rubies/ruby-2.6.3/lib/ruby/gems/2.6.0/gems/rake-12.3.2/lib/rake/application.rb:116:in `each'
/Users/cy/.rvm/rubies/ruby-2.6.3/lib/ruby/gems/2.6.0/gems/rake-12.3.2/lib/rake/application.rb:116:in `block in top_level'
/Users/cy/.rvm/rubies/ruby-2.6.3/lib/ruby/gems/2.6.0/gems/rake-12.3.2/lib/rake/application.rb:125:in `run_with_threads'
/Users/cy/.rvm/rubies/ruby-2.6.3/lib/ruby/gems/2.6.0/gems/rake-12.3.2/lib/rake/application.rb:110:in `top_level'
/Users/cy/.rvm/rubies/ruby-2.6.3/lib/ruby/gems/2.6.0/gems/rake-12.3.2/lib/rake/application.rb:83:in `block in run'
/Users/cy/.rvm/rubies/ruby-2.6.3/lib/ruby/gems/2.6.0/gems/rake-12.3.2/lib/rake/application.rb:186:in `standard_exception_handling'
/Users/cy/.rvm/rubies/ruby-2.6.3/lib/ruby/gems/2.6.0/gems/rake-12.3.2/lib/rake/application.rb:80:in `run'
/Users/cy/.rvm/rubies/ruby-2.6.3/lib/ruby/gems/2.6.0/gems/rake-12.3.2/exe/rake:27:in `<top (required)>'
/Users/cy/.rvm/rubies/ruby-2.6.3/bin/rake:23:in `load'
/Users/cy/.rvm/rubies/ruby-2.6.3/bin/rake:23:in `<main>'
Tasks: TOP => svn:update => config

Looks I missed to configure something but could not find what it is from here: https://github.com/apache/whimsy/blob/master/DOCKER.md

sebbASF commented 2 years ago

Did you issue the following command?

echo ":root: ." >.whimsy

The '.whimsy' file should be in the parent directory, i.e. one level above where DOCKER.md is located.

grobmeier commented 2 years ago

Yes, I did it according to the docs. My folder structure looks like:

-rw-r--r--   1 cy  staff     9B May 17 20:48 .whimsy
drwxr-xr-x   2 cy  staff    64B May 16 18:38 cache
drwxr-xr-x   9 cy  staff   288B May 18 19:04 gems
drwxr-xr-x   3 cy  staff    96B May 16 18:38 mail
drwxr-xr-x  11 cy  staff   352B May 16 18:38 subscriptions
drwxr-xr-x  37 cy  staff   1.2K May 18 18:43 whimsy

The content of .whimsy is:

:root: .
sebbASF commented 2 years ago

The problem is that the Rakefile is expecting to find the config under /srv/whimsy/lib; however /srv/whimsy is only set up under docker.

Can you please try editing Rakefile as follows? Thanks!

--- a/Rakefile
+++ b/Rakefile
@@ -108,7 +108,7 @@ end

 # This requires Gems such as Wunderbar to have been set up
 task :config do
-  $LOAD_PATH.unshift '/srv/whimsy/lib'
+  $LOAD_PATH.unshift 'lib'
sebbASF commented 2 years ago

The Rakefile assumes that it will be run from the directory in which it appears. Indeed it looks for the library sources (which include config) here: https://github.com/apache/whimsy/blob/9b25083909f5c283c03c7af8e7679046e7ec5fae/Rakefile#L10

So it should be OK to make that change for all circumstances. But it would be good to get confirmation that it fixes the issue for you!

grobmeier commented 2 years ago

@sebbASF - it indeed fixes the issue for me. I could successfully run the command. For your convenience I just created a PR with your proposed change. Thanks a lot for your help!