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

Zef::Client requires a cache parameter #92

Closed
zoffixznet opened this issue Jun 22, 2016 · 2 comments
Closed

Zef::Client requires a cache parameter #92

zoffixznet opened this issue Jun 22, 2016 · 2 comments

Comments

@zoffixznet
Copy link
Contributor

I've recently started getting this weird failure. It generally happened after first installing a module (going from a clean perl 6 install). Now, I built 2016.04 rakudo with rakudobrew, installed zef on it and it threw the error right away:

$ zef install Inline::Perl5 DBIish Config::From
Zef::Client requires a cache parameter
  in method new at sources/1DC0BAA246D0774E7EB4F5119C6168E0D8266EFA (Zef::Client) line 40
  in sub get-client at /home/zoffix/.rakudobrew/moar-2016.04/install/share/perl6/site/sources/A9948E7371E0EB9AFDF1EEEB07B52A1B75537C31 (Zef::CLI) line 449
  in sub MAIN at /home/zoffix/.rakudobrew/moar-2016.04/install/share/perl6/site/sources/A9948E7371E0EB9AFDF1EEEB07B52A1B75537C31 (Zef::CLI) line 83
  in block <unit> at /home/zoffix/.rakudobrew/moar-2016.04/install/share/perl6/site/resources/CF513BDDDD2453EA3D268ED1EE1B9E91EECA9DAC line 1
@ugexe
Copy link
Owner

ugexe commented Jun 22, 2016

I cannot reproduce, so my guess is zef is choosing a config that may not be what someone would expect. Specifically for this case its looking for a config file that is json, slurping it into a hash, and using the %hash<StoreDir> value for a default cache parameter

Zef::Config.find-config()
The order used is:

  1. $cwd/config.json
  2. $home/.zef/config.json
  3. $cwd/.zef/config.json
  4. %?RESOURCES<config.json>

As I cannot reproduce, could you run zef --help? The section under FLAGS, titled CONFIGURATION, will list the path of the file it will use for the config. Mine shows:
CONFIGURATION /home/nickl/.rakudobrew/moar-2016.04/install/share/perl6/site/resources/1F29702A476391AE0318E060ADE9CA2BB2B0F993.json

If this file does exist, could you verify it contains a "StoreDir" key and value?

If it does not exist or it shows nothing (I doubt this, as there should be a slurp related error occuring first), my guess would be %?RESOURCES<config.json> is possibly returning a bad path. I'd have to see what you are getting by adding the following to Zef::Config.find-config():

say "config.json".IO.perl;
say ($*HOME // $*CWD).child('.zef').child('config.json').perl;
say %?RESOURCES<config.json>.perl

Clearly better errors and debugging output are needed here 😦

@zoffixznet
Copy link
Contributor Author

Aha! I actually had an unrelated file named config.json (config for my own module) in the directory I was running zef in. False alarm. Sorry.

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

No branches or pull requests

2 participants