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

moulin: make the 'args' parameter optional for the 'custom_script' builder #105

Closed Mishytca closed 6 months ago

Mishytca commented 6 months ago

I'm building one of the moulin components using the 'custom' builder:

'args'  parameter absent altogether:
  layers:
    builder:
      type: custom_script
      work_dir: "layers"
      script: "yocto/meta-aos/scripts/layer_builder.py"
      target_images:
        - "output/layers/nodejs-layer.tar"
        - "output/layers/pylibs-layer.tar"
        - "output/layers/libvis-layer.tar"

Here is a link to the entire YAML file of the product:

https://github.com/aoscloud/meta-aos-rcar-gen4/blob/main/aos-rcar-gen4.yaml#L279

As you can see above, no 'args' parameter is specified.

Last week, the build of my product was successful. But now I'm getting the following error while attempting to generate a build.ninja file:

Traceback (most recent call last):
  File "/home/builder/.local/bin/moulin", line 8, in <module>
    sys.exit(moulin_entry())
  File "/home/builder/.local/lib/python3.8/site-packages/moulin/main.py", line 137, in moulin_entry
    build_generator.generate_build(conf, args.conf)
  File "/home/builder/.local/lib/python3.8/site-packages/moulin/build_generator.py", line 70, in generate_build
    build_stamps = builder.gen_build()
  File "/home/builder/.local/lib/python3.8/site-packages/moulin/builders/custom_script.py", line 91, in gen_build
    if args_node.is_list:
AttributeError: '_YamlDefaultValue' object has no attribute 'is_list'

It seems that regression was added with the following PR:

https://github.com/xen-troops/moulin/pull/103

It does not consider the possible absence of the 'args_node' YAML node.

Please take a look at this issue.

lorc commented 6 months ago

@dsemenets, please take a look. Also we will need tests that cover all the cases with arg values and absence/presence.

dsemenets commented 6 months ago

Created PR https://github.com/xen-troops/moulin/pull/106

lorc commented 6 months ago

Should be fixed by combined efforts of #106 and #107

@Mishytca could you please verify that it really fixes your issue?

Mishytca commented 6 months ago

Hi @lorc , hi @dsemenets! The issue is solved. Thank you!