From a8d6c49759195a80320d63977dd31e30d93cfa23 Mon Sep 17 00:00:00 2001 From: Peter Rabbitson Date: Mon, 11 Apr 2016 20:24:21 +0200 Subject: [PATCH 1/3] (travis) Reorganize POISON_ENV mode Allow MVDT and BREAK_CC to be separate settings, will make sense in further commits Read under -w --- maint/travis-ci_scripts/20_install.bash | 11 +++++ maint/travis-ci_scripts/30_before_script.bash | 42 ++++++++++--------- 2 files changed, 34 insertions(+), 19 deletions(-) diff --git a/maint/travis-ci_scripts/20_install.bash b/maint/travis-ci_scripts/20_install.bash index 515b17651..490ceb763 100755 --- a/maint/travis-ci_scripts/20_install.bash +++ b/maint/travis-ci_scripts/20_install.bash @@ -86,6 +86,17 @@ fi # poison the environment if [[ "$POISON_ENV" = "true" ]] ; then + toggle_vars=( MVDT ) + + [[ "$CLEANTEST" == "true" ]] && toggle_vars+=( BREAK_CC ) + + for var in "${toggle_vars[@]}" ; do + if [[ -z "${!var}" ]] ; then + export $var=true + echo "POISON_ENV: setting $var to 'true'" + fi + done + # look through lib, find all mentioned DBIC* ENVvars and set them to true and see if anything explodes toggle_booleans=( $( grep -ohP '\bDBIC_[0-9_A-Z]+' -r lib/ --exclude-dir Optional | sort -u | grep -vP '^(DBIC_TRACE(_PROFILE)?|DBIC_.+_DEBUG)$' ) ) diff --git a/maint/travis-ci_scripts/30_before_script.bash b/maint/travis-ci_scripts/30_before_script.bash index 9f1ebd0ba..b314d8184 100755 --- a/maint/travis-ci_scripts/30_before_script.bash +++ b/maint/travis-ci_scripts/30_before_script.bash @@ -5,16 +5,16 @@ source maint/travis-ci_scripts/common.bash if [[ -n "$SHORT_CIRCUIT_SMOKE" ]] ; then exit 0 ; fi -# The prereq-install stage will not work with both POISON and DEVREL +# The DEVREL_DEPS prereq-install stage won't mix with MVDT # DEVREL wins if [[ "$DEVREL_DEPS" = "true" ]] ; then - export POISON_ENV="" + export MVDT="" fi # FIXME - this is a kludge in place of proper MDV testing. For the time # being simply use the minimum versions of our DBI/DBDstack, to avoid # fuckups like 0.08260 (went unnoticed for 5 months) -if [[ "$POISON_ENV" = "true" ]] ; then +if [[ "$MVDT" = "true" ]] ; then # use url-spec for DBI due to https://github.com/miyagawa/cpanminus/issues/328 if [[ "$CLEANTEST" != "true" ]] || perl -M5.013003 -e1 &>/dev/null ; then @@ -32,25 +32,29 @@ if [[ "$POISON_ENV" = "true" ]] ; then else parallel_installdeps_notest DBD::SQLite@1.29 fi +fi - # also try minimal tested installs *without* a compiler - if [[ "$CLEANTEST" = "true" ]]; then +# try minimal fully tested installs *without* a compiler (with some exceptions of course) +if [[ "$BREAK_CC" = "true" ]] ; then - # FIXME - working around RT#74707, https://metacpan.org/source/DOY/Package-Stash-0.37/Makefile.PL#L112-122 - # List::Util can be excised after that as well (need to make my own max() routine for older perls) - installdeps Sub::Name Clone Package::Stash::XS \ - $( perl -MList::Util\ 1.16 -e1 &>/dev/null || echo "List::Util" ) + [[ "$CLEANTEST" != "true" ]] && echo_err "Breaking the compiler without CLEANTEST makes no sense" && exit 1 - mkdir -p "$HOME/bin" # this is already in $PATH, just doesn't exist - run_or_err "Linking ~/bin/cc to /bin/false - thus essentially BREAKING the C compiler" \ - "ln -s /bin/false $HOME/bin/cc" + # FIXME - working around RT#74707, https://metacpan.org/source/DOY/Package-Stash-0.37/Makefile.PL#L112-122 + # List::Util can be excised after that as well (need to make my own max() routine for older perls) + installdeps Sub::Name Clone Package::Stash::XS \ + $( perl -MList::Util\ 1.16 -e1 &>/dev/null || echo "List::Util" ) \ + $( perl -MDBI -e1 &>/dev/null || echo "DBI" ) \ + $( perl -MDBD::SQLite -e1 &>/dev/null || echo "DBD::SQLite" ) - # FIXME: working around RT#113682, RT#113685 - installdeps Module::Build B::Hooks::EndOfScope + mkdir -p "$HOME/bin" # this is already in $PATH, just doesn't exist + run_or_err "Linking ~/bin/cc to /bin/false - thus essentially BREAKING the C compiler" \ + "ln -s /bin/false $HOME/bin/cc" - run_or_err "Linking ~/bin/cc to /bin/true - BREAKING the C compiler even harder" \ - "ln -fs /bin/true $HOME/bin/cc" - fi + # FIXME: working around RT#113682, RT#113685 + installdeps Module::Build B::Hooks::EndOfScope + + run_or_err "Linking ~/bin/cc to /bin/true - BREAKING the C compiler even harder" \ + "ln -fs /bin/true $HOME/bin/cc" fi if [[ "$CLEANTEST" = "true" ]]; then @@ -169,8 +173,8 @@ if [[ -n "$(make listdeps)" ]] ; then exit 1 fi -# check that our MDV somewhat works -if [[ "$POISON_ENV" = "true" ]] && ( perl -MDBD::SQLite\ 1.38 -e1 || perl -MDBI\ 1.615 -e1 ) &>/dev/null ; then +# check that our MVDT somewhat works +if [[ "$MVDT" = "true" ]] && ( perl -MDBD::SQLite\ 1.38 -e1 || perl -MDBI\ 1.615 -e1 ) &>/dev/null ; then echo_err "Something went wrong - higher versions of DBI and/or DBD::SQLite than we expected" exit 1 fi From fcdc83ff88abb7af881d1afcf4e04ea78f57dbb5 Mon Sep 17 00:00:00 2001 From: Tom Hukins Date: Mon, 11 Apr 2016 22:18:08 +0000 Subject: [PATCH 2/3] Improve a document's introduction DBIx::Class::Manual::Intro doesn't mention joins at all, so stop pointing people who don't know joins there. --- lib/DBIx/Class/Manual/Joining.pod | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/DBIx/Class/Manual/Joining.pod b/lib/DBIx/Class/Manual/Joining.pod index bc4f84658..9c6829a77 100644 --- a/lib/DBIx/Class/Manual/Joining.pod +++ b/lib/DBIx/Class/Manual/Joining.pod @@ -10,9 +10,9 @@ you use joins extensively (and also probably if you don't). =head1 WHAT ARE JOINS -If you ended up here and you don't actually know what joins are yet, -then you should likely try the L -instead. Skip this part if you know what joins are.. +If you don't know the basics of DBIx::Class, read +L first. Skip this section if you know how +SQL joins work. But I'll explain anyway. Assuming you have created your database in a more or less sensible way, you will end up with several tables that From 03dfab976209fe0e82beea31cf88417bc4eb4e09 Mon Sep 17 00:00:00 2001 From: Tom Hukins Date: Mon, 11 Apr 2016 22:19:34 +0000 Subject: [PATCH 3/3] Improve documentation readability --- lib/DBIx/Class/Manual/Joining.pod | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/lib/DBIx/Class/Manual/Joining.pod b/lib/DBIx/Class/Manual/Joining.pod index 9c6829a77..a6522f1b2 100644 --- a/lib/DBIx/Class/Manual/Joining.pod +++ b/lib/DBIx/Class/Manual/Joining.pod @@ -14,16 +14,15 @@ If you don't know the basics of DBIx::Class, read L first. Skip this section if you know how SQL joins work. -But I'll explain anyway. Assuming you have created your database in a -more or less sensible way, you will end up with several tables that -contain C information. For example, you may have a table -containing information about Cs, containing the CD title and its -year of publication, and another table containing all the Cs -for the CDs, one track per row. +If you have created your database sensibly, you will have several tables +that contain C information. For example, you may have a table +representing Cs, containing each CD's title and its year of +publication, and another table representing all the Cs for the +CDs, one track per row. -When you wish to extract information about a particular CD and all -its tracks, You can either fetch the CD row, then make another query -to fetch the tracks, or you can use a join. Compare: +To retrieve information about a particular CD and all its tracks, either +fetch the CD row, then make another query to fetch the tracks, or use a +join. Compare: SELECT ID, Title, Year FROM CD WHERE Title = 'Funky CD'; # .. Extract the ID, which is 10 @@ -39,7 +38,7 @@ L. =head1 DEFINING JOINS AND RELATIONSHIPS -In L each relationship between two tables needs to first +In L each relationship between two tables must be defined in the L for the table. If the relationship needs to be accessed in both directions (i.e. Fetch all tracks of a CD, and fetch the CD data for a Track), @@ -53,7 +52,7 @@ And in C: MySchema::Tracks->belongs_to('cd', 'MySchema::CD', 'CDID'); -There are several other types of relationships, they are more +There are several other types of relationships, more comprehensively described in L. =head1 USING JOINS