Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

phosphor-dbus-interfaces: dependency issue with do_write_config task #4012

Open
brobin49 opened this issue Aug 21, 2024 · 3 comments
Open

phosphor-dbus-interfaces: dependency issue with do_write_config task #4012

brobin49 opened this issue Aug 21, 2024 · 3 comments

Comments

@brobin49
Copy link

Problem
There is a dependency issue in phosphor-dbus-interfaces recipe concerning the 'do_write_config' task.

The 'do_write_config' task forces all of the YAML subdirectory options to 'false' using the list in the 'meson_options.txt'. For this function to run correctly, the 'meson_options.txt' file must be present.

The 'log.task_order' has not the correct order:

$ cat log.task_order
20240821-125617.318908 do_cleansstate (374): log.do_cleansstate.374
20240821-125618.931003 do_cleanall (377): log.do_cleanall.377
20240821-125634.409740 do_write_config (407): log.do_write_config.407
20240821-125634.420444 do_fetch (406): log.do_fetch.406
20240821-125635.522120 do_unpack (446): log.do_unpack.446
…

An error is present in the logs of the task 'do_write_config' because the file 'meson_options.txt' is not present:

$ cat log.do_write_config
…
DEBUG: Executing shell function do_write_config
grep: …/phosphor-dbus-interfaces/1.0+gitAUTOINC+c24b25bbd2-r1/git/meson_options.txt: No such file or directory
DEBUG: Shell function do_write_config finished

Explanation
The current dependency configuration uses 'deptask' to add a dependency on the 'do_unpack' task for 'do_write_config':

do_write_config[deptask] += "do_unpack"

However, 'deptask' is not the right flag.
Definition of the 'deptask' flag according to the 'docs.yocto project.org' documentation:
'The [deptask] varflag for tasks signifies the task of each item listed in DEPENDS that must complete before that task can be executed.'
In our case, we want to wait until the 'do_unpack' task of our recipe is finished and not the 'do_unpack' tasks of the 'DEPENDS'.
It would be better to use the 'depends' flag.

Also, it would be better to wait until the 'do_patch' task is finished to execute the 'do_write_config' task, because a patch can modify the 'meson_options.txt' file.

Proposed Solution
Use this dependency:

do_write_config[depends] += " ${PN}:do_patch"

The 'log.task_order' has the correct order:

$ cat log.task_order
20240821-143559.765896 do_cleansstate (372): log.do_cleansstate.372
20240821-143603.229501 do_cleanall (375): log.do_cleanall.375
20240821-143616.888221 do_fetch (369): log.do_fetch.369
20240821-143617.990937 do_unpack (398): log.do_unpack.398
20240821-143617.996632 do_prepare_recipe_sysroot (399): log.do_prepare_recipe_sysroot.399
20240821-143618.437463 do_patch (418): log.do_patch.418
20240821-143619.294399 do_deploy_source_date_epoch (566): log.do_deploy_source_date_epoch.566
20240821-143619.301452 do_write_config (567): log.do_write_config.567
…

No errors are present in the logs of the task 'do_write_config':

$ cat log.do_write_config
…
DEBUG: Executing shell function do_write_config
DEBUG: Shell function do_write_config finished

Additional context
Commit that introduces the dependency on the 'do_write_config' task: d5ed092

@williamspatrick
Copy link
Member

Proposed Solution

Sounds good. Are you able to contribute the fix via Gerrit?

@brobin49
Copy link
Author

After thinking about it, a better solution would be to make the changes of 'meson_options.txt' file in the 'do_configure' task. Because, the 'do_write_config' task is a task created by the meson class and is only used to create files for the meson build. In our case we want to modify a configuration file using a file from the sources, which corresponds to the 'do_configure' task. And this way we don't modify any task dependencies.

Proposed Solution

 # Remove all schemas by default regardless of the meson_options.txt config
-do_write_config:append() {
+do_configure:prepend() {
     for intf in $(grep "^option('data_" ${S}/meson_options.txt | sed "s,^.*\(data_[^']*\).*$,\1,"); do
         sed -i "/^\[built-in options\]\$/a$intf = false" ${WORKDIR}/meson.cross
     done
 }
-do_write_config[deptask] += "do_unpack"

@brobin49
Copy link
Author

Are you able to contribute the fix via Gerrit?

I have never contributed via Gerrit to OpenBMC before.
I have asked my company to sign the Contributor License Agreements but it may take some time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants