From: Peter Rabbitson Date: Tue, 26 Jul 2016 17:41:27 +0000 (+0200) Subject: Enable the schema SanChecks on 5.8 as well X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=58c8eea05831756529c053be936eeba5483831de;p=dbsrgits%2FDBIx-Class.git Enable the schema SanChecks on 5.8 as well See how DarkPAN will react to this - it may be just fine. Backing it out in a standalone commit so it can be reinstated easily before stable --- diff --git a/lib/DBIx/Class/Schema.pm b/lib/DBIx/Class/Schema.pm index 17a8bba..19434b4 100644 --- a/lib/DBIx/Class/Schema.pm +++ b/lib/DBIx/Class/Schema.pm @@ -30,7 +30,6 @@ __PACKAGE__->mk_classaccessor('source_registrations' => {}); __PACKAGE__->mk_group_accessors( component_class => 'schema_sanity_checker' ); __PACKAGE__->schema_sanity_checker( - DBIx::Class::_ENV_::OLD_MRO ? false : 'DBIx::Class::Schema::SanityChecker' ); @@ -926,47 +925,6 @@ sub connection { $storage->connect_info(\@info); $self->storage($storage); - -### -### Begin 5.8 "you have not selected a checker" warning -### - # We can not blanket-enable this on 5.8 - it is just too expensive for - # day to day execution. We also can't just go silent - there are genuine - # regressions ( due to core changes) for which this is the only line of - # defense. So instead we whine on STDERR that folks need to do something - # - # Beyond suboptimal, but given the constraints the best we can do :( - # - # This should stay around for at least 3~4 years - # - DBIx::Class::_ENV_::OLD_MRO - and - ! $default_off_stderr_blurb_emitted - and - length ref $self->schema_sanity_checker - and - length ref __PACKAGE__->schema_sanity_checker - and - ( - refaddr( $self->schema_sanity_checker ) - == - refaddr( __PACKAGE__->schema_sanity_checker ) - ) - and - emit_loud_diag( - msg => sprintf( - "Sanity checks for schema %s are disabled on this perl $]: " - . '*THIS IS POTENTIALLY VERY DANGEROUS*. You are strongly urged to ' - . "read http://is.gd/dbic_sancheck_5_008 before proceeding\n", - ( defined( blessed $self ) ? refdesc $self : "'$self'" ) - )) - and - $default_off_stderr_blurb_emitted = 1; -### -### End 5.8 "you have not selected a checker" warning -### - - if( my $checker = $self->schema_sanity_checker ) { $checker->perform_schema_sanity_checks($self); } diff --git a/lib/DBIx/Class/Schema/SanityChecker.pm b/lib/DBIx/Class/Schema/SanityChecker.pm index e4ca5b3..481d0f7 100644 --- a/lib/DBIx/Class/Schema/SanityChecker.pm +++ b/lib/DBIx/Class/Schema/SanityChecker.pm @@ -21,7 +21,7 @@ DBIx::Class::Schema::SanityChecker - Extensible "critic" for your Schema class h package MyApp::Schema; use base 'DBIx::Class::Schema'; - # this is the default on Perl v5.10 and later + # this is the default setting __PACKAGE__->schema_sanity_checker('DBIx::Class::Schema::SanityChecker'); ... @@ -30,8 +30,8 @@ DBIx::Class::Schema::SanityChecker - Extensible "critic" for your Schema class h This is the default implementation of the Schema and related classes L. -The validator is B on perls C and above. See -L for discussion of the runtime effects. +The validator is B. See L +for discussion of the runtime effects. Use of this class begins by invoking L (usually via L), which in turn starts @@ -101,11 +101,6 @@ test execution time (these numbers are observed with the speedups of L available, without them the slowdown reaches the whopping C<350%>). -Therefore, on these versions of perl the sanity checks are B by -default. Instead a C placeholder value is inserted into the -L, -urging the user to decide for themselves how to proceed. - It is the author's B recommendation to find a way to run the checks on your codebase continuously, even if it takes much longer. Refer to the last paragraph of L above for an example how