Skip to content

Revert "yocto: exclude generated work dir from layer deps" + documentation update - #160

Merged
lorc merged 2 commits into
xen-troops:mainfrom
svlad-90:vladyslav-goncharuk/revert-yocto-layer-builddir-deps
Jul 20, 2026
Merged

Revert "yocto: exclude generated work dir from layer deps" + documentation update#160
lorc merged 2 commits into
xen-troops:mainfrom
svlad-90:vladyslav-goncharuk/revert-yocto-layer-builddir-deps

Conversation

@svlad-90

@svlad-90 svlad-90 commented Jul 19, 2026

Copy link
Copy Markdown

Revert "yocto: exclude generated work dir from layer deps"
This reverts commit 7735689.

The layout handled by that change is not a supported product layout.
Moulin expects the Yocto build directory to live outside managed layer
directories. If a configured layer contains work_dir, generated BitBake
output can be tracked as layer source dependencies. Products should avoid
that layout instead of relying on Moulin to prune generated files while
walking a layer directory.

Drop the work_dir pruning logic and the tests that documented the
unsupported nested-build-dir behavior.


yocto: reject unsupported layer work_dir layouts
Yocto layer dependency tracking records files under the directories
listed in the builder's layers option. A product layout where one of
those listed layer directories also contains the Yocto work_dir makes
generated BitBake output, such as tmp, cache, or buildhistory files,
look like layer source dependencies.

Raise YAMLProcessingError when the configured work_dir resolves inside
a managed layer path. Resolve symlinks before comparing paths, so
layouts that reach the same physical directory through a layer symlink
are rejected before build.ninja is written.

Keep layer dependency scanning from traversing symlinked directories
explicitly. This preserves source dependency tracking for files
physically under the layer while avoiding generated work_dir contents
reached through a layer symlink.

Document both the guard and its limits. Moulin can reject the
configured nested work_dir layout, but it does not try to detect every
way generated output can be copied, redirected, or otherwise written
into a layer directory.

@svlad-90 svlad-90 changed the title Vladyslav goncharuk/revert yocto layer builddir deps Revert "yocto: exclude generated work dir from layer deps" + documentation update Jul 19, 2026

@lorc lorc left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed-by: Volodymyr Babchuk <volodymyr_babchuk@epam.com>

@andr2000

Copy link
Copy Markdown

If this is not supported, so can we raise an exception if we hit this limitation?

@svlad-90
svlad-90 force-pushed the vladyslav-goncharuk/revert-yocto-layer-builddir-deps branch from 5aa3f5e to ed277d0 Compare July 20, 2026 08:59
@svlad-90

svlad-90 commented Jul 20, 2026

Copy link
Copy Markdown
Author

Hi @andr2000,

I agree with your point. Waiting for 2 hours to understand that your layout is unsupported during deps file processing is also unacceptable.

I've added an early guard for the exact unsupported layout where the configured Yocto work_dir is located under one of the configured layer paths. That is straightforward and does not require restoring the pruning logic.

However, this would only catch the structural case Moulin can infer from its configuration. Nothing more than that. It would not reliably detect every way generated files can end up under a layer: BitBake variables may redirect output directories elsewhere, other build systems ( Zephyr's west call :) ) may write to the layer tree if configured to do so, users may copy generated files manually, and symlinks can cause physical paths to differ from configured paths.

@lorc, updated implementation checked on @andr2000's scenario. It still follows your directive not to make endless workarounds. Please take a look once again.

@svlad-90
svlad-90 force-pushed the vladyslav-goncharuk/revert-yocto-layer-builddir-deps branch from ed277d0 to 8e72a04 Compare July 20, 2026 09:34

@lorc lorc left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed-by: Volodymyr Babchuk <volodymyr_babchuk@epam.com>

Vladyslav Goncharuk added 2 commits July 20, 2026 15:44
This reverts commit 7735689.

The layout handled by that change is not a supported product layout.
Moulin expects the Yocto build directory to live outside managed layer
directories. If a configured layer contains work_dir, generated BitBake
output can be tracked as layer source dependencies. Products should
avoid that layout instead of relying on Moulin to prune generated files
while walking a layer directory.

Drop the work_dir pruning logic and the tests that documented the
unsupported nested-build-dir behavior.

Signed-off-by: Vladyslav Goncharuk <vladyslav_goncharuk@epam.com>
Reviewed-by: Volodymyr Babchuk <volodymyr_babchuk@epam.com>
Yocto layer dependency tracking records files under the directories
listed in the builder's layers option. A product layout where one of
those listed layer directories also contains the Yocto work_dir makes
generated BitBake output, such as tmp, cache, or buildhistory files,
look like layer source dependencies.

Raise YAMLProcessingError when the configured work_dir resolves inside
a managed layer path. Resolve symlinks before comparing paths, so
layouts that reach the same physical directory through a layer symlink
are rejected before build.ninja is written.

Keep layer dependency scanning from traversing symlinked directories
explicitly. This preserves source dependency tracking for files
physically under the layer while avoiding generated work_dir contents
reached through a layer symlink.

Document both the guard and its limits. Moulin can reject the
configured nested work_dir layout, but it does not try to detect every
way generated output can be copied, redirected, or otherwise written
into a layer directory.

Signed-off-by: Vladyslav Goncharuk <vladyslav_goncharuk@epam.com>
Reviewed-by: Volodymyr Babchuk <volodymyr_babchuk@epam.com>
@svlad-90
svlad-90 force-pushed the vladyslav-goncharuk/revert-yocto-layer-builddir-deps branch from 8e72a04 to 3d270b3 Compare July 20, 2026 12:46
@lorc
lorc merged commit c9a8251 into xen-troops:main Jul 20, 2026
1 check passed
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

Successfully merging this pull request may close these issues.

3 participants