From 2bd3ffca27aac1e4b050eb4268cb982a758e9958 Mon Sep 17 00:00:00 2001 From: "Lucas, John P." Date: Mon, 15 Sep 2025 18:22:43 -0400 Subject: [PATCH 1/6] [tryspaceorg/tryspace-lab#51] Modifications after CompFlags.cmake improvements; --- comp/CompFlags.cmake | 71 ++++++++++++++++++++++++++++++-------------- comp/adcs | 2 +- comp/demo | 2 +- comp/eps | 2 +- comp/radio | 2 +- fsw | 2 +- simulith | 2 +- 7 files changed, 54 insertions(+), 29 deletions(-) diff --git a/comp/CompFlags.cmake b/comp/CompFlags.cmake index 3a6455f..77e4934 100644 --- a/comp/CompFlags.cmake +++ b/comp/CompFlags.cmake @@ -2,29 +2,54 @@ include(CheckCCompilerFlag) set(TRYSPACE_C_FLAGS - "-Wall" - "-Wextra" - "-Wpedantic" - "-Wformat=2" - "-Wno-discarded-qualifiers" - "-Winline" - "-Wpointer-arith" - "-Wredundant-decls" - "-Wwrite-strings" - "-Wuninitialized" - "-Winit-self" - "-Wswitch-default" - "-Wfloat-equal" - "-Wno-packed" - "-Wno-unused-parameter" - "-Wvariadic-macros" - "-Wvla" - "-Wstrict-overflow" - "-Wstrict-overflow=5" - "-fdiagnostics-show-option" - "-pedantic-errors" - "-fprofile-arcs" - "-ftest-coverage" + # --- Diagnostics and coverage --- + "-fdiagnostics-show-option" # Show warning/diagnostic option in output + "-fprofile-arcs" # Code coverage (gcov) + "-ftest-coverage" # Code coverage (gcov) + + # --- Core warnings and strictness --- + "-Wall" # Enable all common warnings + "-Werror" # Treat warnings as errors + "-Wextra" # Enable extra warnings + "-Wpedantic" # Enforce standard compliance + "-Wformat=2" # Strict format string checking + "-Wconversion" # Warn on implicit type conversions + "-Wsign-conversion" # Warn on sign conversions + "-Wshadow" # Warn about variable shadowing + "-Wpointer-arith" # Warn about pointer arithmetic on void* and function pointers + "-Wcast-align" # Warn about cast alignment issues + "-Wstrict-prototypes" # Warn about missing function prototypes + "-Wmissing-prototypes" # Warn about missing prototypes in files + "-Wmissing-declarations" # Warn about missing declarations + "-Wredundant-decls" # Warn about redundant declarations + "-Wwrite-strings" # Make string literals const char* + "-Wuninitialized" # Warn about uninitialized variables + "-Winit-self" # Warn about variables initialized with themselves + "-Wswitch-default" # Warn if switch statement does not have a default case + "-Wswitch-enum" # Warn if switch on enum does not handle all values + "-Wfloat-equal" # Warn about comparing floating point values for equality + "-Wundef" # Warn if undefined macros are used + "-Wbad-function-cast" # Warn about bad function casts + + # --- Suppressions and compatibility --- + "-Wno-discarded-qualifiers" # Suppress warnings about discarded qualifiers + "-Wno-packed" # Suppress warnings about packed attribute + "-Wno-unused-parameter" # Suppress warnings about unused parameters + + # --- Overflow and macros --- + "-Wstrict-overflow" # Warn about code that may have strict overflow issues + "-Wstrict-overflow=5" # Maximum strict overflow warnings + "-Wvariadic-macros" # Warn about variadic macros + "-Wvla" # Warn about use of variable length arrays + + # --- Standard enforcement --- + "-pedantic-errors" # Make all pedantic warnings into errors + + # --- Optimization and safety --- + "-O2" # Optimize for speed (use -O3 for max, -Og for debug) + "-std=c99" # Enforce C99 standard (or use -std=c11) + "-D_FORTIFY_SOURCE=2" # Enable buffer overflow protection (if supported) + "-fstack-protector-strong" # Enable stack protection ) # Example: Add target-specific flags diff --git a/comp/adcs b/comp/adcs index a470444..24867d3 160000 --- a/comp/adcs +++ b/comp/adcs @@ -1 +1 @@ -Subproject commit a470444657998ca8c09e48d7211c59f148ebfb97 +Subproject commit 24867d334316d463738dccfe99ce371998a59294 diff --git a/comp/demo b/comp/demo index 10f7385..db65a55 160000 --- a/comp/demo +++ b/comp/demo @@ -1 +1 @@ -Subproject commit 10f7385dd472d0cf8df3eb7b118c60ef78f6d5f0 +Subproject commit db65a5503b90dc8492ae04e73a19a416f6a44377 diff --git a/comp/eps b/comp/eps index cb0f001..eebcfec 160000 --- a/comp/eps +++ b/comp/eps @@ -1 +1 @@ -Subproject commit cb0f001eb3a3c113f8e7ada7cd48bc53f2390fea +Subproject commit eebcfecf75d0718b4d90a40ea8dbc503e3143fb8 diff --git a/comp/radio b/comp/radio index 3337195..bac8a8a 160000 --- a/comp/radio +++ b/comp/radio @@ -1 +1 @@ -Subproject commit 3337195177756fe99e80eb10a481479dfe7a186d +Subproject commit bac8a8af7352399272626f7a0d3569183b45dd23 diff --git a/fsw b/fsw index 3524d39..c2de14e 160000 --- a/fsw +++ b/fsw @@ -1 +1 @@ -Subproject commit 3524d3912c5abc9131684adf51a2a2b595246a8d +Subproject commit c2de14e1860c88522490caa264003d0c9fd7bb52 diff --git a/simulith b/simulith index 339cd2c..bc30834 160000 --- a/simulith +++ b/simulith @@ -1 +1 @@ -Subproject commit 339cd2c6f23697a9ca710232f4fdd34f30eda410 +Subproject commit bc30834f415cb455cf29f4a3cf65e2c72fd6a795 From 5de262838ac8b1faa77afb00e5259edaad4a6b76 Mon Sep 17 00:00:00 2001 From: "Lucas, John P." Date: Mon, 15 Sep 2025 20:31:54 -0400 Subject: [PATCH 2/6] [tryspaceorg/tryspace-lab#51] Separate flags for unit tests; --- comp/CompFlags.cmake | 98 +++++++++++++++++++++++--------------------- 1 file changed, 52 insertions(+), 46 deletions(-) diff --git a/comp/CompFlags.cmake b/comp/CompFlags.cmake index 77e4934..24bf5de 100644 --- a/comp/CompFlags.cmake +++ b/comp/CompFlags.cmake @@ -1,56 +1,62 @@ # TrySpace-Lab Component Settings include(CheckCCompilerFlag) -set(TRYSPACE_C_FLAGS - # --- Diagnostics and coverage --- - "-fdiagnostics-show-option" # Show warning/diagnostic option in output - "-fprofile-arcs" # Code coverage (gcov) - "-ftest-coverage" # Code coverage (gcov) +# Allow callers to skip applying these component flags by setting +# the CMake variable TRYSPACE_SKIP_COMP_FLAGS to TRUE. +if(ENABLE_UNIT_TESTS) + set(TRYSPACE_C_FLAGS + # --- Diagnostics and coverage --- + "-fdiagnostics-show-option" # Show warning/diagnostic option in output + "-fprofile-arcs" # Code coverage (gcov) + "-ftest-coverage" # Code coverage (gcov) + ) +else() + set(TRYSPACE_C_FLAGS + # --- Core warnings and strictness --- + "-Wall" # Enable all common warnings + "-Werror" # Treat warnings as errors + "-Wextra" # Enable extra warnings + "-Wpedantic" # Enforce standard compliance + "-Wformat=2" # Strict format string checking + "-Wconversion" # Warn on implicit type conversions + "-Wsign-conversion" # Warn on sign conversions + "-Wshadow" # Warn about variable shadowing + "-Wpointer-arith" # Warn about pointer arithmetic on void* and function pointers + "-Wcast-align" # Warn about cast alignment issues + "-Wstrict-prototypes" # Warn about missing function prototypes + "-Wmissing-prototypes" # Warn about missing prototypes in files + "-Wmissing-declarations" # Warn about missing declarations + "-Wredundant-decls" # Warn about redundant declarations + "-Wwrite-strings" # Make string literals const char* + "-Wuninitialized" # Warn about uninitialized variables + "-Winit-self" # Warn about variables initialized with themselves + "-Wswitch-default" # Warn if switch statement does not have a default case + "-Wswitch-enum" # Warn if switch on enum does not handle all values + "-Wfloat-equal" # Warn about comparing floating point values for equality + "-Wundef" # Warn if undefined macros are used + "-Wbad-function-cast" # Warn about bad function casts - # --- Core warnings and strictness --- - "-Wall" # Enable all common warnings - "-Werror" # Treat warnings as errors - "-Wextra" # Enable extra warnings - "-Wpedantic" # Enforce standard compliance - "-Wformat=2" # Strict format string checking - "-Wconversion" # Warn on implicit type conversions - "-Wsign-conversion" # Warn on sign conversions - "-Wshadow" # Warn about variable shadowing - "-Wpointer-arith" # Warn about pointer arithmetic on void* and function pointers - "-Wcast-align" # Warn about cast alignment issues - "-Wstrict-prototypes" # Warn about missing function prototypes - "-Wmissing-prototypes" # Warn about missing prototypes in files - "-Wmissing-declarations" # Warn about missing declarations - "-Wredundant-decls" # Warn about redundant declarations - "-Wwrite-strings" # Make string literals const char* - "-Wuninitialized" # Warn about uninitialized variables - "-Winit-self" # Warn about variables initialized with themselves - "-Wswitch-default" # Warn if switch statement does not have a default case - "-Wswitch-enum" # Warn if switch on enum does not handle all values - "-Wfloat-equal" # Warn about comparing floating point values for equality - "-Wundef" # Warn if undefined macros are used - "-Wbad-function-cast" # Warn about bad function casts + # --- Suppressions and compatibility --- + "-Wno-discarded-qualifiers" # Suppress warnings about discarded qualifiers + "-Wno-packed" # Suppress warnings about packed attribute + "-Wno-unused-parameter" # Suppress warnings about unused parameters - # --- Suppressions and compatibility --- - "-Wno-discarded-qualifiers" # Suppress warnings about discarded qualifiers - "-Wno-packed" # Suppress warnings about packed attribute - "-Wno-unused-parameter" # Suppress warnings about unused parameters + # --- Overflow and macros --- + "-Wstrict-overflow" # Warn about code that may have strict overflow issues + "-Wstrict-overflow=5" # Maximum strict overflow warnings + "-Wvariadic-macros" # Warn about variadic macros + "-Wvla" # Warn about use of variable length arrays - # --- Overflow and macros --- - "-Wstrict-overflow" # Warn about code that may have strict overflow issues - "-Wstrict-overflow=5" # Maximum strict overflow warnings - "-Wvariadic-macros" # Warn about variadic macros - "-Wvla" # Warn about use of variable length arrays + # --- Standard enforcement --- + "-pedantic-errors" # Make all pedantic warnings into errors - # --- Standard enforcement --- - "-pedantic-errors" # Make all pedantic warnings into errors - - # --- Optimization and safety --- - "-O2" # Optimize for speed (use -O3 for max, -Og for debug) - "-std=c99" # Enforce C99 standard (or use -std=c11) - "-D_FORTIFY_SOURCE=2" # Enable buffer overflow protection (if supported) - "-fstack-protector-strong" # Enable stack protection -) + # --- Optimization and safety --- + "-O2" # Optimize for speed (use -O3 for max, -Og for debug) + "-std=c99" # Enforce C99 standard (or use -std=c11) + "-D_FORTIFY_SOURCE=2" # Enable buffer overflow protection (if supported) + "-fstack-protector-strong" # Enable stack protection + ) +endif() # Example: Add target-specific flags # if(${TGTNAME} STREQUAL cpu1) From 3b1ae4b771115b6ee27d996702c917cd8a36acc2 Mon Sep 17 00:00:00 2001 From: "Lucas, John P." Date: Tue, 16 Sep 2025 09:15:10 -0400 Subject: [PATCH 3/6] [tryspaceorg/tryspace-lab#51] CLI updates for strict flags; --- comp/CompFlags.cmake | 1 - comp/adcs | 2 +- comp/demo | 2 +- comp/eps | 2 +- comp/radio | 2 +- fsw | 2 +- 6 files changed, 5 insertions(+), 6 deletions(-) diff --git a/comp/CompFlags.cmake b/comp/CompFlags.cmake index 24bf5de..dec82ad 100644 --- a/comp/CompFlags.cmake +++ b/comp/CompFlags.cmake @@ -33,7 +33,6 @@ else() "-Wswitch-default" # Warn if switch statement does not have a default case "-Wswitch-enum" # Warn if switch on enum does not handle all values "-Wfloat-equal" # Warn about comparing floating point values for equality - "-Wundef" # Warn if undefined macros are used "-Wbad-function-cast" # Warn about bad function casts # --- Suppressions and compatibility --- diff --git a/comp/adcs b/comp/adcs index 24867d3..da62673 160000 --- a/comp/adcs +++ b/comp/adcs @@ -1 +1 @@ -Subproject commit 24867d334316d463738dccfe99ce371998a59294 +Subproject commit da62673f93d09e459948a0a51ce5ea595055805d diff --git a/comp/demo b/comp/demo index db65a55..7e8a981 160000 --- a/comp/demo +++ b/comp/demo @@ -1 +1 @@ -Subproject commit db65a5503b90dc8492ae04e73a19a416f6a44377 +Subproject commit 7e8a9818a1a0c707bb13430d3bd981eb220a76a1 diff --git a/comp/eps b/comp/eps index eebcfec..d7287e6 160000 --- a/comp/eps +++ b/comp/eps @@ -1 +1 @@ -Subproject commit eebcfecf75d0718b4d90a40ea8dbc503e3143fb8 +Subproject commit d7287e6d0817ed22eeeb9b7b6fcbc6c32260c132 diff --git a/comp/radio b/comp/radio index bac8a8a..3a94165 160000 --- a/comp/radio +++ b/comp/radio @@ -1 +1 @@ -Subproject commit bac8a8af7352399272626f7a0d3569183b45dd23 +Subproject commit 3a94165bc3cac3a05ad64431a8582c95f70b8bef diff --git a/fsw b/fsw index c2de14e..259acf1 160000 --- a/fsw +++ b/fsw @@ -1 +1 @@ -Subproject commit c2de14e1860c88522490caa264003d0c9fd7bb52 +Subproject commit 259acf1a718a2292694d845666d144cf5c0e1bf1 From 7778ff17b9f8043c43705529886b54fd00bf4001 Mon Sep 17 00:00:00 2001 From: "Lucas, John P." Date: Tue, 16 Sep 2025 09:15:37 -0400 Subject: [PATCH 4/6] [tryspaceorg/tryspace-lab#54] CLI CI; --- .github/workflows/ci.yml | 17 +++++++++++++++++ Makefile | 14 ++++++++------ 2 files changed, 25 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3e7e9e8..da525a5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -71,3 +71,20 @@ jobs: with: verbose: true recurse_submodules: true + + build-cli: + runs-on: ubuntu-latest + container: + image: tryspaceorg/tryspace-lab:0.0.1 + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + submodules: recursive + fetch-depth: 1 + - name: Build CLI + run: | + cd cfg + python3 tryspace-orchestrator.py + cd .. + make cli diff --git a/Makefile b/Makefile index c93363a..4dbd933 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ # Makefile for TrySpace Lab development -.PHONY: build clean clean-cache clean-cli clean-fsw clean-gsw clean-sim cfg cli container debug fsw gsw help mold sim start stop uninstall +.PHONY: build clean clean-cache clean-cli clean-fsw clean-gsw clean-sim cfg cli cli-start container debug fsw gsw help mold sim start stop uninstall # Build image name export BUILD_IMAGE ?= tryspaceorg/tryspace-lab:0.0.1 @@ -56,12 +56,13 @@ clean-sim: cli: cfg $(MAKE) container - $(MAKE) sim @for dir in $(CURDIR)/comp/*/cli ; do \ if [ -f "$$dir/Makefile" ]; then \ $(MAKE) -C "$$dir" runtime; \ fi; \ done + +cli-start: cfg docker compose -f ./cfg/cli-compose.yaml up container: cfg/Dockerfile.base @@ -92,8 +93,9 @@ help: @echo "Targets:" @echo " build - Build the full runtime environment" @echo " cfg - Run orchestrator to configure environment" - @echo " cli - Build CLI and start CLI services" - @echo " clean - Remove build artifacts and stop services" + @echo " cli - Build CLI components" + @echo " cli-start - Start CLI compose" + @echo " clean - Remove build artifacts and stop compose" @echo " clean-cache - Clean Docker build cache (frees significant disk space)" @echo " clean-cli - Clean CLI components" @echo " clean-fsw - Clean FSW components" @@ -105,8 +107,8 @@ help: @echo " gsw - Build GSW" @echo " mold - Create new component from demo template (Usage: make mold COMP=)" @echo " sim - Build Simulith and component simulators" - @echo " start - Start lab services" - @echo " stop - Stop lab and CLI services, clean up Docker images" + @echo " start - Start lab compose" + @echo " stop - Stop lab and CLI compose, clean up Docker images" @echo " uninstall - Remove containers, images, volumes, and networks" sim: cfg From 431cf36dc023f9f8c7c98844c4c744e35d33b148 Mon Sep 17 00:00:00 2001 From: "Lucas, John P." Date: Tue, 16 Sep 2025 09:40:30 -0400 Subject: [PATCH 5/6] [tryspaceorg/tryspace-lab#54] build-cli updated to avoid docker calls; --- .github/workflows/ci.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index da525a5..8531bc6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -87,4 +87,9 @@ jobs: cd cfg python3 tryspace-orchestrator.py cd .. - make cli + for dir in $(pwd)/comp/*/cli ; do + if [ -f "$dir/Makefile" ]; then + echo "Building CLI component in $dir" + make -C "$dir" build-cli || { echo "Failed building $dir"; exit 1; } + fi + done From 7633d7883fbbfa1ac8baf339f32948be36746b81 Mon Sep 17 00:00:00 2001 From: "Lucas, John P." Date: Tue, 16 Sep 2025 10:08:36 -0400 Subject: [PATCH 6/6] [tryspaceorg/tryspace-lab#51] Submodule updates after merges; --- comp/adcs | 2 +- comp/demo | 2 +- comp/eps | 2 +- comp/radio | 2 +- fsw | 2 +- simulith | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/comp/adcs b/comp/adcs index da62673..0ac5fa4 160000 --- a/comp/adcs +++ b/comp/adcs @@ -1 +1 @@ -Subproject commit da62673f93d09e459948a0a51ce5ea595055805d +Subproject commit 0ac5fa4267aa0ca548dbdf714c165ee6374dc998 diff --git a/comp/demo b/comp/demo index 7e8a981..cbd8ac0 160000 --- a/comp/demo +++ b/comp/demo @@ -1 +1 @@ -Subproject commit 7e8a9818a1a0c707bb13430d3bd981eb220a76a1 +Subproject commit cbd8ac09d266d6862c14fae2a5516ded496fd4b5 diff --git a/comp/eps b/comp/eps index d7287e6..809b1ba 160000 --- a/comp/eps +++ b/comp/eps @@ -1 +1 @@ -Subproject commit d7287e6d0817ed22eeeb9b7b6fcbc6c32260c132 +Subproject commit 809b1ba9cae506dcd36eba7bad1ddface65beb64 diff --git a/comp/radio b/comp/radio index 3a94165..444d44b 160000 --- a/comp/radio +++ b/comp/radio @@ -1 +1 @@ -Subproject commit 3a94165bc3cac3a05ad64431a8582c95f70b8bef +Subproject commit 444d44bd71a0c41d21473baeb31f683fa1685672 diff --git a/fsw b/fsw index 259acf1..0c2aeca 160000 --- a/fsw +++ b/fsw @@ -1 +1 @@ -Subproject commit 259acf1a718a2292694d845666d144cf5c0e1bf1 +Subproject commit 0c2aecae6b50ea65a7c94f594f607e62108ae0a9 diff --git a/simulith b/simulith index bc30834..0d0115f 160000 --- a/simulith +++ b/simulith @@ -1 +1 @@ -Subproject commit bc30834f415cb455cf29f4a3cf65e2c72fd6a795 +Subproject commit 0d0115f17e2a35ea33c03ca70c3ff15cc6f3140a