xen-troops / moulin

Moulin is meta build system that is capable of building multiple images at once
Apache License 2.0
2 stars 15 forks source link

Component layers can't be combined with variable #78

Closed al1img closed 11 months ago

al1img commented 1 year ago

For example, we can do the following with conf:

common_data:
      common_conf: &COMMON_CONF
            - [CONF1, "${CONF1}"]
            - [CONF2, "${CONF2}"]

components:
    comp0:
         builder:
             conf:
                 - *COMMON_CONF
                 - [CONF3, "${CONF3}"]
...

But we can't do the same with layers:

common_data:
      common_layers: &COMMON_LAYERS
            - "layer1"
            - "layer2"

components:
    comp0:
         builder:
             layers:
                 - *COMMON_LAYERS
                 - "layer3"
                 - "layer4"
...

due to the following error:

Traceback (most recent call last):
  File "/home/oleksandr_grytsov/.local/bin/moulin", line 8, in <module>
    sys.exit(moulin_entry())
  File "/home/oleksandr_grytsov/.local/lib/python3.10/site-packages/moulin/main.py", line 137, in moulin_entry
    build_generator.generate_build(conf, args.conf)
  File "/home/oleksandr_grytsov/.local/lib/python3.10/site-packages/moulin/build_generator.py", line 68, in generate_build
    build_stamps = builder.gen_build()
  File "/home/oleksandr_grytsov/.local/lib/python3.10/site-packages/moulin/builders/yocto.py", line 157, in gen_build
    layers = " ".join([x.as_str for x in layers_node])
  File "/home/oleksandr_grytsov/.local/lib/python3.10/site-packages/moulin/builders/yocto.py", line 157, in <listcomp>
    layers = " ".join([x.as_str for x in layers_node])
  File "/home/oleksandr_grytsov/.local/lib/python3.10/site-packages/moulin/yaml_wrapper.py", line 84, in as_str
    raise YAMLProcessingError(f"Expected string value, got {type(self._val)}", self.mark)
moulin.yaml_helpers.YAMLProcessingError: Expected string value, got <class 'NoneType'>   in "aos-vm.yaml", line 93, column 16
ninja: error: rebuilding 'build.ninja': subcommand failed
lorc commented 1 year ago

moulin uses % for variable expansion, not $.

lorc commented 1 year ago

Ah, sorry. * syntax does nothing with variables. This is internal YAML feature named "aliases". And yes, moulin supports it only in certain predefined places. I'll take a look on what can be done there.

lorc commented 11 months ago

Should be fixed with #87