Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,3 +71,25 @@ 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 ..
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
14 changes: 8 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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"
Expand All @@ -105,8 +107,8 @@ help:
@echo " gsw - Build GSW"
@echo " mold - Create new component from demo template (Usage: make mold COMP=<name>)"
@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
Expand Down
80 changes: 55 additions & 25 deletions comp/CompFlags.cmake
Original file line number Diff line number Diff line change
@@ -1,31 +1,61 @@
# TrySpace-Lab Component Settings
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"
)
# 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
"-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
)
endif()

# Example: Add target-specific flags
# if(${TGTNAME} STREQUAL cpu1)
Expand Down
2 changes: 1 addition & 1 deletion comp/adcs
2 changes: 1 addition & 1 deletion comp/demo
2 changes: 1 addition & 1 deletion comp/eps
Submodule eps updated 3 files
+12 −6 cli/eps_cli.c
+8 −7 cli/eps_cli.h
+8 −5 sim/eps_sim.c
2 changes: 1 addition & 1 deletion comp/radio
2 changes: 1 addition & 1 deletion fsw
Submodule fsw updated 3 files
+1 −1 apps/hwlib
+1 −1 apps/io_lib
+1 −1 osal