gen deps is busted but faster
authorFred T. Hamster <fred@feistymeow.org>
Wed, 11 Feb 2026 16:27:35 +0000 (11:27 -0500)
committerFred T. Hamster <fred@feistymeow.org>
Wed, 11 Feb 2026 16:27:35 +0000 (11:27 -0500)
wheee!  ugh.  fixing the runtime performance has caused me to break the runtime correctness.  still working on this.

nucleus/tools/clam_tools/passwd-instagram.txt [new file with mode: 0644]
nucleus/tools/clam_tools/value_tagger.cpp
scripts/clam/cpp/buildor_gen_deps.sh

diff --git a/nucleus/tools/clam_tools/passwd-instagram.txt b/nucleus/tools/clam_tools/passwd-instagram.txt
new file mode 100644 (file)
index 0000000..529c762
--- /dev/null
@@ -0,0 +1,4 @@
+
+
+fred@
+pass: Gramnsy293#oisxPOo
index b3866451e459db0335ad258148a88ddd825eef96..7a2f13cf1f8204304835421852ae677bb26c6667 100644 (file)
@@ -959,52 +959,5 @@ HOOPLE_MAIN(value_tagger, )
 
 #ifdef __BUILD_STATIC_APPLICATION__
   // static dependencies found by buildor_gen_deps.sh:
-  #include <algorithms/sorts.cpp>
-  #include <application/application_shell.cpp>
-  #include <application/callstack_tracker.cpp>
-  #include <application/command_line.cpp>
-  #include <application/windoze_helper.cpp>
-  #include <basis/astring.cpp>
-  #include <basis/common_outcomes.cpp>
-  #include <basis/environment.cpp>
-  #include <basis/guards.cpp>
-  #include <basis/mutex.cpp>
-  #include <basis/utf_conversion.cpp>
-  #include <configuration/application_configuration.cpp>
-  #include <configuration/configurator.cpp>
-  #include <configuration/ini_configurator.cpp>
-  #include <configuration/ini_parser.cpp>
-  #include <configuration/table_configurator.cpp>
-  #include <configuration/variable_tokenizer.cpp>
-  #include <filesystem/byte_filer.cpp>
-  #include <filesystem/directory.cpp>
-  #include <filesystem/directory_tree.cpp>
-  #include <filesystem/file_info.cpp>
-  #include <filesystem/filename.cpp>
-  #include <filesystem/filename_list.cpp>
-  #include <filesystem/filename_tree.cpp>
-  #include <filesystem/file_time.cpp>
-  #include <filesystem/huge_file.cpp>
-  #include <loggers/combo_logger.cpp>
-  #include <loggers/console_logger.cpp>
-  #include <loggers/critical_events.cpp>
-  #include <loggers/file_logger.cpp>
-  #include <loggers/program_wide_logger.cpp>
-  #include <nodes/node.cpp>
-  #include <nodes/packable_tree.cpp>
-  #include <nodes/path.cpp>
-  #include <nodes/tree.cpp>
-  #include <structures/bit_vector.cpp>
-  #include <structures/checksums.cpp>
-  #include <structures/object_packers.cpp>
-  #include <structures/static_memory_gremlin.cpp>
-  #include <structures/string_hasher.cpp>
-  #include <structures/string_table.cpp>
-  #include <structures/version_record.cpp>
-  #include <textual/byte_formatter.cpp>
-  #include <textual/parser_bits.cpp>
-  #include <textual/string_manipulation.cpp>
-  #include <timely/earth_time.cpp>
-  #include <timely/time_stamp.cpp>
 #endif // __BUILD_STATIC_APPLICATION__
 
index bb0e958a9c2eeda74fa82892be8e625b9fc3b604..c36cd1a0b76765571521e956beadc27f20899294 100644 (file)
@@ -20,7 +20,7 @@ source "$FEISTY_MEOW_SCRIPTS/core/launch_feisty_meow.sh"
 # prints out a message with a time-stamp prefixed to it.
 function log_it()
 {
-  echo -e "$(date_stringer): $*"
+  echo -e "$(date_stringer): $@"
 }
 
 if [ ! -z "$CLEAN" ]; then
@@ -29,20 +29,20 @@ if [ ! -z "$CLEAN" ]; then
 fi
 
 # uncomment to enable debugging noises.
-#DEBUG_BUILDOR_GEN_DEPS=yo
+DEBUG_BUILDOR_GEN_DEPS=yo
 
 # these semi-global variables used throughout the whole script to accumulate
 # information, rather than trying to juggle positional parameters everywhere.
 
 # the list of dependencies being accumulated.
-declare -a dependency_accumulator=()
+declare -A dependency_accumulator
 
 # a set of files that are known to be bad, since we cannot find them.
-declare -a bad_files=()
+declare -A bad_files
 
 # makes sure we don't keep looking at files even when they're neither
 # bad nor listed as dependencies.
-declare -a boring_files=()
+declare -A boring_files
 
 # this directory is not allowed to participate in the scavenging
 # because it's where the tool was pointed at.  if we allowed files in
@@ -69,7 +69,8 @@ function seen_already {
 # adds a new dependency at the end of the list.
 function add_new_dep {
   # make sure we haven't already processed this.
-  local dep="$1"
+  local dep="$1"; shift
+log_it "looking for dep='$dep'"
   if seen_already "$dep"; then
     if [ ! -z "$DEBUG_BUILDOR_GEN_DEPS" ]; then
       log_it "bailing since seen: $dep"
@@ -84,7 +85,7 @@ function add_new_dep {
     log_it "new dependency: $dep"
   fi
 
-  dependency_accumulator+=($dep)
+  dependency_accumulator[$dep]=yo
   return 0
 }
 
@@ -92,49 +93,25 @@ function add_new_dep {
 # listed.  if this is the case, zero is returned (meaning success).  if
 # the dependency is missing, then -1 is return to indicate an error.
 function existing_dep {
-  seek="$1"; shift
-  # efficient search of array for the string.
-  if ( IFS=$'\n'; echo "${dependency_accumulator[*]}" ) | grep -qFx "$seek"; then
+  if [ ! -z "${dependency_accumulator[$1]}" ]; then
     return 0
   fi
-
-## #hmmm: below is not very efficient!
-##   for currite in ${dependency_accumulator[*]}; do
-##     if [ "$currite" == "$1" ]; then return 0; fi
-##   done
-
   return 1
 }
 
 # reports whether a file name has already been processed.
 function boring_file {
-  seek="$1"; shift
-  # efficient search of array for the string.
-  if ( IFS=$'\n'; echo "${boring_files[*]}" ) | grep -qFx "$seek"; then
+  if [ ! -z "${boring_files[$1]}" ]; then
     return 0
   fi
-
-## #hmmm: below might not be very efficient!
-##   for currite in ${boring_files[*]}; do
-##     if [ "$currite" == "$1" ]; then return 0; fi
-##   done
-
   return 1
 }
 
 # reports whether a file name has already been found to be missing.
 function bad_file {
-  seek="$1"; shift
-  # efficient search of array for the string.
-  if ( IFS=$'\n'; echo "${bad_files[*]}" ) | grep -qFx "$seek"; then
+  if [ ! -z "${bad_files[$1]}" ]; then
     return 0
   fi
-
-## #hmmm: below also is not very efficient!
-##   for currite in ${bad_files[*]}; do
-##     if [ "$currite" == "$seek" ]; then return 0; fi
-##   done
-
   return 1
 }
 
@@ -158,36 +135,36 @@ function already_listed {
 # finds the index of a particular element in the remainder of a list.
 # the variable __finders_indy will be set to -1 for no match, or it will be the
 # index of the element if the item was found.
-__finders_indy=-1
-function find_in_array {
-  local to_find=$1
-  shift
-  local indy=0
-  while (( $# > 0 )); do
-    # return that we found it if the current item matches.
-    if [ "$to_find" == "$1" ]; then
-       __finders_indy=$indy
-       return 0
-    fi
-    shift  # toss next one out.
-    indy=$(expr $indy + 1)
-  done
-  _finders_indy=-1
-  # failed to match it.
-  return 1
-}
+##__finders_indy=-1
+##function find_in_array {
+##  local to_find=$1
+##  shift
+##  local indy=0
+##  while (( $# > 0 )); do
+##    # return that we found it if the current item matches.
+##    if [ "$to_find" == "$1" ]; then
+##       __finders_indy=$indy
+##       return 0
+##    fi
+##    shift  # toss next one out.
+##    indy=$(expr $indy + 1)
+##  done
+##  _finders_indy=-1
+##  # failed to match it.
+##  return 1
+##}
 
 ############################################################################
 #
 # this variable gets stored into when resolve_filename runs.
-declare -a resolve_target_array=()
+declare -A resolve_target_array
 #
 # this variable is used internally by resolve_filename.  it should not need
 # to be reset between runs on different files because the source hierarchy
 # is not supposed to be getting files deleted or added while the deps are
 # being geneated.
-declare -a resolve_matches_src=()
-declare -a resolve_matches_dest=()
+declare -A resolve_matches_src
+declare -A resolve_matches_dest
 #
 # tries to find a filename in the library hierarchy.
 function resolve_filename {
@@ -197,7 +174,7 @@ function resolve_filename {
   fi
   if [ -f "$code_file" ]; then
     # that was pretty easy.
-    resolve_target_array=($code_file)
+    resolve_target_array[$code_file]=zuh
     return 0
   fi
   if [ ! -z "$DEBUG_BUILDOR_GEN_DEPS" ]; then
@@ -212,37 +189,51 @@ function resolve_filename {
   fi
 
   # see if we can find that element in the previously resolved items.
-  if find_in_array "$src_key" ${resolve_matches_src[*]}; then
-    local found_indy=$__finders_indy
-    resolve_target_array=(${resolve_matches_dest[$found_indy]})
+  if [ ! -z "${resolve_matches_src[$src_key]}" ]; then
+#    local found_indy=$__finders_indy
+    local flounder="${resolve_matches_dest[$src_key]}"
+log_it flounder is $flounder
+    resolve_target_array[$flounder]=um
     if [ ! -z "$DEBUG_BUILDOR_GEN_DEPS" ]; then
-      log_it "FOUND \"$src_key\" AT ${resolve_matches_dest[$found_indy]}"
+      log_it "FOUND \"$src_key\" AT $flounder"
     fi
     return 0
   fi
 
   # reset our global list.
-  resolve_target_array=()
+  unset resolve_target_array
+  declare -gA resolve_target_array
+
   if [ ! -z "$DEBUG_BUILDOR_GEN_DEPS" ]; then
     log_it "HAVING TO FIND: $dir and $base"
   fi
   if [ -z "$dir" ]; then
-    resolve_target_array=($(find "$BUILD_TOP" -iname "$base"))
+    local -a init_list="$(find "$BUILD_TOP" -iname "$base" -exec echo "[{}]=\"o\" " ';')"
+log_it "init list is: ${init_list}"
+    if [ ${#init_list} -gt 0 ]; then
+      eval resolve_target_array=(${init_list})
+    fi
   else
-    resolve_target_array=($(find "$BUILD_TOP" -iname "$base" | grep "$dir.$base"))
+    local -a init_list="$(find "$BUILD_TOP" -iname "$base" -exec echo "[{}]=\"j\" " ';' | grep "$dir.$base")"
+log_it "init list is: ${init_list}"
+    if [ ${#init_list} -gt 0 ]; then
+      eval resolve_target_array=(${init_list})
+    fi
   fi
   if [ ! -z "$DEBUG_BUILDOR_GEN_DEPS" ]; then
-    log_it resolved to: ${resolve_target_array[*]}
-    log_it size of resolve array=${#resolve_target_array[*]}
+    log_it "resolved to: ${!resolve_target_array[@]}"
+    log_it "size of resolve array=${#resolve_target_array[@]}"
   fi
-  if [ ${#resolve_target_array[*]} -eq 1 ]; then
+  if [ ${#resolve_target_array[@]} -eq 1 ]; then 
+    local -a indies=( ${!resolve_target_array[@]} )
+    local first_item=${indies[0]}
     if [ ! -z "$DEBUG_BUILDOR_GEN_DEPS" ]; then
-      log_it ADDING a match: $src_key ${resolve_target_array[0]}
+      log_it ADDING a match: $src_key $first_item
     fi
     # for unique matches, we will store the correspondence so we can look
     # it up very quickly later.
-    resolve_matches_src+=($src_key)
-    resolve_matches_dest+=(${resolve_target_array[0]})
+    resolve_matches_src[$src_key]=sup
+    resolve_matches_dest[$first_item]=nada
   fi
 }
 #
@@ -254,21 +245,31 @@ function resolve_filename {
 # by making sure we haven't already seen files or decided they're bad.
 function recurse_on_deps {
   # snag arguments into a list of dependencies to crawl.
-  local -a active_deps=($*)
+  local -a active_deps=($@)
+log_it "active deps passed as $@"
 
   # pull off the first dependency so we can get all of its includes.
   local first_element="${active_deps[0]}"
   active_deps=(${active_deps[*]:1})
+log_it "first_element is $first_element"
 
   # make the best guess we can at the real path.
   resolve_filename $first_element
-  local to_examine="${resolve_target_array[0]}"
+  local -a indies=( ${!resolve_target_array[@]} )
+  local first_item=${indies[0]}
+log_it "first_item is '$first_item' "
+  local to_examine="$first_item"
 
   # we didn't already have a failure (due to it being a bad file already
   # or other problems).  and once we execute the below code to grab the
   # file's dependencies, it really is boring and we never want to see it
   # again.
-  boring_files+=($to_examine)
+log_it "assocarray index to use is '$to_examine'"
+  if [ -z "$to_examine" ]; then
+    log_it "hit the resolve_target_array list being empty; are we done?"
+    return 0
+  fi
+  boring_files[$to_examine]=yawn
 
   local dirtmp=$(dirname "$to_examine")
   local basetmp=$(basename "$to_examine")
@@ -338,7 +339,7 @@ function recurse_on_deps {
       chew_toy="${chew_toy#*\#include *[\"<]}"
       chew_toy="${chew_toy/[\">]*}"
       if [ ! -z "$DEBUG_BUILDOR_GEN_DEPS" ]; then
-        echo B: chew_toy=$chew_toy
+        log_it B: chew_toy=$chew_toy
       fi
 
       # if it still has an #include or if it's not really a file, we can't
@@ -378,12 +379,12 @@ function recurse_on_deps {
     if [ ! -f "$chew_toy" ]; then
       # not an obvious filename yet.  try resolving it.
       resolve_filename $chew_toy
-      declare -a found_odd=(${resolve_target_array[*]})
+      declare -a found_odd=(${!resolve_target_array[@]})
       local odd_len=${#found_odd[*]}
       if [ $odd_len -eq 0 ]; then
         # whoops.  we couldn't find it.  probably a system header, so toss it.
         log_it "** ignoring: $chew_toy"
-        bad_files+=($chew_toy)
+        bad_files[$chew_toy]=yup
         chew_toy=""
       elif [ $odd_len -eq 1 ]; then
         # there's exactly one match, which is very good.
@@ -395,14 +396,14 @@ function recurse_on_deps {
         # this is really wrong.  there are multiple files with the same name?
         # that kind of things makes debugger tools angry or stupid.
         log_it "** non-unique name: $chew_toy"
-        bad_files+=($chew_toy)
+        bad_files[$chew_toy]=urf
         chew_toy=""
       fi
     fi
 
     if [ ! -z "$chew_toy" -a ! -f "$chew_toy" ]; then
       log_it "** failed to compute a real path for: $chew_toy"
-      bad_files+=($chew_toy)
+      bad_files[$chew_toy]=meh
       chew_toy=""
       continue
     fi
@@ -412,6 +413,7 @@ function recurse_on_deps {
     # hence the emptiness check.
     if [ ! -z "$chew_toy" ]; then
       # add the dependency we found.
+log_it "point Q1: about to add new dep: $chew_toy"
       if add_new_dep "$chew_toy"; then
         # if that worked, it's not existing or bad so we want to keep it.
         if ! already_listed "$chew_toy" ${active_deps[*]}; then
@@ -431,11 +433,14 @@ function recurse_on_deps {
       # there's no point in adding it if the name didn't change.
       if [ "$cpp_toy" != "$chew_toy" ]; then
         resolve_filename $cpp_toy
+#wrong        local found_it="${!resolve_target_array[@]}[0]"
+        local -a indies=( ${!resolve_target_array[@]} )
+        local found_it="${indies[0]}"
 #hmmm: what if too many matches occur?
-        found_it="${resolve_target_array[0]}"
 
         # if the dependency actually exists, then we'll add it to our list.
         if [ ! -z "$found_it" ]; then
+log_it "point Q2: about to add new dep: $found_it"
           if add_new_dep "$found_it"; then
             # that was a new dependency, so we'll continue examining it.
             if ! already_listed "$found_it" ${active_deps[*]}; then
@@ -450,7 +455,9 @@ function recurse_on_deps {
   \rm -f "$current_includes"
 
   # keep going on the list after our modifications.
-  if [ ${#active_deps[*]} -ne 0 ]; then recurse_on_deps ${active_deps[*]}; fi
+  if [ ${#active_deps[@]} -ne 0 ]; then
+    recurse_on_deps ${active_deps[@]}
+  fi
   return 0
 }
 
@@ -480,6 +487,7 @@ function write_new_version {
         | sed -n -e 's/#ifdef __BUILD_STATIC_APPLICATION__/yep/p')" ]; then
       break
     fi
+#echo "orig line is '$orig_line'"
     if [ -z "$orig_line" ]; then
       # add another blank line to our list and don't print any of them yet.
       blanks+=($'\n')
@@ -501,7 +509,10 @@ function write_new_version {
   \rm -f "$pending_deps"
 
   # iterate across all the dependencies we found.
-  for line_please in ${dependency_accumulator[*]}; do
+#  for line_please in ${dependency_accumulator[@]}; do
+  for line_please in "${!dependency_accumulator[@]}"; do
+
+log_it "line please is '$line_please'"
     
     # throw out any items that are in the same directory we started in.
     if [ "$prohibited_directory" == "$(dirname $line_please)" ]; then
@@ -513,8 +524,10 @@ function write_new_version {
 
     # strip the line down to just the filename and single directory component.
     local chewed_line=$(echo $line_please | sed -e 's/.*[\\\/]\(.*\)[\\\/]\(.*\)$/\1\/\2/')
+log_it "chewed line is '$chewed_line'"
 
-    if [ ! -z "$(echo $chewed_line | sed -n -e 's/\.h$/yow/p')" ]; then
+    if [[ "$chewed_line" =~ ^.*\.h$ ]]; then
+#! -z "$(echo $chewed_line | sed -n -e 's/\.h$/yow/p')" ]; then
       if [ ! -z "$DEBUG_BUILDOR_GEN_DEPS" ]; then
         log_it "skipping header file: $chewed_line"
       fi
@@ -523,7 +536,7 @@ function write_new_version {
 
     local new_include="  #include <$chewed_line>"
     if [ ! -z "$DEBUG_BUILDOR_GEN_DEPS" ]; then
-      echo "adding '$new_include'"
+      log_it "adding '$new_include'"
     fi
     echo "$new_include" >>"$pending_deps"
   done
@@ -567,8 +580,10 @@ function find_dependencies {
   local code_file=$1
 
   # initialize our globals.
-  dependency_accumulator=()
-  boring_files=()
+  unset dependency_accumulator
+  declare -gA dependency_accumulator
+  unset boring_files
+  declare -gA boring_files
 
   # start recursing with the first dependency being the file itself.
   if [ ! -z "$DEBUG_BUILDOR_GEN_DEPS" ]; then
@@ -591,8 +606,8 @@ for curr_parm in $*; do
   echo ""
 
   # resets the bad list in between sessions.
-  bad_files=() 
-#log_it bad_files initial: ${bad_files[*]} 
+  unset bad_files
+  declare -gA bad_files
 
   if [ -f "$curr_parm" ]; then
     log_it "scanning file: $curr_parm"
@@ -637,7 +652,7 @@ for curr_parm in $*; do
     log_it "** parameter is not a file or directory: $curr_parm"
   fi
 
-  log_it "ignored these files: " ${bad_files[*]}
+  log_it "ignored these files: " ${!bad_files[@]}
 
   echo ""
   echo ""