mjgardner/moosex-app-cmd

Has a hard dependency on MouseX::Getopt but not MooseX::Getopt

Opened this issue · 9 comments

Ran into this issue when trying to work with Moose and MooseX::App::Cmd where I didn't have either MouseX::Getopt or MooseX::Getopt installed and a exception occured during run:

Attribute(type) does not pass the type constraint because : Validation failed for 'Moose::Meta::TypeConstraint' with value Attribute( not isa Moose::Meta::TypeConstraint ) at / home / adam / . plenv / versions / puju-perl / lib / site_perl / 5.18.2 / x86_64-linux / Moose / Exception . pm line 37
  Moose::Exception::_build_trace('Moose::Exception::ValidationFailedForTypeConstraint=HASH(0x20e55c8)') called at reader Moose::Exception::trace( defined at / home / adam / . plenv / versions / puju-perl / lib / site_perl / 5.18.2 / x86_64-linux / Moose / Exception . pm line 9 ) line 7
  Moose::Exception::trace('Moose::Exception::ValidationFailedForTypeConstraint=HASH(0x20e55c8)') called at / home / adam / . plenv / versions / puju-perl / lib / site_perl / 5.18.2 / x86_64-linux / Moose / Exception . pm line 49
  Moose::Exception::BUILD( 'Moose::Exception::ValidationFailedForTypeConstraint=HASH(0x20e55c8)', 'HASH(0x20fc058)' ) called at / home / adam / . plenv / versions / puju-perl / lib / site_perl / 5.18.2 / x86_64-linux / Class / MOP / Method . pm line 128
  Class::MOP::Method::execute( 'Moose::Meta::Method=HASH(0x20d1e90)', 'Moose::Exception::ValidationFailedForTypeConstraint=HASH(0x20e55c8)', 'HASH(0x20fc058)' ) called at / home / adam / . plenv / versions / puju-perl / lib / site_perl / 5.18.2 / x86_64-linux / Moose / Object . pm line 56
  Moose::Object::BUILDALL( 'Moose::Exception::ValidationFailedForTypeConstraint=HASH(0x20e55c8)', 'HASH(0x20fc058)' ) called at / home / adam / . plenv / versions / puju-perl / lib / site_perl / 5.18.2 / x86_64-linux / Moose / Meta / Class . pm line 282
  Moose::Meta::Class::new_object( 'Moose::Meta::Class=HASH(0x20e5730)', 'HASH(0x20fc058)' ) called at / home / adam / . plenv / versions / puju-perl / lib / site_perl / 5.18.2 / x86_64-linux / Moose / Object . pm line 27
  Moose::Object::new( 'Moose::Exception::ValidationFailedForTypeConstraint', 'type', 'Moose::Meta::TypeConstraint::Class=HASH(0x20cc8a0)', 'value', 'Attribute', 'attribute', 'Moose::Meta::Attribute=HASH(0x20ccac8)' ) called at / home / adam / . plenv / versions / puju-perl / lib / site_perl / 5.18.2 / x86_64-linux / Moose / Util . pm line 51
  Moose::Util::throw_exception( 'ValidationFailedForTypeConstraint', 'type', 'Moose::Meta::TypeConstraint::Class=HASH(0x20cc8a0)', 'value', 'Attribute', 'attribute', 'Moose::Meta::Attribute=HASH(0x20ccac8)' ) called at / home / adam / . plenv / versions / puju-perl / lib / site_perl / 5.18.2 / x86_64-linux / Moose / Meta / Attribute . pm line 1267
  Moose::Meta::Attribute::verify_against_type_constraint( 'Moose::Meta::Attribute=HASH(0x20ccac8)', 'Attribute', 'instance', 'Moose::Exception::CannotLocatePackageInINC=HASH(0x203aec0)' ) called at / home / adam / . plenv / versions / puju-perl / lib / site_perl / 5.18.2 / x86_64-linux / Moose / Meta / Attribute . pm line 1254
  Moose::Meta::Attribute::_coerce_and_verify( 'Moose::Meta::Attribute=HASH(0x20ccac8)', 'Attribute', 'Moose::Exception::CannotLocatePackageInINC=HASH(0x203aec0)' ) called at / home / adam / . plenv / versions / puju-perl / lib / site_perl / 5.18.2 / x86_64-linux / Moose / Meta / Attribute . pm line 514
  Moose::Meta::Attribute::initialize_instance_slot( 'Moose::Meta::Attribute=HASH(0x20ccac8)', 'Moose::Meta::Instance=HASH(0x20da590)', 'Moose::Exception::CannotLocatePackageInINC=HASH(0x203aec0)', 'HASH(0x1ef0a28)' ) called at / home / adam / . plenv / versions / puju-perl / lib / site_perl / 5.18.2 / x86_64-linux / Class / MOP / Class . pm line 529
  Class::MOP::Class::_construct_instance( 'Moose::Meta::Class=HASH(0x20344c0)', 'HASH(0x1ef0a28)' ) called at / home / adam / . plenv / versions / puju-perl / lib / site_perl / 5.18.2 / x86_64-linux / Class / MOP / Class . pm line 499
  Class::MOP::Class::new_object( 'Moose::Meta::Class=HASH(0x20344c0)', 'HASH(0x1ef0a28)' ) called at / home / adam / . plenv / versions / puju-perl / lib / site_perl / 5.18.2 / x86_64-linux / Moose / Meta / Class . pm line 278
  Moose::Meta::Class::new_object( 'Moose::Meta::Class=HASH(0x20344c0)', 'HASH(0x1ef0a28)' ) called at / home / adam / . plenv / versions / puju-perl / lib / site_perl / 5.18.2 / x86_64-linux / Moose / Object . pm line 27
  Moose::Object::new( 'Moose::Exception::CannotLocatePackageInINC', 'possible_packages', 'Getopt or Moose::Meta::Attribute::Custom::Trait::Getopt', 'INC', 'ARRAY(0xf55ea8)', 'type', 'Attribute', 'metaclass_name', 'Getopt', 'params', 'HASH(0x1212e88)' ) called at / home / adam / . plenv / versions / puju-perl / lib / site_perl / 5.18.2 / x86_64-linux / Moose / Util . pm line 51
  Moose::Util::throw_exception( 'CannotLocatePackageInINC', 'possible_packages', 'Getopt or Moose::Meta::Attribute::Custom::Trait::Getopt', 'INC', 'ARRAY(0xf55ea8)', 'type', 'Attribute', 'metaclass_name', 'Getopt', 'params', 'HASH(0x1212e88)' ) called at / home / adam / . plenv / versions / puju-perl / lib / site_perl / 5.18.2 / x86_64-linux / Moose / Util . pm line 243
  Moose::Util::resolve_metaclass_alias( 'Attribute', 'Getopt', 'trait', 1 ) called at / home / adam / . plenv / versions / puju-perl / lib / site_perl / 5.18.2 / x86_64-linux / Moose / Util . pm line 205
  Moose::Util::resolve_metatrait_alias( 'Attribute', 'Getopt' ) called at / home / adam / . plenv / versions / puju-perl / lib / site_perl / 5.18.2 / x86_64-linux / Moose / Meta / Attribute . pm line 131
  Moose::Meta::Attribute::interpolate_class( 'Moose::Meta::Attribute', 'HASH(0x1942db0)' ) called at / home / adam / . plenv / versions / puju-perl / lib / site_perl / 5.18.2 / x86_64-linux / Moose / Meta / Attribute . pm line 100
  Moose::Meta::Attribute::interpolate_class_and_new( 'Moose::Meta::Attribute', 'autogen', 'definition_context', 'HASH(0x1b05e78)', 'is', 'rw', 'isa', 'Bool', 'documentation', 'autogenerate hooks', 'cmd_aliases', 'a', 'traits', 'ARRAY(0x1ee1130)' ) called at / home / adam / . plenv / versions / puju-perl / lib / site_perl / 5.18.2 / x86_64-linux / Moose / Meta / Class . pm line 716
  Moose::Meta::Class::_process_new_attribute( 'Moose::Meta::Class=HASH(0x1edcbd8)', 'autogen', 'definition_context', 'HASH(0x1b05e78)', 'is', 'rw', 'isa', 'Bool', 'documentation', 'autogenerate hooks', 'cmd_aliases', 'a', 'traits', 'ARRAY(0x1ee1130)' ) called at / home / adam / . plenv / versions / puju-perl / lib / site_perl / 5.18.2 / x86_64-linux / Moose / Meta / Class . pm line 709
  Moose::Meta::Class::_process_attribute( 'Moose::Meta::Class=HASH(0x1edcbd8)', 'autogen', 'definition_context', 'HASH(0x1b05e78)', 'is', 'rw', 'isa', 'Bool', 'documentation', 'autogenerate hooks', 'cmd_aliases', 'a', 'traits', 'ARRAY(0x1ee1130)' ) called at / home / adam / . plenv / versions / puju-perl / lib / site_perl / 5.18.2 / x86_64-linux / Moose / Meta / Class . pm line 573
  Moose::Meta::Class::add_attribute( 'Moose::Meta::Class=HASH(0x1edcbd8)', 'autogen', 'definition_context', 'HASH(0x1b05e78)', 'is', 'rw', 'isa', 'Bool', 'documentation', 'autogenerate hooks', 'cmd_aliases', 'a', 'traits', 'ARRAY(0x1ee1130)' ) called at / home / adam / . plenv / versions / puju-perl / lib / site_perl / 5.18.2 / x86_64-linux / Moose . pm line 77
  Moose::has( 'Moose::Meta::Class=HASH(0x1edcbd8)', 'autogen', 'is', 'rw', 'isa', 'Bool', 'documentation', 'autogenerate hooks', 'cmd_aliases', 'a', 'traits', 'ARRAY(0x1ee1130)' ) called at / home / adam / . plenv / versions / puju-perl / lib / site_perl / 5.18.2 / x86_64-linux /Moose/ Exporter . pm line 405
  Moose::has( 'autogen', 'is', 'rw', 'isa', 'Bool', 'documentation', 'autogenerate hooks', 'cmd_aliases', 'a', 'traits', 'ARRAY(0x1ee1130)' ) called at / home / adam / . plenv / versions / puju-perl / lib / site_perl / 5.18.2 / Puju / Command / hook . pm line 9
  require Puju / Command / hook . pm at / home / adam / . plenv / versions / puju-perl / lib / site_perl / 5.18.2 / Module / Runtime . pm line 317
  Module::Runtime::require_module('Puju::Command::hook') called at / home / adam / . plenv / versions / puju-perl / lib / site_perl / 5.18.2 / Class / Load . pm line 177
  Class::Load::try { ... } at / home / adam / . plenv / versions / puju-perl / lib / site_perl / 5.18.2 / Try / Tiny . pm line 76
  eval { ... } at / home / adam / . plenv / versions / puju-perl / lib / site_perl / 5.18.2 / Try / Tiny . pm line 72
  Try::Tiny::try( 'CODE(0x1edc968)', 'Try::Tiny::Catch=REF(0x1edccf8)' ) called at / home / adam / . plenv / versions / puju-perl / lib / site_perl / 5.18.2 / Class / Load . pm line 183
  Class::Load::try_load_class( 'Puju::Command::hook', undef ) called at / home / adam / . plenv / versions / puju-perl / lib / site_perl / 5.18.2 / Class / Load . pm line 38
  Class::Load::load_class('Puju::Command::hook') called at / home / adam / . plenv / versions / puju-perl / lib / site_perl / 5.18.2 / App / Cmd . pm line 98
  App::Cmd::_command( 'Puju', 'HASH(0xf6bd40)' ) called at / home / adam / . plenv / versions / puju-perl / lib / site_perl / 5.18.2 / MooseX / App / Cmd . pm line 23
  MooseX::App::Cmd::BUILD( 'Puju=HASH(0xf6bd28)', 'HASH(0xf6bd58)' ) called at constructor Puju::new( defined at / home / adam / . plenv / versions / puju-perl / lib / site_perl / 5.18.2 / Puju . pm line 8 ) line 10
  Puju::new('Puju') called at / home / adam / . plenv / versions / puju-perl / lib / site_perl / 5.18.2 / App / Cmd . pm line 203
  App::Cmd::run('Puju') called at / home / adam / . plenv / versions / puju-perl / bin / puju line 7
  Compilation failed in require at / home / adam / . plenv / versions / puju-perl / lib / site_perl / 5.18.2 / App / Cmd . pm line 203.

Once I manually installed MooseX::Getopt everything worked again.

Site note: Speaking with Ether she indicated that Any::Moose is deprecated

+1 for this -- the module abstract is "Mashes up MooseX::Getopt and App::Cmd". Given that, not having a dependency on MooseX::Getopt seems really counter-intuitive.

What was the reason for removing the dep?

IMO the hard dep on MooseX::Getopt should be re-added, and all the Mouse stuff split off into its own dist. Shipping Moose- and Mouse-related code in one dist doesn't really make a lot of sense.

FWIW, after Mouse stuff is split out, I'm willing to take this dist into the fold of the Moose organization (I've already forked the dist there, as it was looking for a few minutes like an emergency release was needed today)

Sorry for the delays, have been heads-down on a $work project. I will try to deal with this ASAP before the week is out.

@mjgardner totally understand thanks for the quick update

Is there any update?

ping.

ping, any news?