From: Chris Koeritz Date: Sun, 29 May 2022 21:39:48 +0000 (-0400) Subject: plugging in new approach for testing X-Git-Tag: 2.140.136^2~52 X-Git-Url: https://feistymeow.org/gitweb/?p=feisty_meow.git;a=commitdiff_plain;h=e16e899f1a75d8c4df9d36ffac2d8d2d401c4114 plugging in new approach for testing this doesn't make the code read any files at runtime; instead the virtual root for unix on win32 is put in a low-level header that's stored in the binaries dir along with the code. --- diff --git a/nucleus/library/algorithms/sorts.h b/nucleus/library/algorithms/sorts.h index c6e21abe..0b7cfc4b 100644 --- a/nucleus/library/algorithms/sorts.h +++ b/nucleus/library/algorithms/sorts.h @@ -18,6 +18,8 @@ #include +#include + namespace algorithms { /* diff --git a/nucleus/library/configuration/application_configuration.cpp b/nucleus/library/configuration/application_configuration.cpp index c8cc179f..05259f12 100644 --- a/nucleus/library/configuration/application_configuration.cpp +++ b/nucleus/library/configuration/application_configuration.cpp @@ -24,6 +24,7 @@ #include #include #include +#include #ifdef __APPLE__ #include @@ -290,18 +291,19 @@ const astring &application_configuration::GLOBAL_SECTION_NAME() { STATIC_STRING( const astring &application_configuration::LOGGING_FOLDER_NAME() { STATIC_STRING("LogPath"); } -const astring &application_configuration::WINDOZE_VIRTUAL_ROOT_NAME() -{ STATIC_STRING("VirtualUnixRoot"); } +//const astring &application_configuration::WINDOZE_VIRTUAL_ROOT_NAME() +//{ STATIC_STRING("VirtualUnixRoot"); } const astring &application_configuration::DEFAULT_VIRTUAL_UNIX_ROOT() { STATIC_STRING("c:/cygwin"); } ////////////// -// static storage for virtual unix root, if used. +// static storage for virtual unix root, if it's used. +// we don't expect it to change during runtime, right? that would be fubar. +// so we cache it once we retrieve it. SAFE_STATIC(astring, static_root_holder, ) -// we don't expect it to change during runtime, right? that would be fubar. astring application_configuration::get_virtual_unix_root() { #ifdef __UNIX__ @@ -315,13 +317,13 @@ astring application_configuration::get_virtual_unix_root() } /* - read the path out of the config file, which should have been set during the + use the path in our system helpers header, which should have been set during the build process if this is really windows. */ - astring virtual_root = read_item(WINDOZE_VIRTUAL_ROOT_NAME()); +/// astring virtual_root = read_item(WINDOZE_VIRTUAL_ROOT_NAME()); + astring virtual_root = FEISTY_MEOW_VIRTUAL_UNIX_ROOT; if (!virtual_root) { // if it has no length, we didn't get our setting! we'll limp along with a guess. - // also don't cache the failure value. maybe it will wake up later! return DEFAULT_VIRTUAL_UNIX_ROOT(); } else { static_root_holder() = virtual_root; diff --git a/nucleus/library/configuration/application_configuration.h b/nucleus/library/configuration/application_configuration.h index 34d57751..5633beae 100644 --- a/nucleus/library/configuration/application_configuration.h +++ b/nucleus/library/configuration/application_configuration.h @@ -104,7 +104,7 @@ public: static const basis::astring &LOGGING_FOLDER_NAME(); //!< the tag used for finding our logging path in the paths config file. - static const basis::astring &WINDOZE_VIRTUAL_ROOT_NAME(); +// static const basis::astring &WINDOZE_VIRTUAL_ROOT_NAME(); //!< the tag used for looking up the virtual windows path in the paths config file. static const basis::astring &DEFAULT_VIRTUAL_UNIX_ROOT(); diff --git a/nucleus/library/filesystem/filename.cpp b/nucleus/library/filesystem/filename.cpp index d12d9e7e..4abca2ad 100644 --- a/nucleus/library/filesystem/filename.cpp +++ b/nucleus/library/filesystem/filename.cpp @@ -19,18 +19,8 @@ #include #include -#include -/* - hmmm: note that we are relying on forward declared code here. - the canonical ordering for feisty's nucleus has the filesystem code come before - the configuration code, because the configuratin library uses filesystem features. - not sure i want to resolve this bizarritude at this time, but it points to the - need for a virtual interface at lower level than either filesystem or configuration - libraries, so we can emplace the need for the virtual unix root as a low-level - dependency to be implemented later. - */ - #include +#include #include #include @@ -265,13 +255,14 @@ if (inject_root) LOG("decided to inject root since path is '/'."); if (inject_root) LOG(astring("decided to inject root since path is compatible: ") + *this); } -LOG(astring("after second phase root injection: ") + *this); +LOG(astring("after second phase root injection: ") + raw()); if (inject_root) { // inject the actual path to the unix root in front, if we know it. // if we don't know it, then a default path that's unlikely to work is idiotically plugged in. - insert(0, configuration::application_configuration::get_virtual_unix_root()); -LOG(astring("turned cygdrive path string into: ") + *this); + insert(0, FEISTY_MEOW_VIRTUAL_UNIX_ROOT); +///nope configuration::application_configuration::get_virtual_unix_root()); +LOG(astring("turned cygdrive path string into: ") + raw()); } #endif diff --git a/production/paths.ini b/production/paths.ini index df2d0646..bd804e11 100644 --- a/production/paths.ini +++ b/production/paths.ini @@ -1,8 +1,4 @@ [Common] # default logging path that users can alter if needed. LogPath=$FEISTY_MEOW_GENERATED_STORE/logs -# default location of virtual root directory for Unix. -# replaced at runtime on windoze if cygwin is available. -#hmmm: support msys too at some point? very worthy as well. -VirtualUnixRoot=c:/cygwin diff --git a/production/system_helper_template.h b/production/system_helper_template.h new file mode 100644 index 00000000..96b01772 --- /dev/null +++ b/production/system_helper_template.h @@ -0,0 +1,30 @@ +#ifndef SYSTEM_HELPER_GROUP +#define SYSTEM_HELPER_GROUP + +////////////// +// Name : system helper header +// Author : Chris Koeritz +// Rights : Copyright (c) 2012-$now By Author +////////////// +// This file is free software; you can modify/redistribute it under the terms +// of the GNU General Public License. [ http://www.gnu.org/licenses/gpl.html ] +// Feel free to send updates to: [ fred@gruntose.com ] +////////////// + +//! Isolates a few system dependencies for feisty meow runtime environment. + +////////////// + +/* + default location of virtual root directory for Unix. + the contents here are replaced at runtime on windoze if cygwin is + available. +*/ +#define FEISTY_MEOW_VIRTUAL_UNIX_ROOT "c:/cygwin" + +// hmmm: support msys too at some point? very worthy as well. + +////////////// + +#endif + diff --git a/scripts/clam/cpp/variables.def b/scripts/clam/cpp/variables.def index 24b8148c..b56c294b 100644 --- a/scripts/clam/cpp/variables.def +++ b/scripts/clam/cpp/variables.def @@ -206,8 +206,9 @@ export DYNAMIC_LIBRARY_DIR = $(TARGETS_STORE) export STATIC_LIBRARY_DIR = $(TARGETS_STORE) # "HEADER_SEARCH_PATH" is where the class interface files are to be found. -# we add the generated store folder for the build version file. -HEADER_SEARCH_PATH = $(FEISTY_MEOW_GENERATED_STORE)/versions +# the generated store folder is added to access the build version file. +# the binaries are added to access the system_helper.h file. +HEADER_SEARCH_PATH = $(FEISTY_MEOW_GENERATED_STORE)/versions $(FEISTY_MEOW_BINARIES) # "HOOPLE_HEADERS" are locations where the HOOPLE headers can be found. ifeq "$(HOOPLE_HEADERS)" "" diff --git a/scripts/generator/produce_feisty_meow.sh b/scripts/generator/produce_feisty_meow.sh index 7466031b..41e3bd54 100644 --- a/scripts/generator/produce_feisty_meow.sh +++ b/scripts/generator/produce_feisty_meow.sh @@ -54,17 +54,39 @@ source "$BUILD_SCRIPTS_PATH/build_variables.sh" "$BUILD_SCRIPTS_PATH/build_varia ############## # creates the directory for our binaries and gives it a reasonable paths configuration. -function prepare_binaries_dir() +function prepare_clam_binaries_dir() { # we'll store binaries here from the bootstrap process. if [ ! -d "$CLAM_BINARIES" ]; then - echo "creating binary dir now in $CLAM_BINARIES" + echo "creating clam binary dir now in $CLAM_BINARIES" mkdir -p "$CLAM_BINARIES" + exit_on_error "creating clam binary directory in $CLAM_BINARIES" fi if [ ! -f "$CLAM_BINARIES/paths.ini" ]; then cp "$PRODUCTION_STORE/paths.ini" "$CLAM_BINARIES" - echo "copied paths.ini to binary dir." + exit_on_error "copying paths.ini to $CLAM_BINARIES" + echo "copied paths.ini to clam binary dir." fi +} + +# fix the system helper header up by calling cygpath to determine the cygwin +# root, if we are on windoze and cygwin. +function update_system_helper_header() +{ + # create our main binaries directory if needed. + if [ ! -d "$FEISTY_MEOW_BINARIES" ]; then + echo "creating feisty meow binary folder now in $FEISTY_MEOW_BINARIES" + mkdir -p "$FEISTY_MEOW_BINARIES" + exit_on_error "creating feisty meow binary folder in $FEISTY_MEOW_BINARIES" + fi + + # copy up the system helper template version into the binaries directory. + if [ ! -f "$FEISTY_MEOW_BINARIES/system_helper.h" ]; then + cp "$PRODUCTION_STORE/system_helper_template.h" "$FEISTY_MEOW_BINARIES/system_helper.h" + exit_on_error "creating system_helper header in $FEISTY_MEOW_BINARIES" + echo "copied system_helper header to feisty meow binary dir." + fi + # set the cygwin root path if we're on cygwin. whichable cygpath if [ $? -eq 0 ]; then @@ -79,9 +101,12 @@ echo "found root as '$found_root'" found_root=$(echo $found_root | tr '\\' '/') echo "processed root is now: '$found_root'" # edit the entry in place to correct the default path. - sed -i -e "s%VirtualUnixRoot=.*%VirtualUnixRoot=$found_root%" "$CLAM_BINARIES/paths.ini" -echo "paths file now has:" -cat "$CLAM_BINARIES/paths.ini" + sed -i \ + -e "s% *#define FEISTY_MEOW_VIRTUAL_UNIX_ROOT \".*$%#define FEISTY_MEOW_VIRTUAL_UNIX_ROOT \"$found_root\"%" \ + "$CLAM_BINARIES/paths.ini" + exit_on_error "updating system_helper header in $FEISTY_MEOW_BINARIES" +echo "system helper file now has:" +cat "$FEISTY_MEOW_BINARIES/system_helper.h" fi } @@ -98,7 +123,7 @@ echo "Build bootstrap process has started." # preconditions for the build process... # set up our output directories etc. -prepare_binaries_dir +prepare_clam_binaries_dir # set a flag for this process so we can omit certain compilations as necessary. export BOOT_STRAPPING=true @@ -149,7 +174,7 @@ function strip_cr { # NOTE: this depends on the operating system having been chosen above! if [ "$OPERATING_SYSTEM" = "UNIX" ]; then function promote { - prepare_binaries_dir + prepare_clam_binaries_dir if [ ! -f "$INTERMEDIATE_STORE/$1" ]; then echo "Failed to build the application $1--quitting now." @@ -161,7 +186,7 @@ if [ "$OPERATING_SYSTEM" = "UNIX" ]; then } elif [ "$OPERATING_SYSTEM" = "WIN32" ]; then function promote { - prepare_binaries_dir + prepare_clam_binaries_dir if [ ! -f "$INTERMEDIATE_STORE/$1.exe" ]; then echo "Failed to build the application $1.exe--quitting now." @@ -198,6 +223,9 @@ if [ -z "$SAVE_BINARIES" ]; then done fi +# copy the system helper header. +update_system_helper_header + # rebuild the dependency tool. needed by everything, pretty much, but # since it's from the xfree project, it doesn't need any of our libraries. if [ ! -f "$CLAM_BINARIES/makedep$EXE_ENDING" ]; then @@ -268,13 +296,15 @@ echo "The build binaries have been re-created (or were already present)." if [ -z "$JUST_BOOTSTRAP_APPS" ]; then echo Cleaning up the temporary files that were built. bash "$BUILD_SCRIPTS_PATH/whack_build.sh" -#wrong! we don't want to whack it all. clean # recreate our useful junk directories... mkdir -p "$FEISTY_MEOW_GENERATED_STORE" mkdir -p "$TEMPORARIES_PILE" mkdir -p "$FEISTY_MEOW_LOGS" + # re-copy the system helper header. + update_system_helper_header + echo Now starting a normal build of the repository source code. pushd "$FEISTY_MEOW_APEX" &>/dev/null unset BUILD_DEFAULTS