7 years agoSome test suite corrections ahead of next commits
Peter Rabbitson [Mon, 23 May 2016 09:08:17 +0000]
Some test suite corrections ahead of next commits

Splitting this off for easier reading

7 years agoAn extra bit of diag on incomplete rsrc re-register
Peter Rabbitson [Fri, 22 Jul 2016 10:59:40 +0000]
An extra bit of diag on incomplete rsrc re-register

Due to the counterintuitive nature of the metadata subsystem, a user wishing
to modify the metadata for a result class at runtime (post $schema instance
initialization), may end up in a situation where *everything* appears to work
but falls apart on the next call to My::Schema->connect. In fact I myself made
this very mistake in https://github.com/ctrlo/GADS/pull/1/files, even though
I was pretty well aware of the dangers at the time.

In order to make this go away for good reuse the meta-metadata kept around to
track rsrc ancestry and modifications, and emit a warning alerting folks to
the potential problem (the *actual* problematic desync will also be warned
about at a later step by the stale-metadata diag).

7 years agoComprehensive diagnostic on incorrect ResultSource metadata use
Peter Rabbitson [Fri, 22 Apr 2016 10:39:00 +0000]
Comprehensive diagnostic on incorrect ResultSource metadata use

This commit is the second part of the permanent RT#107462 solution f064a2ab.
Given the amount of changes to the resultsource metadata subsystem, I can
not be certain that everything has been accounted for, even despite the
comprehensive assertion harness added in the previous commits passing with
flying colors on the entire reverse dep list detailed in c8b1011e.

As Dave Howorth correctly pointed out in [1], the diagnostic of why something
stopped working within the metadata subsystem is pretty daunting, especially
given the ass-backward nature of DBIC's implementation of it. The (minimal
but present) performance hit is deemed worth it in order to be able to
present this information to downstream. One unexpected bit of good news is
that none of the downstreams tested emitted the warning, which is an extra
point of confidence that the main change of f064a2ab, and the even more
dangerous change in 9e36e3ec are both solid.

The gist here is that this:

~/devel/dbic$ perl -Ilib -It/lib -MDBICTest -e '
  my $art = DBICTest->init_schema->resultset("Artist")->find(1);

  DBICTest::Schema::Artist->add_column("foo");

  DBICTest::Schema->source("Artist")->add_columns("foo");

  $art->has_column("foo");
'

now emits a comprehensive non-trappable warning along the lines of:

DBIx::Class::ResultSource::Table=HASH(0x2a32660) (the metadata instance
of source 'Artist') is *OUTDATED*, and does not reflect the modifications
of its *ancestors* as follows:
  * DBIx::Class::ResultSource::Table=HASH(0x24ed770)->add_column(...) at -e line 4
  * DBIx::Class::ResultSource::Table=HASH(0x2955da8)->add_columns(...) at -e line 6
Stale metadata accessed by 'getter' DBIx::Class::ResultSource::Table=HASH(0x2a32660)->has_column(...)
  within the callstack beginning at lib/DBIx/Class/ResultSource.pm line 231.
DBIx::Class::ResultSource::get_rsrc_instance_specific_attribute(DBIx::Class::ResultSource::Table=HASH(0x2a32660), "_columns") called at (eval 95) line 2
DBIx::Class::ResultSource::_columns(DBIx::Class::ResultSource::Table=HASH(0x2a32660)) called at lib/DBIx/Class/ResultSource.pm line 732
DBIx::Class::ResultSource::has_column(DBIx::Class::ResultSource::Table=HASH(0x2a32660), "foo") called at (eval 70) line 19
DBIx::Class::ResultSourceProxy::has_column(DBICTest::Artist=HASH(0x311e338), "foo") called at -e line 8

The performance hit consistently measures in the ~1.5% range: the test suite
of @frioux's DBIx::Class::Helpers v2.032002 consistently completes within
roughly ~63.7 CPU seconds at the base of this branch, yet climbs to ~64.6 as
of this commit (on an idle low-clocked Xeon L3426)

The warning can not be disabled for the time being (aside from monkeypatching
DBIC::ResultSource) - the wide-range testing indicates it only fires on real
legitimate problems. Hopefully I am making the right call...

[1] http://lists.scsys.co.uk/pipermail/dbix-class/2016-January/012127.html

7 years agoCentralize all user-side rsrc calls to go through result_source()
Peter Rabbitson [Thu, 14 Apr 2016 22:33:17 +0000]
Centralize all user-side rsrc calls to go through result_source()

This ensures the user will always get a sensible exception when the rsrc
metadata object has not yet been initialized (as introduced in 5298bbb5):

Before:
 ~$ perl -e 'use base "DBIx::Class::Core"; __PACKAGE__->add_column("foo")'
 Can't locate object method "result_source_instance" via package "main" at .../ResultSourceProxy.pm line 29.

After:
 ~$ perl -e 'use base "DBIx::Class::Core"; __PACKAGE__->add_column("foo")'
 DBIx::Class::Row::result_source(): No ResultSource instance registered for 'main', did you forget to call main->table(...) ? at -e line 1

Add a shitload of assertions to track we are doing the right thing in all
cases. This more or less concludes the rsrc changeset necessary to resolve
all ambiguities. The next commit adds user-visible warnings when things go
off the rails

The changeset was successfully tested against the list of distributions
in c8b1011e with no ill effects being observed. Thus I am pretty damn
confident I rather nailed it >.>

7 years agoFold column_info() into columns_info()
Peter Rabbitson [Mon, 6 Jun 2016 12:34:55 +0000]
Fold column_info() into columns_info()

Not sure how I never noticed the utter code duplication.

