Skip to content
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

Create github workflow for the subtopology autocoder #2794

Open
wants to merge 6 commits into
base: devel
Choose a base branch
from
Open
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
11 changes: 11 additions & 0 deletions .github/actions/spelling/expect.txt
Original file line number Diff line number Diff line change
Expand Up @@ -421,6 +421,7 @@
google
googletest
Gorang
gpg
GPGGA
GPINT
gpio
Expand Down Expand Up @@ -536,6 +537,7 @@
jsonable
kermit
kevin
keyring
kislyuk
kitware
Kooi
Expand Down Expand Up @@ -905,6 +907,7 @@
SBF
SBINDIR
sbt
scalasbt
Scatterometer
schem
schematron
Expand Down Expand Up @@ -1007,6 +1010,10 @@
subpage
subseconds
subtargets
subtopology
subtopologies

Check warning on line 1014 in .github/actions/spelling/expect.txt

View workflow job for this annotation

GitHub Actions / Spell checking

`subtopologies` is ignored by check spelling because another more general variant is also in expect. (ignored-expect-variant)
Subtopology

Check warning on line 1015 in .github/actions/spelling/expect.txt

View workflow job for this annotation

GitHub Actions / Spell checking

`Subtopology` is ignored by check spelling because another more general variant is also in expect. (ignored-expect-variant)
Subtopologies

Check warning on line 1016 in .github/actions/spelling/expect.txt

View workflow job for this annotation

GitHub Actions / Spell checking

`Subtopologies` is ignored by check spelling because another more general variant is also in expect. (ignored-expect-variant)
suppr
suseconds
SVCLOGFILE
Expand Down Expand Up @@ -1202,4 +1209,8 @@
xsltproc
xxxx
yacgen
yqq
zmq

mosa
aei

Check warning on line 1216 in .github/actions/spelling/expect.txt

View workflow job for this annotation

GitHub Actions / Spell checking

No newline at eof. (no-newline-at-eof)
87 changes: 87 additions & 0 deletions .github/workflows/ext-build-subtopology-ac.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
# Runs the subtopology autocoder tool to test the subtopology tool (https://github.com/mosa11aei/fprime-subtopology-tool)

name: "Subtopology Autocoder Tool Test"

