genodelabs / goa

Tool for streamlining the development of Genode applications
GNU Affero General Public License v3.0
19 stars 18 forks source link

Find content ROMs in all pkg dependencies #46

Closed nfeske closed 1 year ago

nfeske commented 1 year ago

When Sculpt deploys a pkg, it looks up the declaration of ROM content of the new subsystem in all pkg dependencies (see https://github.com/genodelabs/genode/issues/3981). Goa should do the same to avoid the duplication of <content> nodes when customizing an existing pkg.

E.g., when crafting a new runtime based on https://github.com/nfeske/goa-playground/tree/master/unix, e.g., to supplement only make.tar, one can create a new goa project as follows:

pkg/unix_with_make/archives:

nfeske/pkg/unix
nfeske/src/gnumake

pkg/unix_with_make/runtime:

<runtime ram="170M" caps="5000" binary="init" config="unix.config">
    <requires>
        ...
    </requires>
    <content>
        <rom label="make.tar"/>
    </content>
</runtime>

raw/vfs.config:

config ld_verbose="yes">
  <vfs>
    <tar name="make.tar" />
    ...
  </vfs>
  ...
</config>

Note that one does not need to supply a copy of unix.config because the ROM from the unix project can be used as is. Also the <content> does not need to list any content that is already declared in unix's runtime.

When trying this with the current version of Goa, Goa complains that the unix.config is missing. Since I have used Goa like that in the past (e.g., https://github.com/nfeske/goa-playground/tree/git/test/unix-git), I guess that the current behavior is a regression that was introduced with adding the sanity checks for the plausibility of the config.

jschlatow commented 1 year ago

@nfeske That regression is indeed caused by the added plausibility check. It can be solved by downloading the pkg dependencies and preparing the depot before calling into generate_runtime_config.

I pushed a fix in 816a710. Do you agree with this approach?

nfeske commented 1 year ago

Thanks @jschlatow for addressing this issue so quickly. Your approach looks sensible to me.