7 years agoResolve $rsrc instance duality on metadata traversal
Peter Rabbitson [Mon, 25 Apr 2016 09:53:54 +0000]
Resolve $rsrc instance duality on metadata traversal

Make result_source a straight wrapper around result_source_instance. This
should fix all the fallout introduced in 0.082800 (4006691d), which sadly
went undetected all the way until ~7 months after its release. Ultimately
this is my fault, as I had an early warning, and even later made a conjecture
which spot exactly may blow up in my face (read towards end of 350e8d57)

Exploit the fact that result_source_instance until very recently was a toss-up
between a CAG 'inherited' and a Class::Data::Inheritable (removed in 5e0eea35)
with CAG not really involved in result-instance level calls, and the latter
making it downright impractical due to the closure-based approach. Combined
with the fact that result_source was a 'simple'-type accessor pointing at
the '_result_source' hash-slot allows us (at least seemingly) to switch to a
setup where result_source is nothing but a wrapper around a CAG inherited
accessor result_source_instance which point to the named slot '_result_source'

The changeset is deceptively small, and is kept this way for easier auditing.
See next commit for the armada of additional testing to verify the entire
stack is in fact still solid.

7 years agoKeep track of result source instance ancestry
Peter Rabbitson [Thu, 14 Apr 2016 07:27:33 +0000]
Keep track of result source instance ancestry

The oddball external registry (instead of directly-linked objects) is due
to shit like 31399b48

For now this doesn't realy do anything: See several commits higher why this
is needed in the first place.

7 years agoFully separate parent and child resultsource metadata
Peter Rabbitson [Fri, 13 May 2016 17:15:18 +0000]
Fully separate parent and child resultsource metadata

Ensure that all attributes are shallow-copied on "clone". Currently this
means that the following are *NO LONGER* shared between rsrc clones:

_unique_constraints
_primaries
source_info

This seems just as cocky and reckless as the clusterfuck in 4006691d/RT#107462
and it most likely will have the same invisible-yet-dire consequences for
various downstreams. However there is a plan in place several commits ahead
allowing sidestepping the impossibility to debug a potential fallout.

7 years agoAdd a clone method to ResultSource, switch obvious spots to it
Peter Rabbitson [Thu, 7 Apr 2016 11:20:30 +0000]
Add a clone method to ResultSource, switch obvious spots to it

Not messing with the ::ResultSourceProxy::Table clusterfuck for now, too many
things can go wrong. Instead will explicitly instrument the callsites in
subsequent commits.

Also add assertions this does not get routed around: such use will throw from
here on out as long as one enables the necessary assert:

~$ DBIC_ASSERT_NO_ERRONEOUS_METAINSTANCE_USE=1 perl -Ilib -MDBIx::Class -e '
  bless ({}, "DBIx::Class::ResultSource")
'

7 years agoRevert C3-fication d009cb7d and fixups 7f068248 and 983f766d
Peter Rabbitson [Wed, 13 Jul 2016 13:45:37 +0000]
Revert C3-fication d009cb7d and fixups 7f068248 and 983f766d

While on its surface this was a good idea, it actually hides problems even
more: by the time we arrive at a useful hook-point to check the current MRO,
something likely already changed it from under us, and the old effects are
all masked away for good.

So instead scale back as much as possible, and set 'c3' where needed as
lazily as practical. In order to satisfy the mro requirements imposed by
5e0eea35 we do the "flip" during the ->source() stage.

Additionally we record the original setting any time we switch the mro on
foreign classes (two such spots in the codebase). A later commit will use
this information to add the final bit of sanity to this clusterfuck.

7 years agoRename variables/shuffle some code, preparing for next commits
Peter Rabbitson [Mon, 25 Apr 2016 09:53:54 +0000]
Rename variables/shuffle some code, preparing for next commits

Zero functional changes

Read under -w

7 years agoAbstract our internal capture_stderr test routine
Peter Rabbitson [Fri, 22 Jul 2016 12:15:53 +0000]
Abstract our internal capture_stderr test routine

Will need it for even more tests later on, but not sufficiently often to
warrant depending on Capture::Tiny - just go with what we need

7 years agoFix misleading error on deployment_statements in void ctx
Peter Rabbitson [Wed, 20 Jul 2016 12:13:49 +0000]
Fix misleading error on deployment_statements in void ctx

Due to how Context::Preserve operates the following would result in a
non-sensical error:

perl -MDBIx::Class::Schema -e '
  DBIx::Class::Schema->connect("dbi:SQLite::memory:")->deployment_statements;
  1
'

7 years agoFix false negatives in lean_startup.t
Peter Rabbitson [Wed, 20 Jul 2016 10:17:49 +0000]
Fix false negatives in lean_startup.t

Before this commit a 'use Devel::Dwarn' somewhere deep in e.g. ::SQLMaker
would *not* have been detected.

Also fix improperly applied C-ism: the following decidedly does not DTRT

 do 1 while { ... }

I never noticed this being a problem until a fatfingered `>&1` turned into
a `>1`, which in turn created a file named 1 in the current directory with
garbage in it, which *in turn* the `do 1 ...` tried to execute. Sigh...

7 years agoFix error-eating thinko from 6c7ca962
Peter Rabbitson [Sat, 16 Jul 2016 11:59:30 +0000]
Fix error-eating thinko from 6c7ca962

$@ is not visible in $SIG{__DIE__}

7 years agoRestore TODO checking for Taint + pkg_gen inconsitencies
Peter Rabbitson [Sat, 16 Jul 2016 11:52:00 +0000]
Restore TODO checking for Taint + pkg_gen inconsitencies

Now that https://github.com/Test-More/test-more/issues/683 we can bring the
TODO back - will get an alert for an eventual fix...

7 years agoAdd an explicit Sub::Quote dep in ::_Util
Peter Rabbitson [Sat, 16 Jul 2016 11:48:52 +0000]
Add an explicit Sub::Quote dep in ::_Util

Failures too confusing otherwise

7 years agoWork around the FIXME in the previous commit
Peter Rabbitson [Sat, 16 Jul 2016 11:29:40 +0000]
Work around the FIXME in the previous commit

Based on @haarg's excellent detective work: https://is.gd/perl_mro_taint_wtf

7 years agoGet rid of Package::Stash \o/
Peter Rabbitson [Thu, 14 Jul 2016 13:20:03 +0000]
Get rid of Package::Stash \o/

Internal tooling advanced sufficiently without planning for any of that:
a good indicator things are on the right track!

Read under -w

7 years agoAdd a get_subname to _Util
Peter Rabbitson [Thu, 14 Jul 2016 12:50:02 +0000]
Add a get_subname to _Util

7 years agoInsulate DBIC::Carp from rogue can() overrides
Peter Rabbitson [Wed, 13 Jul 2016 16:28:23 +0000]
Insulate DBIC::Carp from rogue can() overrides

7 years agoAdd more forceful (STDERR-direct) warning emitter
Peter Rabbitson [Thu, 14 Jul 2016 11:03:26 +0000]
Add more forceful (STDERR-direct) warning emitter

Switch some of the most critical announements to it

7 years agoFix POISON_ENV warning missed in both 5c33c8be and 44c1a75d
Peter Rabbitson [Thu, 30 Jun 2016 19:55:55 +0000]
Fix POISON_ENV warning missed in both 5c33c8be and 44c1a75d

7 years agoSilence inactionable warning (mainly on travis)
Peter Rabbitson [Wed, 13 Jul 2016 15:51:00 +0000]
Silence inactionable warning (mainly on travis)

7 years ago(travis) Switch to our own copy of the Firebird ODBC driver
Peter Rabbitson [Wed, 13 Jul 2016 15:57:18 +0000]
(travis) Switch to our own copy of the Firebird ODBC driver

Sourceforge is just way too unstable

7 years ago(travis) Properly diagnose potential OOM in 50_after_success.bash
Peter Rabbitson [Sun, 3 Jul 2016 08:43:20 +0000]
(travis) Properly diagnose potential OOM in 50_after_success.bash

Idea originally introduced in ac4e80df

7 years ago(travis) Add poisoning to the base non-clean build run
Peter Rabbitson [Wed, 29 Jun 2016 17:29:27 +0000]
(travis) Add poisoning to the base non-clean build run

7 years agoFill in missing documentation in ::Schema / ::ResultSource
Peter Rabbitson [Fri, 24 Jun 2016 16:31:01 +0000]
Fill in missing documentation in ::Schema / ::ResultSource

7 years agoAudit all local() calls within lib/ and t/lib
Peter Rabbitson [Fri, 1 Jul 2016 10:22:48 +0000]
Audit all local() calls within lib/ and t/lib

Correct some of them to fire less frequently (local is *expensive*)

7 years agoExpand describe_class_methods testing yet again
Peter Rabbitson [Mon, 27 Jun 2016 08:29:27 +0000]
Expand describe_class_methods testing yet again

This should be the end of adjustments, so many corner cases...

7 years agoUse a single cache struct for entirety of describe_class_methods
Peter Rabbitson [Wed, 29 Jun 2016 22:49:39 +0000]
Use a single cache struct for entirety of describe_class_methods

This will allow influencing the cache from outside like shown below, (but
please, DO NOT DO SO), and in turn will make sanity checks on 5.8 somewhat
acceptable *by default* \o/

  $...::__describe_class_query_cache->{"!internal!"} = {};

7 years agoAdd hash-based ISA lookup to RV of describe_class_methods
Peter Rabbitson [Wed, 29 Jun 2016 22:40:15 +0000]
Add hash-based ISA lookup to RV of describe_class_methods

7 years agoExpand signature of describe_class_methods for forward compat
Peter Rabbitson [Wed, 29 Jun 2016 13:32:00 +0000]
Expand signature of describe_class_methods for forward compat

It is likely extra options/attrs will need to be passed down the road -
hence do not lock ourselves into positional args

7 years agoRaise the global lock timeouts
Peter Rabbitson [Sat, 4 Jun 2016 09:23:17 +0000]
Raise the global lock timeouts

