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

Use dynamic dependecies for the `unpack` fetcher #95

Closed rshym closed 7 months ago

rshym commented 8 months ago

Steps to reproduce

wget https://raw.githubusercontent.com/xen-troops/meta-xt-prod-devel-rcar/master/prod-devel-rcar.yaml
moulin ./prod-devel-rcar.yaml --ENABLE_ANDROID yes --ANDROID_PREBUILT_DDK yes

Error message appears:

moulin.yaml_helpers.YAMLProcessingError: File "rcar-prebuilts-graphics-xt-doma.tar.gz" does not exist   in "./prod-devel-rcar.yaml", line 742, column 23

Let's create dummy package with two dummy files:

tar -cjf rcar-prebuilts-graphics-xt-doma.tar.gz x1.txt x2.txt

And now moulin successfully creates the build.ninja.

Reason

This archive is required during the creation of the build.ninja to create the following rules:

build android/eva/x1.txt android/eva/x2.txt: tar_unpack rcar-prebuilts-graphics-xt-doma.tar.gz
  out_dir = android/eva
build fetch-doma: phony $
    /mnt/t1/builds/yd3test/.stamps/android--https---github.com-xen--troops-android_manifest.git--sync $
    android/eva/x1.txt android/eva/x2.txt

Proposed solution

To use dynamic dependencies, as shown in example https://ninja-build.org/manual.html#_tarball_extraction

svlad-90 commented 8 months ago

It was with @rshym that target issue appears with the following moulin yaml configuration file: https://github.com/xen-troops/meta-xt-prod-devel-rcar/pull/116/commits/b241827d956c9c7e13a12b2bad27e22c66a3228e

  GRAPHICS:
    desc: "Select how to use the GFX (3D hardware accelerator)"
    "binaries":
      overrides:
        variables:
          # for the linux
          # Directory containing ${SOC_NAME}_linux_gsx_binaries_gles.tar.gz
          XT_PREBUILT_GSX_DIR: "${TOPDIR}/../../../prebuilt_gsx"
          # for the android
          XT_DOMA_DDK_KM_PREBUILT_MODULE: "eva/pvr-km/pvrsrvkm.ko"
          XT_DOMA_KERNEL_EXTRA_MODULES: ""
          XT_DOMA_SOURCE_GROUP: "default"
        components:
          domd:
            builder:
              conf:
                - *GFX_CONF
                - [XT_PREBUILT_GSX_DIR, "%{XT_PREBUILT_GSX_DIR}"]
              layers:
                - "../meta-xt-rcar/meta-xt-rcar-gles_common"
          domu:
            builder:
              conf:
                - *GFX_CONF
                - [XT_PREBUILT_GSX_DIR, "%{XT_PREBUILT_GSX_DIR}"]
              layers:
                - "../meta-xt-rcar/meta-xt-rcar-gles_common"
          doma:
            sources:
              - type: unpack
                file: rcar-prebuilts-graphics-xt-doma.tar.gz
                dir: eva
                archive_type: tar
            builder:
              env:
                - "DDK_UM_PREBUILDS=eva/pvr-um"

The issue is that when the "GRAPHICS" parameter is set to the "binaries" value, there is some configuration applied for both domu and doma. In this case, it is not possible to build a product with the "domu" component, in case there is a missing archive for the "doma" component. component.

lorc commented 8 months ago

Ah, got this. Thank you. Yeah, removing check from the moulin code itself should help with the issue.

lorc commented 7 months ago

Should be fixed with #97

@rshym could you please confirm that provided fix covers your use case?

rshym commented 7 months ago

Thanks. I have reinstalled the moulin with the latest changes and it works as expected.