[01/10] configure: Drop feature for randomly disabling/enabling components

Message ID 20171010225819.8006-2-diego@biurrun.de
State Committed
Commit a688b64fcf4abf0554b10d5446f019ec73121c1d
Headers show

Commit Message

Diego Biurrun Oct. 10, 2017, 10:58 p.m.
This feature was never used for anything.
---
 configure | 41 -----------------------------------------
 1 file changed, 41 deletions(-)

Comments

James Almer Oct. 10, 2017, 11:03 p.m. | #1
On 10/10/2017 7:58 PM, Diego Biurrun wrote:
> This feature was never used for anything.

Was a fate client ever set with it? Because it's great to find missing
dependencies on new modules (be it configure deps, object entries in
Makefile, or FATE test deps if you don't make it a build only run) by
disabling random things each time it runs.


> ---
>  configure | 41 -----------------------------------------
>  1 file changed, 41 deletions(-)
> 
> diff --git a/configure b/configure
> index f75fb28837..b6a9ed7978 100755
> --- a/configure
> +++ b/configure
> @@ -338,14 +338,6 @@ Developer options (useful when working on Libav itself):
>                             used only for debugging purposes)
>    --enable-xmm-clobber-test check XMM registers for clobbering (Win64-only;
>                             should be used only for debugging purposes)
> -  --enable-random          randomly enable/disable components
> -  --disable-random
> -  --enable-random=LIST     randomly enable/disable specific components or
> -  --disable-random=LIST    component groups. LIST is a comma-separated list
> -                           of NAME[:PROB] entries where NAME is a component
> -                           (group) and PROB the probability associated with
> -                           NAME (default 0.5).
> -  --random-seed=VALUE      seed value for --enable/disable-random
>    --disable-valgrind-backtrace do not print a backtrace under Valgrind
>                             (only applies to --disable-optimizations builds)
>    --ignore-tests=TESTS     comma-separated list (without "fate-" prefix
> @@ -1850,7 +1842,6 @@ CMDLINE_SET="
>      optflags
>      pkg_config
>      pkg_config_flags
> -    random_seed
>      samples
>      sysinclude
>      sysroot
> @@ -2782,27 +2773,6 @@ show_list() {
>      exit 0
>  }
>  
> -rand_list(){
> -    IFS=', '
> -    set -- $*
> -    unset IFS
> -    for thing; do
> -        comp=${thing%:*}
> -        prob=${thing#$comp}
> -        prob=${prob#:}
> -        is_in ${comp} $COMPONENT_LIST && eval comp=\$$(toupper ${comp%s})_LIST
> -        echo "prob ${prob:-0.5}"
> -        printf '%s\n' $comp
> -    done
> -}
> -
> -do_random(){
> -    action=$1
> -    shift
> -    random_seed=$(awk "BEGIN { srand($random_seed); print srand() }")
> -    $action $(rand_list "$@" | awk "BEGIN { srand($random_seed) } \$1 == \"prob\" { prob = \$2; next } rand() < prob { print }")
> -}
> -
>  for opt do
>      optval="${opt#*=}"
>      case "$opt" in
> @@ -2834,14 +2804,6 @@ for opt do
>              map 'eval unset \${$(toupper ${v%s})_LIST}' $COMPONENT_LIST
>              disable $LIBRARY_LIST $PROGRAM_LIST doc
>          ;;
> -        --enable-random|--disable-random)
> -            action=${opt%%-random}
> -            do_random ${action#--} $COMPONENT_LIST
> -        ;;
> -        --enable-random=*|--disable-random=*)
> -            action=${opt%%-random=*}
> -            do_random ${action#--} $optval
> -        ;;
>          --enable-*=*|--disable-*=*)
>              eval $(echo "${opt%%=*}" | sed 's/--/action=/;s/-/ thing=/')
>              is_in "${thing}s" $COMPONENT_LIST || die_unknown "$opt"
> @@ -5272,9 +5234,6 @@ echo "shared                    ${shared-no}"
>  echo "network support           ${network-no}"
>  echo "threading support         ${thread_type-no}"
>  echo "safe bitstream reader     ${safe_bitstream_reader-no}"
> -test -n "$random_seed" &&
> -    echo "random seed               ${random_seed}"
> -echo
>  
>  echo "External libraries:"
>  print_enabled '' $EXTERNAL_LIBRARY_LIST | print_3_columns
>
Diego Biurrun Oct. 10, 2017, 11:07 p.m. | #2
On Tue, Oct 10, 2017 at 08:03:21PM -0300, James Almer wrote:
> On 10/10/2017 7:58 PM, Diego Biurrun wrote:
> > This feature was never used for anything.
> 
> Was a fate client ever set with it? Because it's great to find missing
> dependencies on new modules (be it configure deps, object entries in
> Makefile, or FATE test deps if you don't make it a build only run) by
> disabling random things each time it runs.

I believe that is better achieved by testing that all internal components
build standalone. I (ir)regularly run a script that does exactly that.
Has this feature ever reliably detected bugs within a reasonable timeframe?

Diego
James Almer Oct. 10, 2017, 11:28 p.m. | #3
On 10/10/2017 8:07 PM, Diego Biurrun wrote:
> On Tue, Oct 10, 2017 at 08:03:21PM -0300, James Almer wrote:
>> On 10/10/2017 7:58 PM, Diego Biurrun wrote:
>>> This feature was never used for anything.
>>
>> Was a fate client ever set with it? Because it's great to find missing
>> dependencies on new modules (be it configure deps, object entries in
>> Makefile, or FATE test deps if you don't make it a build only run) by
>> disabling random things each time it runs.
> 
> I believe that is better achieved by testing that all internal components
> build standalone. I (ir)regularly run a script that does exactly that.
> Has this feature ever reliably detected bugs within a reasonable timeframe?

If run several times it should be able to detect mistakes in Oracle
within a day. Even a full fate run wouldn't take long given it disables
plenty of things each time.

In any case, since it's a developer feature, if nobody is really using
it then i guess it can go.

> 
> Diego
> _______________________________________________
> libav-devel mailing list
> libav-devel@libav.org
> https://lists.libav.org/mailman/listinfo/libav-devel
>
Luca Barbato Oct. 11, 2017, 6:22 a.m. | #4
On 11/10/2017 00:58, Diego Biurrun wrote:
> This feature was never used for anything.
> ---
>   configure | 41 -----------------------------------------
>   1 file changed, 41 deletions(-)
> 

Was used to determine if fringe configuration build not sure it would 
have the expected effect now. It can live as stand-alone script probably.

Patch

diff --git a/configure b/configure
index f75fb28837..b6a9ed7978 100755
--- a/configure
+++ b/configure
@@ -338,14 +338,6 @@  Developer options (useful when working on Libav itself):
                            used only for debugging purposes)
   --enable-xmm-clobber-test check XMM registers for clobbering (Win64-only;
                            should be used only for debugging purposes)
-  --enable-random          randomly enable/disable components
-  --disable-random
-  --enable-random=LIST     randomly enable/disable specific components or
-  --disable-random=LIST    component groups. LIST is a comma-separated list
-                           of NAME[:PROB] entries where NAME is a component
-                           (group) and PROB the probability associated with
-                           NAME (default 0.5).
-  --random-seed=VALUE      seed value for --enable/disable-random
   --disable-valgrind-backtrace do not print a backtrace under Valgrind
                            (only applies to --disable-optimizations builds)
   --ignore-tests=TESTS     comma-separated list (without "fate-" prefix
@@ -1850,7 +1842,6 @@  CMDLINE_SET="
     optflags
     pkg_config
     pkg_config_flags
-    random_seed
     samples
     sysinclude
     sysroot
@@ -2782,27 +2773,6 @@  show_list() {
     exit 0
 }
 
-rand_list(){
-    IFS=', '
-    set -- $*
-    unset IFS
-    for thing; do
-        comp=${thing%:*}
-        prob=${thing#$comp}
-        prob=${prob#:}
-        is_in ${comp} $COMPONENT_LIST && eval comp=\$$(toupper ${comp%s})_LIST
-        echo "prob ${prob:-0.5}"
-        printf '%s\n' $comp
-    done
-}
-
-do_random(){
-    action=$1
-    shift
-    random_seed=$(awk "BEGIN { srand($random_seed); print srand() }")
-    $action $(rand_list "$@" | awk "BEGIN { srand($random_seed) } \$1 == \"prob\" { prob = \$2; next } rand() < prob { print }")
-}
-
 for opt do
     optval="${opt#*=}"
     case "$opt" in
@@ -2834,14 +2804,6 @@  for opt do
             map 'eval unset \${$(toupper ${v%s})_LIST}' $COMPONENT_LIST
             disable $LIBRARY_LIST $PROGRAM_LIST doc
         ;;
-        --enable-random|--disable-random)
-            action=${opt%%-random}
-            do_random ${action#--} $COMPONENT_LIST
-        ;;
-        --enable-random=*|--disable-random=*)
-            action=${opt%%-random=*}
-            do_random ${action#--} $optval
-        ;;
         --enable-*=*|--disable-*=*)
             eval $(echo "${opt%%=*}" | sed 's/--/action=/;s/-/ thing=/')
             is_in "${thing}s" $COMPONENT_LIST || die_unknown "$opt"
@@ -5272,9 +5234,6 @@  echo "shared                    ${shared-no}"
 echo "network support           ${network-no}"
 echo "threading support         ${thread_type-no}"
 echo "safe bitstream reader     ${safe_bitstream_reader-no}"
-test -n "$random_seed" &&
-    echo "random seed               ${random_seed}"
-echo
 
 echo "External libraries:"
 print_enabled '' $EXTERNAL_LIBRARY_LIST | print_3_columns