15 minutes on my laptop on battery with all assertions no longer cuts it :(

7 years agoAdd true/false non-singleton boolean objects
Peter Rabbitson [Fri, 3 Jun 2016 14:12:32 +0000]
Add true/false non-singleton boolean objects

This will be needed for the sanitychecker on OLD_MRO

7 years agoExtra test of UNIVERSAL handling in describe_class_methods
Peter Rabbitson [Thu, 23 Jun 2016 12:18:06 +0000]
Extra test of UNIVERSAL handling in describe_class_methods

While parents of UNIVERSAL *do* "inherit" some of UNIVERSAL's methods, making
this circularity apparent is out of scope for this tool. Doing otherwise will
complicate consumer code for no apparent benefit. Thus add an explicit test
that "this is how it is".

7 years agoRevert TempExtlib ( b46b85376 ) - new Sub::Quote shipped
Peter Rabbitson [Tue, 21 Jun 2016 14:34:14 +0000]
Revert TempExtlib ( b46b85376 ) - new Sub::Quote shipped

7 years agoBring out the big-paranoia-harness - make describe_env infallible
Peter Rabbitson [Tue, 21 Jun 2016 14:24:29 +0000]
Bring out the big-paranoia-harness - make describe_env infallible

As desmonstrated by the previous commit: testing is no substitute for proper
defensive programs. Stop-gap until this is spun off on its own

7 years agoFix describe_env failure on nonexistent @INC on Win32
Peter Rabbitson [Tue, 21 Jun 2016 06:41:10 +0000]
Fix describe_env failure on nonexistent @INC on Win32

Despite this code undergoing wide CPAN testing last year, and having zero
functional changes since, there were *still* bugs lurking inside :/

7 years agoMinor cosmetic fix of describe_environment
Peter Rabbitson [Tue, 21 Jun 2016 09:07:45 +0000]
Minor cosmetic fix of describe_environment

7 years agoFix false-positives in the no-external-evals assert ( ddcc02d14 )
Peter Rabbitson [Tue, 21 Jun 2016 12:46:25 +0000]
Fix false-positives in the no-external-evals assert ( ddcc02d14 )

If there is no eval frame above the exception action - there is nothing to
report to the user

7 years agoAdd 'PERL_VERSION' foldable constant, switch lib-ish things over
Peter Rabbitson [Mon, 20 Jun 2016 20:58:32 +0000]
Add 'PERL_VERSION' foldable constant, switch lib-ish things over

No point changing the many $] references in .t's themselves

7 years agoMinor improvements to the maint helper scripts
Peter Rabbitson [Mon, 20 Jun 2016 17:00:09 +0000]
Minor improvements to the maint helper scripts

7 years agoRestore 'timezone' field in column info ( extends eef9b484 )
Dagfinn Ilmari Mannsåker [Sat, 18 Jun 2016 11:37:10 +0000]
Restore 'timezone' field in column info ( extends eef9b484 )

The keys in the column info hash are semi-public API, and 'timezone' in
particular is used by DBIx::Class::InflateColumn::DateTime::WithTimeZone.

Keep documenting time_zone as the main name, but note that it's stored
under both keys.

7 years agoProper changelog after I bothced it in e400c82d
Peter Rabbitson [Mon, 20 Jun 2016 07:21:50 +0000]
Proper changelog after I bothced it in e400c82d

7 years agoEnsure describe_environment does not break its output in half
Peter Rabbitson [Sun, 19 Jun 2016 05:48:27 +0000]
Ensure describe_environment does not break its output in half

7 years agoSlight POD correction
Peter Rabbitson [Sat, 18 Jun 2016 09:51:10 +0000]
Slight POD correction

7 years agoAdd changelog entry on 90c9dd1d, 757891ed and 89203568
Peter Rabbitson [Wed, 4 Nov 2015 03:18:01 +0000]
Add changelog entry on 90c9dd1d, 757891ed and 89203568

Sample (not ideal - could be *SO* much better ) timings from included bencher:

Before (0.0828xx):
62951 byte-long query generated (via as_query()) in: 4.975237 seconds (take 1)
62951 byte-long query generated (via as_query()) in: 4.995723 seconds (take 2)
62951 byte-long query generated (via as_query()) in: 4.964793 seconds (take 3)
62951 byte-long query generated (via as_query()) in: 4.96168 seconds (take 4)
62951 byte-long query generated (via as_query()) in: 4.991396 seconds (take 5)
62951 byte-long query generated (via as_query()) in: 4.988478 seconds (take 6)
62951 byte-long query generated (via as_query()) in: 4.977612 seconds (take 7)
62951 byte-long query generated (via as_query()) in: 4.98648 seconds (take 8)
62951 byte-long query generated (via as_query()) in: 4.999984 seconds (take 9)

After:
62951 byte-long query generated (via as_query()) in: 0.429634 seconds (take 1)
62951 byte-long query generated (via as_query()) in: 0.416169 seconds (take 2)
62951 byte-long query generated (via as_query()) in: 0.430782 seconds (take 3)
62951 byte-long query generated (via as_query()) in: 0.416879 seconds (take 4)
62951 byte-long query generated (via as_query()) in: 0.426492 seconds (take 5)
62951 byte-long query generated (via as_query()) in: 0.428975 seconds (take 6)
62951 byte-long query generated (via as_query()) in: 0.413018 seconds (take 7)
62951 byte-long query generated (via as_query()) in: 0.428731 seconds (take 8)
62951 byte-long query generated (via as_query()) in: 0.413206 seconds (take 9)

7 years agoRemove changelog entries included in 0.082830
Peter Rabbitson [Fri, 17 Jun 2016 14:06:55 +0000]
Remove changelog entries included in 0.082830

7 years agoSimplify our quote_sub override: Sub::Quote now has native attr support
Peter Rabbitson [Wed, 15 Jun 2016 10:31:53 +0000]
Simplify our quote_sub override: Sub::Quote now has native attr support

7 years agoChange the leaktracer to no longer rely on %Sub::Quote::QUOTED
Peter Rabbitson [Thu, 16 Jun 2016 15:40:44 +0000]
Change the leaktracer to no longer rely on %Sub::Quote::QUOTED

Frees up @haarg to do as he sees fit in the future

7 years agoRemove useless eval in the leaktracer on 5.8.3+
Peter Rabbitson [Thu, 16 Jun 2016 22:21:23 +0000]
Remove useless eval in the leaktracer on 5.8.3+

As a bonus fix a subtle bug where the very first ref encountered was never
traced, as the postincrement caused its slot to be deleted - ARGH!

7 years agoRemove code forgotten in 085dbdd69
Peter Rabbitson [Thu, 16 Jun 2016 15:01:02 +0000]
Remove code forgotten in 085dbdd69

7 years agoRemove preemptive DESTROY guard from 87f4bab0 / d63c9e64
Peter Rabbitson [Tue, 14 Jun 2016 10:32:34 +0000]
Remove preemptive DESTROY guard from 87f4bab0 / d63c9e64

It has been on CPAN sufficiently long, and would be needlesly pessimizing
the upcoming sanity check framework.

7 years agoAllow alternative mro-type specification on method listing
Peter Rabbitson [Tue, 14 Jun 2016 08:35:50 +0000]
Allow alternative mro-type specification on method listing

This is needed for the mro sanity check further up

7 years agoAccount for 'poor man role application' method plumbing on 5.8
Peter Rabbitson [Tue, 14 Jun 2016 06:18:35 +0000]
Account for 'poor man role application' method plumbing on 5.8

This also has the effect of greatly simplifying the OLD_MRO case

7 years agoProperly handle UNIVERSAL ancestry in describe_class_methods
Peter Rabbitson [Mon, 13 Jun 2016 16:43:31 +0000]
Properly handle UNIVERSAL ancestry in describe_class_methods

Obscure but possible nevertheless.

7 years agoFix describe_class_methods on non-mergeable DFS mro
Peter Rabbitson [Tue, 14 Jun 2016 16:05:51 +0000]
Fix describe_class_methods on non-mergeable DFS mro

Instead of trying to deduplicate - simply track which methods are locally
defined, and use that info combined with a reverse ISA-per-select-MRO to
build the final stack.

As a result the code is even more efficient and can now deal with real-life
insane hierarchies like:

https://metacpan.org/source/MJFLICK/DBIx-Class-Bootstrap-Simple-0.03/lib/DBIx/Class/Bootstrap/Simple.pm#L93

7 years agoName describe_class_methods arguments earlier
Peter Rabbitson [Tue, 14 Jun 2016 07:18:48 +0000]
Name describe_class_methods arguments earlier

The attribute::get() caching seems to only add noise in benchmarks,
so remove that. Same for the pre-check on recursion - remove that as well

7 years agoFix m2m regression from 8a67d9cf (simple but deadly)
Peter Rabbitson [Fri, 10 Jun 2016 06:22:38 +0000]
Fix m2m regression from 8a67d9cf (simple but deadly)

7 years agoAdd extra maint tooling - got tired of writing this smoke cmd by hand
Peter Rabbitson [Thu, 9 Jun 2016 09:06:39 +0000]
Add extra maint tooling - got tired of writing this smoke cmd by hand

7 years ago(travis) Temporarily disable {halt_on_failure} for cperl
Peter Rabbitson [Fri, 10 Jun 2016 06:31:56 +0000]
(travis) Temporarily disable {halt_on_failure} for cperl

It is not clear whether there is a way around the root cause:
https://github.com/rurban/distroprefs/commit/30792f7e95ca76ac1c1e73d0662dce22168c9df9#commitcomment-17817389

7 years ago(travis) Revert parts of e66f0ee0 and ee3a37d3
Peter Rabbitson [Fri, 10 Jun 2016 06:13:30 +0000]
(travis) Revert parts of e66f0ee0 and ee3a37d3

The typing of @array * $int got relaxed, and it turns out c5.22.2 worked
just fine *without* distroprefs, so I never noticed them being ignored

7 years ago(travis) Work around a bad tradeoff in cperl-5.24-to-be
Peter Rabbitson [Wed, 8 Jun 2016 07:47:56 +0000]
(travis) Work around a bad tradeoff in cperl-5.24-to-be

https://github.com/perl11/cperl/issues/153#issuecomment-224515895
http://irclog.perlgeek.de/perl11/2016-06-08#i_12624951

7 years ago(travis) Add cperl master to the smoke roster, bump to 5.22.3
Peter Rabbitson [Thu, 2 Jun 2016 17:55:31 +0000]
(travis) Add cperl master to the smoke roster, bump to 5.22.3

7 years ago(travis) Report the perl (and vm state) early before deps can fail
Peter Rabbitson [Tue, 7 Jun 2016 17:21:54 +0000]
(travis) Report the perl (and vm state) early before deps can fail

7 years ago(travis) Mini-utility to download travis reports
Peter Rabbitson [Tue, 7 Jun 2016 15:22:11 +0000]
(travis) Mini-utility to download travis reports

I've had enough waiting for their shit site :/

7 years agoBase more tests on DBICTest::BaseSchema (needed further up)
Peter Rabbitson [Sun, 5 Jun 2016 10:00:43 +0000]
Base more tests on DBICTest::BaseSchema (needed further up)

7 years agoAnd yet another INDIRECT guard missed in both e5053694 and d99f2db7
Peter Rabbitson [Mon, 6 Jun 2016 12:59:44 +0000]
And yet another INDIRECT guard missed in both e5053694 and d99f2db7

7 years agoIntroduce the describe_class_methods() utility function
Peter Rabbitson [Wed, 1 Jun 2016 08:46:28 +0000]
Introduce the describe_class_methods() utility function

This code will be needed several commits later to tie together the hierarchy
validation work.

Returns a comprehensive list of methods and related trivia. This required
way more code than one would hope, this part of perl is *really* hateful.

Read test changes under -w

Everything is implemented on "bare metal" (no Package::Stash, very aggressive
caching) as this needs to be as efficient as possible. Currently timings on
old and new MRO are roughly such on a downclocked X201 / M540:

~/devel/dbic$ perlbrew exec --with 5.8.5,5.16.2,5.24.0_rc1 \
  perl -T -Ilib -It/lib -MDBICTest -MTime::HiRes=time -e '
    my $t0 = time;
    sub tstamp {
      printf "%.6f\n", time - $t0;
      $t0 = time;
    }

    tstamp();

    for ( (qw(
      DBICTest::Schema::Artist
      DBICTest::Schema::CD
      DBICTest::Schema::Track
      main
    )) x 2 ) {
      print "describing $_\n";
      DBIx::Class::_Util::describe_class_methods($_);
      tstamp();
    }
  '

5.8.5
==========
0.000005
describing DBICTest::Schema::Artist
0.224748
describing DBICTest::Schema::CD
0.066118
describing DBICTest::Schema::Track
0.090433
describing main
0.003152
describing DBICTest::Schema::Artist
0.038846
describing DBICTest::Schema::CD
0.038390
describing DBICTest::Schema::Track
0.043453
describing main
0.002128

5.16.2
==========
0.000005
describing DBICTest::Schema::Artist
0.077804
describing DBICTest::Schema::CD
0.007684
describing DBICTest::Schema::Track
0.013071
describing main
0.001073
describing DBICTest::Schema::Artist
0.000109
describing DBICTest::Schema::CD
0.000096
describing DBICTest::Schema::Track
0.000098
describing main
0.000041

5.24.0_rc1
==========
0.000005
describing DBICTest::Schema::Artist
0.044058
describing DBICTest::Schema::CD
0.006093
describing DBICTest::Schema::Track
0.011004
describing main
0.000735
describing DBICTest::Schema::Artist
0.000118
describing DBICTest::Schema::CD
0.000114
describing DBICTest::Schema::Track
0.000113
describing main
0.000059

Additional sanity-checking of this deceptively simple code was performed by
sad brute-forcing of the entire test schema set ( at the time of this commit
the cumulative sum output was 0x1a65e78e316348104ab9cdc3e474c79096 )

perlbrew exec --with 5.8.5,5.10.0,5.16.2,5.18.0,5.20.0,5.24.0_rc1 \
perl -T -Ilib -It/lib -MDBICTest -e '
  use Math::BigInt;
  use Digest::MD5 "md5_hex";
  use List::Util 'shuffle';
  use Data::Dumper::Concise;
  use DBIx::Class::_Util qw( describe_class_methods uniq );

  my $sum = Math::BigInt->new(0);

  for ( shuffle uniq sort map { ( defined Scalar::Util::blessed $_ ) ? ref $_ : $_ } (
    qw(
      DBIx::Class::ResultSource
      DBIx::Class::Core
      DBIx::Class::ResultSet
      DBICTest::Schema
    ),
    ( map {
      $_,
      $_->result_class,
      $_->resultset_class,
    } map { DBICTest::Schema->source($_) } DBICTest::Schema->sources ),
  ) ) {
    my $desc = describe_class_methods($_);

    # unstable between invocations
    delete $desc->{cumulative_gen};

    # only available on 5.10+
    delete $desc->{methods}{DOES};

    # only available on 5.18+
    delete $desc->{methods}{"(("};

    $sum += Math::BigInt->new( "0x" . md5_hex(Dumper($desc)) );
  }

  print $sum->as_hex;
'

7 years agoIntroduce DBIC-specific method attribute support
Peter Rabbitson [Wed, 25 May 2016 09:44:20 +0000]
Introduce DBIC-specific method attribute support

When attribute support was added back in ed28f830 it was done in a weird
roundabout manner, with the only way to access the attributes via a chained
class accessor __attr_cache hidden behind a cascading method _attr_cache.

This is wasteful and rather inelegant. To mitigate this, and the propensity
of DBIC to eat any attribute it can lay its hands on, introduce special
handling for attributes prefixed with DBIC_

Any such attributes are handled by a much simpler storage system, and are
not made available to the legacy _attr_cache interface.

7 years agoAttribute handling got too complex - move it into a component
Peter Rabbitson [Sun, 29 May 2016 14:50:02 +0000]
Attribute handling got too complex - move it into a component

No functional changes, just c/p code around
For some reason git diff -C -C -M doesn't work here...

7 years agoProper attribute support under ithreads (fix 7bd921c0)
Peter Rabbitson [Sun, 29 May 2016 14:00:22 +0000]
Proper attribute support under ithreads (fix 7bd921c0)

The previous implementation was rushed (for decidedly non-technical reasons)
and is predictably completely wrong :/

Properly fix renumbering of the registry, and add a double-thread test to
catch future problems

Read under --color-words

7 years agoExpand the c3 mro test from d009cb7d
Peter Rabbitson [Mon, 30 May 2016 09:04:54 +0000]
Expand the c3 mro test from d009cb7d

No functional changes

7 years agoCorrect mistake in t/00describe_environment.t reporting of _TempExtlib
Peter Rabbitson [Mon, 30 May 2016 14:44:05 +0000]
Correct mistake in t/00describe_environment.t reporting of _TempExtlib

This isn't actually correct, but is a reasonable approximation. The entire
thing needs to be rewritten, but that's another fight

7 years agoRevert c9f4555e - I did not see a mistake I made in the skip-regex
Peter Rabbitson [Thu, 26 May 2016 19:21:05 +0000]
Revert c9f4555e - I did not see a mistake I made in the skip-regex

ribasushi-- # get your fucking act together...

7 years agoExpand/fortify the handling of attributes
Peter Rabbitson [Wed, 25 May 2016 08:00:58 +0000]
Expand/fortify the handling of attributes

Now works properly under ithreads, and allows multiple attributes->import()
calls to be made on the same cref

7 years agoMove even more utils into DBIC::_Util (see next commit)
Peter Rabbitson [Wed, 25 May 2016 12:19:13 +0000]
Move even more utils into DBIC::_Util (see next commit)

Zero functional changes

7 years agoPrevent CLONE from potentially running more than once
Peter Rabbitson [Thu, 26 May 2016 15:02:06 +0000]
Prevent CLONE from potentially running more than once

Argh, another thing I didn't know about iThreads: CLONE will run for every
package defining *or inheriting* it. Sigh...

7 years agoFix more taint.t failures under local::lib
Peter Rabbitson [Wed, 25 May 2016 15:14:23 +0000]
Fix more taint.t failures under local::lib

Add a CI run under l::l (when POISON_ENV is set) to weed this problem out
once and for all

Also relegate the test to xt/ - it will still run on smokers given 554484cb
and has no value failing on an end-user system (CI runs the entire suite
under prove -T anyhow)

7 years agoSkip lean_startup.t entirely on cperl for now
Peter Rabbitson [Thu, 26 May 2016 11:51:57 +0000]
Skip lean_startup.t entirely on cperl for now

7 years agoCouple things forgotten during 399b9455/b46b8537
Peter Rabbitson [Wed, 25 May 2016 10:54:31 +0000]
Couple things forgotten during 399b9455/b46b8537

7 years agoBetter lean startup skip in require override
Peter Rabbitson [Thu, 26 May 2016 10:17:29 +0000]
Better lean startup skip in require override

ribasushi-- # didn't think through this kind of thing can happen more widely

7 years agoAdd preliminary non-core attribute support
Peter Rabbitson [Tue, 24 May 2016 10:38:16 +0000]
Add preliminary non-core attribute support

This is done in such a "cargocult" way to unblock the rsrc work.
Will be gutted out once Moo 2.002 ships

7 years agoForce no_defer on DBIC-internal quote_sub() invocations
Peter Rabbitson [Mon, 23 May 2016 17:42:56 +0000]
Force no_defer on DBIC-internal quote_sub() invocations

7 years agoBring back _TempExtlib (d0435d75), this time for Sub::Quote
Peter Rabbitson [Tue, 24 May 2016 11:16:34 +0000]
Bring back _TempExtlib (d0435d75), this time for Sub::Quote

And this is the part that brings back the to-be-removed portion (unlike the
previous 399b9455 which is here to stay)

See next commit for why we need this, to be removed once Moo $next ships

7 years agoAdd permanent plumbing for _TempExtlib (d0435d75)
Peter Rabbitson [Tue, 24 May 2016 12:36:41 +0000]
Add permanent plumbing for _TempExtlib (d0435d75)

Since this is the second time we need this, there likely will be more down the
road. Split the permanenet and temporary parts into two commits so reverting
is less of a PITA.

This commit contains the pieces that are perfectly fine to lay dormant until
times we need _TempExtlib

7 years agoRemove last active reference to List::Util from lib/
Peter Rabbitson [Tue, 24 May 2016 08:40:12 +0000]
Remove last active reference to List::Util from lib/

This makes zero difference right now that List::Util/Scalar::Util/Sub::Util
are one disgusting ball of mud, but hopefully it will make sense soon after
@haarg's refactor finally ships

7 years agoBetter lean startup check
Peter Rabbitson [Sun, 28 Feb 2016 12:27:25 +0000]
Better lean startup check

Instead of stupidly loading DBICTest right away, delay to examine the actual
bare DBIC startup

7 years agoSimplify the find-test-temp-dir codepath a bit
Peter Rabbitson [Tue, 24 May 2016 06:54:18 +0000]
Simplify the find-test-temp-dir codepath a bit

7 years agoFix incorrect whitespace test outside of checkouts
Peter Rabbitson [Tue, 24 May 2016 11:55:31 +0000]
Fix incorrect whitespace test outside of checkouts

I stupidly broke it in 1fb834df

7 years agoThis piece of doc has been incorrect since c354902c
Peter Rabbitson [Tue, 24 May 2016 08:43:18 +0000]
This piece of doc has been incorrect since c354902c

7 years agoHarmonize time zone spelling in InflateColumn::DateTime
Dagfinn Ilmari Mannsåker [Tue, 17 May 2016 15:33:27 +0000]
Harmonize time zone spelling in InflateColumn::DateTime

The rest of the DateTime ecosystem consistently uses "time zone" and
"time_zone", so use that in InflateColumn::DateTime too

"timezone" is still accepted for backwards compatibility

7 years agoProperly fix corner case of non-comparing overload
Peter Rabbitson [Thu, 19 May 2016 18:49:55 +0000]
Properly fix corner case of non-comparing overload

Back in 096ab902a I stupidly introduced a distinction between blessed and
non-blessed structures in store_column. In retrospect this makes absolutely
no sense. It took me an embarrasingly long time to get my clue on, including
sending a bogus bugrport (with a patch FFS!!!) and wasting SYBER's time:
https://rt.cpan.org/Ticket/Display.html?id=114424

At least that shit never shipped :/

7 years ago(travis) Bump to Cperl 5.22.2
Peter Rabbitson [Thu, 19 May 2016 14:49:41 +0000]
(travis) Bump to Cperl 5.22.2

@miyagawa++ # YAML api - allows for trivial grep/sed slicing and dicing

Read under -w

7 years ago(travis) Test::Strict needs Devel::Cover which fails on blead
Peter Rabbitson [Thu, 19 May 2016 08:25:36 +0000]
(travis) Test::Strict needs Devel::Cover which fails on blead

To work around https://github.com/pjcj/Devel--Cover/issues/161 provide a fake
Devel::Cover satisfying https://github.com/Manwar/Test-Strict/issues/17

7 years ago(travis) Clear out some resolved FIXMEs
Peter Rabbitson [Thu, 19 May 2016 07:23:55 +0000]
(travis) Clear out some resolved FIXMEs

7 years ago(travis) Poorman updated their offerings
Peter Rabbitson [Thu, 19 May 2016 07:19:00 +0000]
(travis) Poorman updated their offerings

As a bonus sidesteps https://github.com/travis-ci/travis-ci/issues/5944

7 years agoStart known issues changelog section - place it on top for clarity
Peter Rabbitson [Sun, 15 May 2016 20:52:18 +0000]
Start known issues changelog section - place it on top for clarity

Aside from the 3 pieces listed in Changes, everything else tested on the list
below passes on 5.16.2 as of the date of this commit

Note: slight nudging (cpanm -n) was necessary to get some intra-deps

reset; set -o pipefail; for d in \
  RapidApp \
  App::DBCritic \
  App::DH \
  Catalyst::Controller::DBIC::API \
  Catalyst::Model::DBIC::Schema \
  Catalyst::Model::DBIC::Schema::PerRequest \
  Catalyst::Plugin::Authorization::RoleAbilities \
  Catalyst::TraitFor::Model::DBIC::Schema::Result \
  Catalyst::TraitFor::Model::DBIC::Shortcut \
  CatalystX::CRUD::ModelAdapter::DBIC \
  CatalystX::Eta \
  CatalystX::Resource \
  CatalystX::SimpleLogin \
  Dancer2::Plugin::DBIC \
  Dancer2::Session::DBIC \
  Dancer::Plugin::DBIC \
  Dancer::Session::DBIC \
  DBICx::Modeler \
  DBICx::Sugar \
  DBIx::Class::AlwaysUpdate \
  DBIx::Class::AuditAny \
  DBIx::Class::AuditLog \
  DBIx::Class::BatchUpdate \
  DBIx::Class::Candy \
  DBIx::Class::DeploymentHandler \
  DBIx::Class::DynamicDefault \
  DBIx::Class::DynamicSubclass \
  DBIx::Class::EasyFixture \
  DBIx::Class::Fixtures \
  DBIx::Class::Helpers \
  DBIx::Class::HTMLWidget \
  DBIx::Class::InflateColumn::Boolean \
  DBIx::Class::InflateColumn::DateTimeX::Immutable \
  DBIx::Class::InflateColumn::Math::Currency \
  DBIx::Class::InflateColumn::Serializer::Role::HashContentAccessor \
  DBIx::Class::InflateColumn::Time \
  DBIx::Class::InflateColumn::TimeMoment \
  DBIx::Class::Journal \
  DBIx::Class::Migration \
  DBIx::Class::MooseColumns \
  DBIx::Class::Objects \
  DBIx::Class::ParameterizedJoinHack \
  DBIx::Class::PgLog \
  DBIx::Class::QueryLog \
  DBIx::Class::RandomColumns \
  DBIx::Class::Result::ColumnData \
  DBIx::Class::ResultSet::AccessorsEverywhere \
  DBIx::Class::ResultSet::AuditLog \
  DBIx::Class::ResultSet::RecursiveUpdate \
  DBIx::Class::ResultSource::MultipleTableInheritance \
  DBIx::Class::Result::Validation \
  DBIx::Class::Schema::Config \
  DBIx::Class::Schema::Diff \
  DBIx::Class::Schema::Loader \
  DBIx::Class::Schema::Loader::Dynamic \
  DBIx::Class::Schema::PopulateMore \
  DBIx::Class::Schema::RestrictWithObject \
  DBIx::Class::Schema::TxnEndHook \
  DBIx::Class::Schema::Versioned::Inline \
  DBIx::Class::Sims \
  DBIx::Class::TimeStamp \
  DBIx::Class::TopoSort \
  DBIx::Class::Tree \
  DBIx::Class::Tree::Mobius \
  DBIx::Class::UnicornLogger \
  DBIx::Class::UserStamp \
  DBIx::Class::Validation \
  DBIx::Class::Validation::Structure \
  DBIx::Class::VirtualColumns \
  DBIx::Class::Wrapper \
  DBIx::Schema::Changelog \
  DBIx::Table::TestDataGenerator \
  Galileo \
  HTML::FormHandler::Model::DBIC \
  HTML::FormHandler::TraitFor::Model::DBIC \
  Interchange6::Schema \
  KiokuDB::Backend::DBI \
  MooseX::Meta::Method::Transactional \
  MooseX::Role::DBIC \
  MooseX::Storage::DBIC \
  MooseX::Types::DBIx::Class \
  Reaction \
  Tapper::Schema \
  Test::DBIC::Schema::Connector \
  Test::DBIC::Versioned \
  Test::DBIx::Class \
  WebAPI::DBIC \
  Yeb::Plugin::DBIC \
  "DBD::SQLite@1.35 Handel Catalyst::ActionRole::BuildDBICResult" \
; do \
  PERL5LIB=/home/rabbit/devel/dbic/lib \
  DBIC_ASSERT_NO_ERRONEOUS_METAINSTANCE_USAGE=1 \
  cpanm -v --reinstall $d 2>&1 \
| tee -a /dev/shm/umpfh \
| grep -P -B1 '^(Building and testing|Result:)' || break \
; done

7 years agoAdd a few more indirect call guards missed in e5053694
Peter Rabbitson [Tue, 17 May 2016 15:43:30 +0000]
Add a few more indirect call guards missed in e5053694

No notable code changes were required as a result