OpenCyphal / nunavut

Generate code from DSDL using PyDSDL and Jinja2
https://nunavut.readthedocs.io/
Other
39 stars 24 forks source link

Options not respected in config yaml but are respected as command line args #329

Closed skeetsaz closed 5 months ago

skeetsaz commented 9 months ago

Looks like there's a bug where if you specify some options in a config yaml they will not be respected but the same options specified as command line args are.

Given config.yaml

nunavut.lang.cpp:
  options:
    enable_serialization_asserts: true

This does not work:

nnvg -Xlang --language-standard=cetl++14-17 -l=cpp --configuration=config.yaml <dsdl_root>

But this does:

nnvg -Xlang --language-standard=cetl++14-17 -l=cpp --enable-serialization-asserts <dsdl_root>

It appears to go off the rails here and overwrite what was specified in the config yaml: https://github.com/OpenCyphal/nunavut/blob/main/src/nunavut/lang/__init__.py#L321

# Now update the configuration for the target language with everything we stored in this
# builder instance...
self.config.update_section(
    LanguageClassLoader.to_language_module_name(target_language_name), self._target_language_config
)
thirtytwobits commented 9 months ago

erp 😳