Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop-remove-icarous' into develop. Close #237.
**Description** The cFS application template was originally built for ICAROUS, but it is now generic to cFS. ICAROUS is still mentioned in the template, and the resulting code will not compile unless ICAROUS is present as an app. **Type** - Bug: cFS template generates code that does not work in cFS, but requires a specific cFS application to be present. **Additional context** None. **Requester** - Ivan Perez. **Method to check presence of bug** Searching for ICAROUS in the template surfaces several occurrences: ```sh $ grep -niHre 'icarous' ogma-core/templates/ ogma-core/templates/copilot-cfs/fsw/src/copilot_cfs.h:44:void COPILOT_ProcessIcarousPosition(void); ogma-core/templates/copilot-cfs/fsw/src/copilot_cfs.c:19:#include "Icarous_msgids.h" ogma-core/templates/copilot-cfs/fsw/src/copilot_cfs.c:20:#include "Icarous_msg.h" ogma-core/templates/copilot-cfs/fsw/src/copilot_cfs.c:154:* Make ICAROUS data available to Copilot and run monitors. ogma-core/templates/copilot-cfs/CMakeLists.txt:5:include_directories(../Icarouslib/fsw/platform_inc) ``` **Expected result** Running the command above returns an empty output, showing that ICAROUS is not mentioned in the template. The following Dockerfile checks that generating a cFS application with and without the feature proposed renders the same result, provided that the additional data is given to the new cFS backend as an additional JSON file, after which it prints the message "Success". There's a slight difference that cannot be resolved via additional variables or flags, so that different is disregarded by replacing the text with `sed` first. It requires an additional `BASE_COMMIT` variable pointing to a commit prior to merging this feature. ``` FROM ubuntu:focal ENV DEBIAN_FRONTEND=noninteractive RUN apt-get update RUN apt-get install --yes \ curl g++ gcc git libgmp3-dev libz-dev make pkg-config RUN mkdir -p $HOME/.local/bin ENV PATH=$PATH:/root/.local/bin/ RUN curl https://downloads.haskell.org/~ghcup/0.1.17.7/x86_64-linux-ghcup-0.1.17.7 -o $HOME/.local/bin/ghcup RUN chmod a+x $HOME/.local/bin/ghcup ENV PATH=$PATH:/root/.ghcup/bin/ RUN ghcup install ghc 9.10 RUN ghcup install cabal 3.12 RUN ghcup set ghc 9.10.1 RUN cabal update ADD extra-vars /tmp/extra-vars SHELL ["/bin/bash", "-c"] CMD git clone $REPO \ && cd $NAME \ && git checkout $BASE_COMMIT \ && cabal install ogma-cli:ogma \ && ogma cfs --app-target-dir original --variable-file ogma-cli/examples/cfs-variables --variable-db ogma-cli/examples/cfs-variable-db --handlers-file ogma-cli/examples/cfs-handlers \ && git checkout $COMMIT \ && cabal install --overwrite-policy=always ogma-cli:ogma \ && ogma cfs --app-target-dir updated --variable-file ogma-cli/examples/cfs-variables --variable-db ogma-cli/examples/cfs-variable-db --handlers-file ogma-cli/examples/cfs-handlers --template-vars /tmp/extra-vars \ && sed -i -e 's/Make ICAROUS data/Make received data/g' original/fsw/src/copilot_cfs.c \ && diff -rq original updated \ && echo "Success" ``` Command (substitute variables based on new path after merge): ```sh $ docker run -e "REPO=https://github.com/NASA/ogma" -e "NAME=ogma" -e "BASE_COMMIT=7f2525969ac5572e4486c697b60405d439ec3cb5" -e "COMMIT=<HASH>" -it ogma-verify-237 ``` **Solution implemented** Modify `copilot_cfs.h` header to make use of existing template variables. Modify `copilot_cfs.c` to replace the specific includes with a new variable that is expanded in place. Modify `copilot_cfs.c` to remove ICAROUS from the comment documenting the message handler function. Modify `CMakeLists.txt` to replace the specific include of `Icarouslib` with an additional variable that is expanded in place. Document new variables in `ogma-cli`'s README. **Further notes** None.
- Loading branch information