-
-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve: build (such as scan-build
) through -- or load (such as dlopen()
) into -- more tools.
#18
Labels
Comments
SwuduSusuwu
added
improve
New feature or request
good first issue
Good for newcomers
labels
Nov 15, 2024
SwuduSusuwu
added a commit
that referenced
this issue
Nov 16, 2024
: is the most common structure for C++ projects (so {`*.o`, `*.out`} won't pollute the project's root, also so you have {`obj/`, `bin/`} paths to pass to other tools). `%s/FILE_OUT/OUTPUT/`: since lots of named object files output now, rename this so it is obvious that this is the final output. Plus, lots of projects use `OUTPUT` as the executable out. ?`CXX`: Note to inherit local `CXX` as soon as know it can use our `CXXFLAGS`. Format: comments use /**/ (if line wraps, it is thus obvious where comments stop). ?`CXXFLAGS_ANALYSIS`: comment typo fix (mismatched ``). ?`Macros.sh`: +`SUSUWU_DIR_SUFFIX_SLASH()`, +`SUSUWU_DIR_AFFIX_DOTSLASH()` (if inherit values, use this). Is progress to issue #18 (support more tools). Is followup to: 4fef864 (?build.sh: `-Og`, `SusuwuUnitTestsBitmask`, cleanup)
SwuduSusuwu
added a commit
that referenced
this issue
Nov 16, 2024
plus howto redirect `OBJDIR` or `BINDIR`). Fixups: Ambiguous terms now clickable. ?`Target:`: version requirement English improved. ?"Allowed flags": (Now "Console flags") separate into list. Is followup to: 35b2387 (?`build.sh`: +`OBJDIR`(+`obj/`), +`BINDIR`(+`bin/`)), which is for issue #18 (support more tools).
SwuduSusuwu
added a commit
that referenced
this issue
Nov 16, 2024
plus howto redirect `OBJDIR` or `BINDIR`). Fixups: Ambiguous terms now clickable. ?`Target:`: version requirement English improved. ?"Allowed flags": (Now "Console flags") separate into list. Is followup to: 35b2387 (?`build.sh`: +`OBJDIR`(+`obj/`), +`BINDIR`(+`bin/`)), which is for issue #18 (support more tools).
SwuduSusuwu
added a commit
that referenced
this issue
Nov 16, 2024
plus howto redirect `OBJDIR` or `BINDIR`). Fixups: Ambiguous terms now clickable. ?`Targets:`: version requirement English improved. ?`Allowed flags;`: (Now `Console flags:`) separate into list. Is followup to: 35b2387 (?`build.sh`: +`OBJDIR`(+`obj/`), +`BINDIR`(+`bin/`)), which is for issue #18 (support more tools).
SwuduSusuwu
added a commit
that referenced
this issue
Nov 17, 2024
unless called as `./build.sh [--clean || --rebuild]` (or unless source code is more new). This reduces average build times an order of magnitude, but was too much bloat with list of sources to build (thus replaced lists with loops). Is progress to issue #18 (which is almost all about build scripts). Is followup to: 35b2387 (?`build.sh`: +`OBJDIR`(+`obj/`), +`BINDIR`(+`bin/`)). TODO: since generic code replaced most of this, move the generic code into `./Macros.sh` (or other script suitable to reuse). TODO: remove `[` clutter, remove `basename` clutter (`> /dev/null` doesn't fix this). ?`README.md`: Misc typo fixes. ?`Console flags:`: How to put `--clean` (or `--rebuild`) to use. ?`Files:`: Point out that incremental builds require prefix "Class" for local includes. Is followup to 58f4a78 (?`README.md`: ... Fixups: ...).
SwuduSusuwu
added a commit
that referenced
this issue
Nov 17, 2024
?`cxx/ClassSys.hxx`: support `-std=c++11`. ?`classSysUSeconds`: `error: 'auto' return without trailing return type; deduced return types are a C++14 extension` fix. ?`classSysColoredParamStr`: `error: 'auto' return without trailing return type; deduced return types are a C++14 extension` fix. ?`classSysColoredParamStr`: `error: no member named 'remove_const_t' in namespace 'std'; did you mean 'remove_copy_if'?` fix. ?`templateCatchAll`: `error: 'auto' return without trailing return type; deduced return types are a C++14 extension` fix. ?`cxx/ClassResultList.hxx`: support `-std=c++11`. ?`listMaxSize`: `:%s/const auto &/const typename List::const_iterator::value_type &/`: `error: 'auto' not allowed in lambda parameter before C++14` fix. ?`listFindValue`: `error: 'auto' return without trailing return type; deduced return types are a C++14 extension` fix. -`listDefaultIterator`: `warning: variable templates are a C++14 extension [-Wc++14-extensions]` fix. ?`listFindValue`, ?`listHasValue`: `:%s/listDefaultIterator/List::value_type::const_iterator()/`. +`#include <string>`: `warning: no header providing ?`cxx/VirusAnalysis.*xx`: support `-std=c++11`. ?`virusAnalyses`: `:%s/typeof(virusAnalysisFun)/virusAnalysisFun/`: `error: unexpected type name 'VirusAnalysisFun': expected expression` fix, `error: template argument for template type parameter must be a type` fix. ?`cxx/AssistantCns.cxx`: support `-std=c++11`. ?`questionsResponsesFromXhtml`: `:%s/typeof question/decltype(question)/`: `error: unknown type name 'typeof'; did you mean 'typedef'?` fix. `clang-tidy`: ?`cxx/ClassResultList.hxx`: +`#include <string>`: `warning: no header providing "std::string" is directly included [misc-include-cleaner]` fix. ?`cxx/ClassResultList.cxx`: [misc-use-anonymous-namespace]. -`#include "ClassSys.hxx": `warning: included header ClassSys.hxx is not used directly [misc-include-cleaner]`: fix. `warning: function 'classResultListDumpToTest' declared 'static', move to anonymous namespace instead [misc-use-anonymous-namespace]`: suppressed (function is called.) +`#include <string>`: `warning: no header providing "std::string" is directly included [misc-include-cleaner]` fix. ?`classResultListTests`: `warning: 0x32 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers]` fix. ?`posts/VirusAnalysis.md`: Include all this. ?`README.md`: ?`# How to`: Minimum requirement is now C++11 to use. As this allows `./build.sh` to include `-std=c++11`, this has to do with issue #18 (support more tools.) The last commit about issue #18 was 2a6e624 (?`build.sh`: incremental builds (reuse objects)), which doesn't touch `cxx/*` nor `posts/*`.
SwuduSusuwu
added a commit
that referenced
this issue
Nov 17, 2024
?`cxx/Macros.hxx`: +`SUSUWU_POSIX` +`SUSUWU_WIN32` +`SUSUWU_HAS_FEATURE` +`SUSUWU_HAS_ATTRIBUTE` -[duplicate SUSUWU_NORETURN code] ?`cxx/ClassSys.*xx`: `:%s/_POSIX_VERSION/SUSUWU_POSIX/` `:%s/__WIN32__/SUSUWU_WIN32/` ?`cxx/ClassSys.*xx`: `:%s/SUSUWU_PRINT(ERROR/SUSUWU_ERROR/`: _Windows_ warning (about <shlobj.h>::ERROR) fix. ?`cxx/ClassSys.cxx`, ?`cxx/ClassSha2.cxx`: `:%s/SUSUWU_PRINT(WARNING/SUSUWU_WARNING/`: Ditto, for possible systems which `#define WARNING`. ?`cxx/ClassSha2.*xx`: `:%s/sha1/classSha1/` `:%s/sha256/classSha256/` `:%s/sha512/classSha512/` `:%s/sha2/classSha2/` `:%s/Sha2/ClassSha2/` `:%s/classClassSha/classSha/` `:%s/ClassClassSha/ClassSha/` ?`cxx/ClassResultList.hxx`, ?`cxx/VirusAnalysis.cxx`, ?`cxx/AssistantCns.cxx`: `:%s/sha2/classSha2/` ?`cxx/AssistantCns.*xx`: `:%s/questionsResponsesFromHosts/assistantCnsDownloadHosts/`, `:%s/questionsResponsesFromXhtml/assistantCnsProcessXhtml/`, `:%s/assistantParse/assistantCnsProcess/`. ?`posts/VirusAnalysis.md`: Include all this. Some has to do with issue #18 (support more tools), as other systems have tools with possible collisions, which this improves. ?`README.md`: ?`Targets:`: Include default member inits with requirements for C++11. Is followup to: d7370e8 (?`cxx/*.*x`: undo C++14 code, support `-std=c++11`)
? |
SwuduSusuwu
added a commit
that referenced
this issue
Nov 18, 2024
?`Macros.sh`: +`SUSUWU_BUILD_SOURCES()`, +`SUSUWU_REBUILD_CTAGS()`, +`SUSUWU_SETUP_CXX_PROCESS_MINGW()`, +`SUSUWU_PROCESS_RELEASE_DEBUG()`, +`SUSUWU_SETUP_BUILD_FLAGS()`, +`SUSUWU_SETUP_OUTPIT_DIRS()`, +`SUSUWU_CLEAN_OUTPUT()`, +`SUSUWU_PROCESS_CLEAN_REBUILD()`, +`SUSUWU_TEST_OUTPUTS()` (from `./build.sh`.) This allows to use `Macros.sh` as a simple `make` substitute. ?`build.sh`: Now that most of the reusable code was used to produce functions in `Macros.sh`, replace `build.sh`'s copy of that code with calls to `Macros.sh`; This allows simple replacement of most of our build logic with `make` (or `CMake`) in the future, which assists with issue #18 (support more tools). Is followup to: 2a6e624 (?`build.sh`: incremental builds (reuse objects)) TODO: `OBJDIR="./obj/"`, `BINDIR="./bin/"`, `for SOURCE in ${CXX_SOURCE_PATH}Class*.hxx ${CXX_SOURCE_PATH}Macros.hxx; do` are somewhat project-specific (just for local use); Remove our project-specific (local) values from the new `Macros.sh` functions, have new functions more close to `make` protocols, have `build.sh` call those functions with our project-specific (local) values.
SwuduSusuwu
added a commit
that referenced
this issue
Nov 19, 2024
plus comment fixes, plus improve codeflow. `make` protocols: ?`Macros.sh`: -`SUSUWU_BUILD_SOURCES()`: split into: +`SUSUWU_PROCESS_INCLUDES()`: `:%s/${CXX_SOURCE_PATH}Class*.hxx ${CXX_SOURCE_PATH}Macros.hxx/$@/`, plus comment howto use. +`SUSUWU_BUILD_SOURCES()`, plus comment howoto use. -`SUSUWU_SETUP_CXX_PROCESS_MINGW()`: split into; +`SUSUWU_PROCESS_MINGW()` (plus comment howto use), +`SUSUWU_SETUP_CXX()`. -`SUSUWU_SETUP_OUTPUT_DIRS()`: split into; +`SUSUWU_SETUP_OUTPUT()`: `:%s/"a/"${1}/`, +`SUSUWU_SETUP_BINDIR()`: `:%s/"\.\/bin\/"/${1}/`, +`SUSUWU_SETUP_OBJDIR()`: `:%s/"\.\/obj\/"/${1}/`, plus comment howto use. ?`Macros.sh`, ?`build.sh`: -`SUSUWU_BUILD_SOURCES`: split into; +`SUSUWU_PROCESS_INCLUDES ${CXX_SOURCE_PATH}Class*.hxx ${CXX_SOURCE_PATH}Macros.hxx` +`SUSUWU_BUILD_SOURCES`` -`SUSUWU_SETUP_CXX_PROCESS_MINGW`: split into; +`SUSUWU_PROCESS_MINGW $?` (plus comment howto use), +`SUSUWU_SETUP_CXX`. -`SUSUWU_SETUP_OUTPUT_DIRS`: split into; +`SUSUWU_SETUP_OUTPUT "a"`, +`SUSUWU_SETUP_BINDIR "./bin/"`, +`SUSUWU_SETUP_OBJDIR "./obj/"`. Is followup to: d025402 (...TODO: ... Remove our project-specific (local) values from the new `Macros.sh` functions, have new functions more close to `make` protocols, have `build.sh` call those functions with our project-specific (local) values.) Comment fixes: ?`Macros.sh`: ?`SUSUWU_AFFIX_DOTSLASH()`: Usage example is now `BINDIR` (since `./` is used to execute.) ?`SUSUWU_SETUP_CXX()`, ?`SUSUWU_SETUP_BUILD_FLAGS()`, ?`SUSUWU_PROCESS_RELEASE_DEBUG()`, ?`SUSUWU_PROCESS_CLEAN_REBUILD()`: comment how to use. ?`build.sh`: ?`SUSUWU_PROCESS_MINGW`, ?`SUSUWU_PROCESS_RELEASE_DEBUG`, ?`SUSUWU_PROCESS_CLEAN_REBUILD`: comment how to use. ?`README.md`: ?`Special flags`: howto use. Improved codeflow: ?`build.sh`: -`SUSUWU_REBUILD_CTAGS()`, +`SUSUWU_BUILD_CTAGS()`. +`CXXFLAGS_SPECIAL`: For `README.md` flags. ?`CXXFLAGS`: Now includes `CXXFLAGS_SPECIAL`. Replace duplicate code with `SUSUWU_SETUP_BUILD_FLAGS`. ?`Macros.sh`: +`SUSUWU_BUILD_CTAGS`, plus comment howto use. ?`SUSUWU_CLEAN_OUTPUT()`: Remove all build targets (as `make clean` does). Comment reason `-f` is omitted. ?`SUSUWU_INCLUDE_SOURCES()`: typo fix: forgot to escape the '`' around `#include`. ?`SUSUWU_BUILD_SOURCES()`: Replace mixed conditional formats with simple if block. ?`SUSUWU_BUILD_SOURCES()`: Output `LD` error codes. Is followup to: d025402 (Move generic code from ?`build.sh` to ?`Macros.sh). Has to do with issue #18 (support more tools). ?`posts/VirusAnalysis.md`: include f2cf644 (`--mingw`/`SUSUWU_WIN32` regression fix, typos fix) (that commit forgot to update `posts/VirusAnalysis.md`:`classSysHexStrTests`)
SwuduSusuwu
added a commit
that referenced
this issue
Nov 20, 2024
codeflows too. Is for issue #21 (but also, somewhat, for issue #18). Is followup to: 3ee82e4 (?`Macros.sh`: more close to `make` protocols). ?`Macros.sh`: ?`SUSUWU_SETUP_BUILD_FLAGS()`: +`OBJECTLIST=""`. ?`SUSUWU_SETUP_OUTPUT()`: +`BUILDNEW={true,false}`. Moved below `SUSUWU_SETUP_BINDIR` (plus `SUSUWU_SETUP_OBJDIR`), since `BUILDNMEW` depends on `BINDIR` (also since `BINDIR` (plus `OBJDIR`) is used first throughout `Macros.sh`). ?`SUSUWU_CLEAN_OUTPUT()`: hide error messages (without dangerous `-f` flag). `:%s/NOTICE/INFO/`: isn't usual path. -`SUSUWU_CLEAN_OUTPUT()`: to shorten/reuse messages (avoids out-of-sync changes to messages,) split into +`SUSUWU_CLEAN_OUTPUT_IMPL()`, +`SUSUWU_CLEAN_OUTPUT()`, +`SUSUWU_REBUILD_OUTPUT()` (, which have comments on howto use.) ?`SUSUWU_PROCESS_CLEAN_REBUILD()`, ?`SUSUWU_PROCESS_SOURCES()`: use new {`SUSUWU_CLEAN_OUT()`,`SUSUWU_REBUILD_OUTPUT()`} functions. ?`SUSUWU_PROCESS_MINGW()`, ?`SUSUWU_SETUPCXX()`: -`CXXFLAGS_DEBUG+=CXXFLAGS_FSAN`, +`USE_FSAN={true, false}`. ?`SUSUWU_PROCESS_RELEASE_DEBUG()`: If `USE_FSAN`; `CXXFLAGS+=FLAGS_FSAN`, `LDFLAGS+=FLAGS_FSAN`, `export ASAN_OPTIONS=...`. Comment typo (mismatched ``) fix. ?`SUSUWU_PROCESS_INCLUDE()`: `:%s/${CXX_SOURCE_PATH}/$(dirname ${SOURCE})\//` (non-C++ path fix.) ?`SUSUWU_BUILD_SOURCES()`: -`SUSUWU_BUILD_SOURCES()`: since it used hardcoded suffixes plus paths, split into; So multiple `SUSUWU_BUILD_OBJECTS()` calls won't duplicated those: -`OBJECTLIST=""` (moved into ?`SUSUWU_SETUP_BUILD_FLAGS()`,) -`BUILDNEW={true,false}` (moved into ?`SUSUWU_SETUP_OUTPUT()`.) +`SUSUWU_BUILD_OBJECTS()`: Has comment (on howto pass suffix plus paths.) `:%s/test -e/test -s/` (exists -> non-zero plus exists). +`SUSUWU_BUILD_EXECUTABLE()`: Is generic (without params.) If linker errors; print status code, plus suggest howto fix this. ?`SUSUWU_TEST_OUTPUT()`: if `./build.sh --mingw`, test that `wine` exists ("./bin/a.exe: 1: Syntax error: word unexpected (expecting ")")" fix.) +`SUSUWU_TODO_LIST()`: allows to reuse common "TODO" messages for unimplemented features. +`SUSUWU_FORMAT()`, +`SUSUWU_DOCS()`, +`SUSUWU_INSTALL()`, +`SUSUWU_UNINSTALL()`: placeholders for common `make` tools. ?`Macros.sh`, ?`build.sh`: `:%s/CXXFLAGS_FSAN/FLAGS_FSAN`: to prevent "ld.lld: error: undefined symbol: __asan_*", `${LDFLAGS}` must have `-fsan*`. ?`build.sh`: ?`SUSUWU_SETUP_OUTPUT`: since it now uses `OBJDIR`, move down below `SUSUWU_SETUP_OBJDIR`. -`SUSUWU_BUILD_SOURCES`: `Macros.sh` split this into multiple functions. +`SUSUWU_BUILD_OBJECTS "${CC} ${CCFLAGS}" ".c" "${C_SOURCE_PATH}rfc6234/sha1.c" "${C_SOURCE_PATH}rfc6234/sha224-256.c" "${C_SOURCE_PATH}rfc6234/sha384-512.c`. +`SUSUWU_BUILD_OBJECTS "${CXX} ${CXXFLAGS}" ".cxx" "${CXX_SOURCE_PATH}*.cxx"` +`SUSUWU_BUILD_EXECUTABLE` ?`SUSUWU_SETUP_CXX`, ?`SUSUWU_SETUP_BUILD_FLAGS`, ?`SUSUWU_TEST_OUTPUT`: Now has comment.
SwuduSusuwu
added a commit
that referenced
this issue
Nov 20, 2024
more close to `make` protocols, improve codeflow. ?`Macros.sh`: ?`SUSUWU_PROCESS_MINGW()`: move `CXX=` into ?`SUSUWU_SETUP_CXX()`. ?`SUSUWU_SETUP_CXX()`: if inherit `CXX` from global environment; also inherit `CC`, also inherit `LD`. ?`SUSUWU_SETUP_BUILD_FLAGS()`: move `CXX=` into ?`SUSUWU_SETUP_CXX()`. +`SUSUWU_PROCESS_BINDIR()`: used in `SUSUWU_INSTALL`, `SUSUWU_UNINSTALL` (to detect install path for executables.) ?`SUSUWU_INSTALL()`: implement, but there is just 1 output file to install (for now.) ?`SUSUWU_UNINSTALL()`: implement, but there is just 1 output file to uninstall (for now.) ?`build.sh`: test `SUSUWU_INSTALL` && `SUSUWU_UNINSTALL`. Is followup to: d6332e9 (?`Macros.sh`: more close to `make` protocols, improve), Is progress to issues: #18 (support more tools), #21 (mimic `make` protocol).
SwuduSusuwu
added a commit
that referenced
this issue
Nov 20, 2024
... much improved, plus typo fixes. ?`Macros.sh: `:%s/SUSUWU_PROCESS_MINGE/SUSUWU_PROCESS_MINGW/`: typo fix. ?`SUSUWU_SUFFIX_SLASH()`, ?`SUSUWU_AFFIX_DOTSLASH()`: `:%s/$1/${1}/`: style/typo fix. ?`SUSUWU_PRINT()`: style/comment improved. ?`SUSUWU_PROCESS_MINGW()`, ?`SUSUWU_PROCESS_RELEASE_DEBUG()`, ?`SUSUWU_PROCESS_CLEAN_REBUILD()`: `:%s/ -o / -o /` (typo fix). ?`SUSUWU_SETUP_CXX()`: quote `${CROSS_COMP}`. ?`SUSUWU_PROCESS_INCLUDE()`, ?`SUSUWU_BUILD_OBJECTS()`: limit temp variables to `local` scope. ?`SUSUWU_PROCESS_USRBIN()`: to prevent `cp: cannot create regular file '${USRBIN}/${OUTPUT}': Read-only file system`, prefer `USRBIN in ~/`. ?`SUSUWU_BUILD_CTAGS()`: move down to rest of `SUSUWU_BUILD_*()` functions (since now uses `${C_SOURCE_PATH}` and `${CXX_SOURCE_PATH}`, unless you execute as `SUSUWU_BUILD_CTAGS "-flags..." "./path/"`). ?`SUSUWU_TEST_OUTPUT()`: if ` --mingw` but "wine not found", `return 1`. `:%s/$?/$@/`, `:%s/STATUS=$@/STATUS=$?/`: typo fix ("Usage: ... $?" -> "Usage: ... ?@".) ?`build.sh`: ?`SUSUWU_BUILD_CTAGS`: Move down to rest of `SUSUWU_BUILD_*` calls. Now produces `./tags` (which `ex`, `vi`, `vim` can use.) Comment how to use this. ?`SUSUWU_PROCESS_MINGW`: comment how to use this. ?`README.md`: ?`#Contributor-conventionsrules`: English improved, `:%s/Git/`git`/`, `:%s/[Source](#Source),[_C_/_C++_ source](#Cc-source)/`, +"[`sh` source](#Sh-source)". Is followup to: f041ae9 (?`SUSUWU_[UN]INSTALL()`: implement. ?`Macros.sh`: more close to `make` protocols, improve codeflow). Is progress to issues: #18 (support more tools), #21 (full `make` support).
SwuduSusuwu
referenced
this issue
Dec 6, 2024
Some of those (such as `SUSUWU_PREFER_C` have to do with issue # 18 (support more tools).
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
[?build.sh:
-Og
,SusuwuUnitTestsBitmask
, cleanup@4fef864](https://github.com/SwuduSusuwu/SubStack/commit/4fef864) is some progress to this -- has
build.sh
more modular (to follow environment variables such as {CC
,CXX
,LD
,CCFLAGS
,CXXFLAGS
,LDFLAGS
}, which tools such asscan-build
use).The next commit (or 2) will have
build.sh
more modular to mimic commonmake
systems:OBJDIR
,BINDIR
,OUTPUT
}What the next commit or 2 won't do (good first issue tasks which you can contribute to with pull requests, or respond that you will use this if produced):
${CXX} -fPIC -shared
to produce./lib/a.so
.dlopen("./lib/a.so", ...)
.The text was updated successfully, but these errors were encountered: