Closed ivanperez-keera closed 6 months ago
Change Manager: Confirmed that the issue exists.
Technical Lead: Confirmed that the issue should be addressed.
Technical Lead: Issue scheduled for fixing in Ogma 1.3.
Fix assigned to: @ivanperez-keera.
Implementor: Solution implemented, review requested.
Change Manager: Verified that:
Solution is implemented:
FROM ubuntu:trusty
RUN apt-get update
RUN apt-get install --yes software-properties-common RUN add-apt-repository ppa:hvr/ghc RUN apt-get update
RUN apt-get install --yes ghc-8.6.5 cabal-install-2.4 RUN apt-get install --yes libz-dev
ENV PATH=/opt/ghc/8.6.5/bin:/opt/cabal/2.4/bin:$PWD/.cabal-sandbox/bin:$PATH
RUN cabal update RUN cabal v1-sandbox init RUN cabal v1-install alex happy RUN apt-get install --yes git
CMD git clone $REPO && \ cd $NAME && \ git checkout $COMMIT && \ cd .. && \ cabal v1-install $NAME/$PAT/ --enable-tests && \ cabal v1-install $NAME/$PAT/ --enable-tests --run-tests -j1
Command:
```sh
$ docker run -e "REPO=https://github.com/nasa/ogma" -e "NAME=ogma" -e PAT="ogma-" -e "COMMIT=7ce5a4058a1f0527d1051b84406446a15a0ba31d" -it ogma-test
--- Dockerfile-verify-127
FROM ubuntu:trusty
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update
RUN apt-get install --yes software-properties-common RUN add-apt-repository ppa:hvr/ghc RUN apt-get update
RUN apt-get install --yes ghc-8.6.5 cabal-install-2.4 RUN apt-get install --yes libz-dev
ENV PATH=/opt/ghc/8.6.5/bin:/opt/cabal/2.4/bin:$PWD/.cabal-sandbox/bin:$PATH
RUN cabal update RUN cabal v1-sandbox init RUN cabal v1-install alex happy RUN cabal v1-install copilot-3.19 RUN apt-get install --yes git
ADD reqs.json /tmp/reqs.json
CMD git clone $REPO && \ cd $NAME && \ git checkout $COMMIT && \ cd .. && \ cabal v1-install --force-reinstall $NAME/$PAT**/ && \ ogma fret-component-spec --fret-file-name /tmp/reqs.json --target-file-name monitor > CS.hs && \ cabal v1-exec -- runhaskell CS.hs && \ gcc -c monitor.c && \ echo "Success"
--- reqs.json { "test_componentSpec": { "Functions": [ ], "Internal_variables": [ ], "Other_variables": [ ], "Requirements": [ { "CoCoSpecCode": "true", "fretish": "unimportant", "name": "testCopilot-001", "ptLTL": "TRUE" } ] } }
Command:
```sh
$ docker run -e "REPO=https://github.com/nasa/ogma" -e "NAME=ogma" -e PAT="ogma-" -e "COMMIT=7ce5a4058a1f0527d1051b84406446a15a0ba31d" -it ogma-verify-127
Change Manager: Implementation ready to be merged.
Description
The Spec to Copilot translator is not sanitizing handler names. This causes the Copilot generated code not to compile if the property identifiers have a hyphen.
Type
Additional context
None.
Requester
Method to check presence of bug
Compiling a specification with a hyphen in a requirement name produces Copilot code that does not compile:
Expected result
The execution above should produce a Copilot specification that can be compiled and where
-
has been converted to an underscore.Desired result
The execution above should produce a Copilot specification that can be compiled and where
-
has been converted to an underscore.Proposed solution
Modify the Spec translator to sanitize handler names the same way that the ROS backend does.
Further notes
None.