on:
push:
branches: [ devel, release/** ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ devel, release/** ]
paths-ignore:
- 'docs/**'
- '**.md'
- '.github/actions/spelling/**'
- '.github/ISSUE_TEMPLATE/**'

jobs:
get-branch:
name: "Get target branch"
uses: ./.github/workflows/reusable-get-pr-branch.yml
with:
target_repository: mosa11aei/fprime-rngLibrary

subtopology-test:
name: "Subtopology Test"
runs-on: ubuntu-latest
needs: get-branch
steps:
- name: "Checkout target repository"
uses: actions/checkout@v4
with:
submodules: false
repository: mosa11aei/fprime-rngLibrary
ref: ${{ needs.get-branch.outputs.target-branch }}
- name: "Overlay current F´ revision"
uses: actions/checkout@v4
with:
submodules: true
path: ./fprime
fetch-depth: 0
- uses: ./fprime/.github/actions/setup
with:
location: ./fprime
- name: "Verify CMake is installed"
run: |
sudo apt-get update
sudo apt-get install -y cmake
- name: "Get FPP"
uses: actions/checkout@v4
with:
submodules: false
repository: nasa/fpp
path: ./fpp
ref: main
- name: "[fpp] Install sbt"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Get rid of non native fpp install

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mosa11aei if it were me I would get rid of all the installs, since all those tools come pre-installed on the GitHub runners. This may prevent breakages in the future. Your call.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This specifically relates to something @LeStarch and I talked about today. See #2816 😉

run: |
sudo apt-get update
sudo apt-get install -y apt-transport-https curl gnupg -yqq
echo "deb https://repo.scala-sbt.org/scalasbt/debian all main" | sudo tee /etc/apt/sources.list.d/sbt.list
echo "deb https://repo.scala-sbt.org/scalasbt/debian /" | sudo tee /etc/apt/sources.list.d/sbt_old.list
curl -sL "https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x2EE0EA64E40A89B84B2DF73499E82A75642AC823" | sudo -H gpg --no-default-keyring --keyring gnupg-ring:/etc/apt/trusted.gpg.d/scalasbt-release.gpg --import
sudo chmod 644 /etc/apt/trusted.gpg.d/scalasbt-release.gpg
mosa11aei marked this conversation as resolved.
Show resolved Hide resolved
sudo apt-get update
sudo apt-get install -y sbt default-jre
- name: "Get location of fpp bin"
id: fpp-bin
run: |
echo "BIN_DIR=$(dirname $(which fpp-depend))" >> $GITHUB_OUTPUT
- name: "Install unreleased fpp"
run: |
chmod +x ./fpp/compiler/install
./fpp/compiler/install ${{ steps.fpp-bin.outputs.BIN_DIR}}
- name: "Checkout subtopology tool"
uses: actions/checkout@v4
with:
submodules: false
path: ./fprime-subtopology-tool
repository: mosa11aei/fprime-subtopology-tool
ref: main
- name: "Generate Subtopology Example Build Cache"
working-directory: ./MainDeployment
run: |
fprime-util generate -DFPRIME_SKIP_TOOLS_VERSION_CHECK=ON -DCMAKE_DEBUG_OUTPUT=ON
- name: "Build Example"
working-directory: ./MainDeployment
run: |
fprime-util build -v -j4
7 changes: 1 addition & 6 deletions FppTest/struct/PrimitiveStructTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -207,10 +207,5 @@ TEST_F(PrimitiveStructTest, ToString) {
<< "mF64 = " << std::fixed << testF64
<< " )";

// Truncate string output
char buf2Str[FW_SERIALIZABLE_TO_STRING_BUFFER_SIZE];
Fw::StringUtils::string_copy(buf2Str, buf2.str().c_str(),
FW_SERIALIZABLE_TO_STRING_BUFFER_SIZE);

ASSERT_STREQ(buf1.str().c_str(), buf2Str);
ASSERT_STREQ(buf1.str().c_str(), buf2.str().c_str());
}
12 changes: 3 additions & 9 deletions Fw/Buffer/Buffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -168,16 +168,10 @@ Fw::SerializeStatus Buffer::deserialize(Fw::SerializeBufferBase& buffer) {
return stat;
}

#if FW_SERIALIZABLE_TO_STRING || BUILD_UT
#if FW_SERIALIZABLE_TO_STRING
void Buffer::toString(Fw::StringBase& text) const {
static const char * formatString = "(data = %p, size = %u,context = %u)";
char outputString[FW_SERIALIZABLE_TO_STRING_BUFFER_SIZE];

(void)snprintf(outputString, FW_SERIALIZABLE_TO_STRING_BUFFER_SIZE, formatString, this->m_bufferData, this->m_size,
this->m_context);
// Force NULL termination
outputString[FW_SERIALIZABLE_TO_STRING_BUFFER_SIZE-1] = 0;
text = outputString;
static const char * formatString = "(data = %p, size = %u, context = %u)";
text.format(formatString, this->m_bufferData, this->m_size, this->m_context);
}
#endif

Expand Down
8 changes: 7 additions & 1 deletion Fw/Cfg/ConfigCheck.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,15 @@ static_assert(FW_PARAM_STRING_MAX_SIZE <= FW_PARAM_BUFFER_MAX_SIZE,

// Text logging needs the code generator for serializables to generate a stringified version of the
// value.
static_assert((FW_ENABLE_TEXT_LOGGING == 0) || (FW_SERIALIZABLE_TO_STRING == 1),
static_assert((FW_ENABLE_TEXT_LOGGING == 0) || (FW_SERIALIZABLE_TO_STRING != 0),
"FW_SERIALIZABLE_TO_STRING must be enabled to enable FW_ENABLE_TEXT_LOGGING");

// Unit testing needs serializable strings
#ifdef BUILD_UT
static_assert(FW_SERIALIZABLE_TO_STRING != 0,
"FW_SERIALIZABLE_TO_STRING must be enabled for unit testing");
#endif

static_assert(std::numeric_limits<FwBuffSizeType>::max() == std::numeric_limits<FwSizeStoreType>::max() &&
std::numeric_limits<FwBuffSizeType>::min() == std::numeric_limits<FwSizeStoreType>::min(),
"FwBuffSizeType must be equivalent to FwExternalSizeType");
Expand Down
4 changes: 2 additions & 2 deletions Fw/SerializableFile/test/TestSerializable/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#
####
set(SOURCE_FILES
"${CMAKE_CURRENT_LIST_DIR}/TestSerializableAi.xml"
"${CMAKE_CURRENT_LIST_DIR}/TestSerializable.fpp"
)
set(MOD_DEPS
Fw/Cfg
Expand All @@ -25,4 +25,4 @@ set_target_properties(
${MODULE_NAME}
PROPERTIES
EXCLUDE_FROM_ALL TRUE
)
)
10 changes: 10 additions & 0 deletions Fw/SerializableFile/test/TestSerializable/TestSerializable.fpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
module Fw {

@ Test struct
struct Test {
element1: U32 @< Element 1
element2: I8 @< Element 2
element3: F64 @< Element 3
}

}
31 changes: 0 additions & 31 deletions Fw/SerializableFile/test/TestSerializable/TestSerializableAi.xml

This file was deleted.

25 changes: 0 additions & 25 deletions config/FpConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -233,14 +233,6 @@ typedef FwIndexType FwQueueSizeType;
#endif
#endif

// When querying an object as to an object-specific description, this specifies the size of the buffer to store the
// description.
#if FW_OBJECT_TO_STRING
#ifndef FW_OBJ_TO_STRING_BUFFER_SIZE
#define FW_OBJ_TO_STRING_BUFFER_SIZE 255 //!< Size of string storing toString() text
#endif
#endif

#if FW_OBJECT_REGISTRATION
// For the simple object registry provided with the framework, this specifies how many objects the registry will store.
#ifndef FW_OBJ_SIMPLE_REG_ENTRIES
Expand Down Expand Up @@ -352,23 +344,6 @@ typedef FwIndexType FwQueueSizeType;
#define FW_SERIALIZABLE_TO_STRING 1 //!< Indicates if autocoded serializables have toString() methods
#endif

#if FW_SERIALIZABLE_TO_STRING
#ifndef FW_SERIALIZABLE_TO_STRING_BUFFER_SIZE
#define FW_SERIALIZABLE_TO_STRING_BUFFER_SIZE 255 //!< Size of string to store toString() string output
#endif
#endif

// Define if arrays have toString() method.
#ifndef FW_ARRAY_TO_STRING
#define FW_ARRAY_TO_STRING 1 //!< Indicates if autocoded arrays have toString() methods
#endif

#if FW_ARRAY_TO_STRING
#ifndef FW_ARRAY_TO_STRING_BUFFER_SIZE
#define FW_ARRAY_TO_STRING_BUFFER_SIZE 256 //!< Size of string to store toString() string output
#endif
#endif

// Some settings to enable AMPCS compatibility. This breaks regular ISF GUI compatibility
#ifndef FW_AMPCS_COMPATIBLE
#define FW_AMPCS_COMPATIBLE 0 //!< Whether or not JPL AMPCS ground system support is enabled.
Expand Down
24 changes: 12 additions & 12 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,18 @@ fprime-fpl-convert-xml==1.0.3
fprime-fpl-extract-xml==1.0.3
fprime-fpl-layout==1.0.3
fprime-fpl-write-pic==1.0.3
fprime-fpp-check==2.1.0a11
fprime-fpp-depend==2.1.0a11
fprime-fpp-filenames==2.1.0a11
fprime-fpp-format==2.1.0a11
fprime-fpp-from-xml==2.1.0a11
fprime-fpp-locate-defs==2.1.0a11
fprime-fpp-locate-uses==2.1.0a11
fprime-fpp-syntax==2.1.0a11
fprime-fpp-to-cpp==2.1.0a11
fprime-fpp-to-dict==2.1.0a11
fprime-fpp-to-json==2.1.0a11
fprime-fpp-to-xml==2.1.0a11
fprime-fpp-check==2.1.0a12
fprime-fpp-depend==2.1.0a12
fprime-fpp-filenames==2.1.0a12
fprime-fpp-format==2.1.0a12
fprime-fpp-from-xml==2.1.0a12
fprime-fpp-locate-defs==2.1.0a12
fprime-fpp-locate-uses==2.1.0a12
fprime-fpp-syntax==2.1.0a12
fprime-fpp-to-cpp==2.1.0a12
fprime-fpp-to-dict==2.1.0a12
fprime-fpp-to-json==2.1.0a12
fprime-fpp-to-xml==2.1.0a12
fprime-gds==3.4.3
fprime-tools==3.4.4
fprime-visual==1.0.2
Expand Down
Loading