Skip to content

ogma-core: F' template mentions undefined queueSize #186

@ivanperez-keera

Description

@ivanperez-keera

Description

The variable queueSize is no longer defined by default in the component generated by the fprime application. This makes components generated by Ogma not compile.

Type

  • Bug: Ogma generates code that no longer compiles with newer versions of F'.

Additional context

None.

Requester

  • Ivan Perez.

Method to check presence of bug

Run the fprime command with a simple monitor and variables:

--- fprime-handlers
handlerMyProperty

--- fprime-variable-dbs
("pullup", "bool")
("input", "float")

--- fprime-variables
variables

--- Monitor.hs
import           Copilot.Compile.C99
import           Copilot.Language      hiding (prop)
import qualified Copilot.Library.PTLTL as PTLTL
import           Language.Copilot      (reify)
import           Prelude               hiding (not, (/=))

input :: Stream Float
input = extern "input" Nothing

myProperty :: Stream Bool
myProperty = PTLTL.alwaysBeen (input /= 30.0)

spec :: Spec
spec = do
  trigger "handlerMyProperty" (not myProperty) []

main :: IO ()
main = reify spec >>= compile "copilot"

Commands

$ runhaskell Monitor.hs
$ ogma fprime --app-target-dir fprime_demo --variable-file fprime-variables --handlers-file fprime-handlers --variable-db fprime-variable-db
$ mv copilot* fprime_demo/
$ cd fprime_demo/
$ docker build -t copilot-fprime-test .
... omitted for brevity ...
[ 94%] Generating Ports_RateGroupsEnumAi.xml, Ports_StaticMemoryEnumAi.xml, RefTopologyAppAi.xml
[ 94%] Generating FppConstantsAc.cpp, FppConstantsAc.hpp, Ports_RateGroupsEnumAc.cpp, Ports_RateGroupsEnumAc.hpp, Ports_StaticMemoryEnumAc.cpp, Ports_StaticMemoryEnumAc.hpp, RefTopologyAc.cpp, RefTopologyAc.hpp
[ 94%] Generating RefTopologyDictionary.json
fpp-to-cpp
/fprime/Ref/Top/instances.fpp:136.24
    queue size Default.queueSize
                       ^
error: undefined symbol queueSize
make[3]: *** [Ref/Top/CMakeFiles/Ref_Top.dir/build.make:186: Ref/Top/FppConstantsAc.cpp] Error 1
make[3]: *** Waiting for unfinished jobs....
fpp-to-xml
/fprime/Ref/Top/instances.fpp:136.24
    queue size Default.queueSize
                       ^
error: undefined symbol queueSize
make[3]: *** [Ref/Top/CMakeFiles/Ref_Top.dir/build.make:119: Ref/Top/Ports_RateGroupsEnumAi.xml] Error 1
fpp-to-dict
/fprime/Ref/Top/instances.fpp:136.24
    queue size Default.queueSize
                       ^
error: undefined symbol queueSize
make[2]: *** [CMakeFiles/Makefile2:8004: Ref/Top/CMakeFiles/Ref_Top.dir/all] Error 2
make[1]: *** [CMakeFiles/Makefile2:2677: CMakeFiles/Ref.dir/rule] Error 2
make: *** [Makefile:190: Ref] Error 2
[ERROR] CMake erred with return code 2
The command '/bin/sh -c fprime-util build --jobs "$(nproc || printf '%s\n' 1)"' returned a non-zero code: 1

Expected result

The above command compiles without errors.

Desired result

The above command compiles without errors.

Proposed solution

Modify the fprime template to use the variable QUEUE_SIZE, instead of queueSize, since the former is known to work.

Further notes

None.

Metadata

Metadata

Labels

CR:Status:ClosedAdmin only: Change request that has been completedCR:Type:BugAdmin only: Change request pertaining to error detected

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions