Skip to content

ogma-core: mergeSpecs duplicates second spec's external variables instead of merging both #551

Description

@philphauler

Hey 👋

Was reading through the source and noticed a copy-paste slip in ogma-core/src/Command/Common.hs, line 101:

mergeSpecs s1 s2 = Spec
  { internalVariables = internalVariables s1 ++ internalVariables s2
  , externalVariables = externalVariables s2 ++ externalVariables s2  -- <- s2 twice
  , requirements      = requirements s1 ++ requirements s2
  }

externalVariables uses s2 ++ s2 instead of s1 ++ s2, so when combining multiple --input-file arguments via combineInputFiles, external variables from the first spec get silently dropped.

This affects all four backends (cFS, F Prime, ROS, standalone) since they all go through combineInputFiles.

One-character fix: s2s1.

Also spotted a small typo nearby in Standalone.hs:256"canbot" should be "cannot".

Happy to open a PR with both fixes 🙏

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions