[Buildroot] [BUG?] per-package not fully working with dependencies and rebuild

John Ernberg john.ernberg at actia.se
Fri Nov 10 14:12:47 UTC 2023


Hi Thomas, list,

We are using buildroot 2023.2 with per-package setup and we've run into
a scenario where rebuilds of a package do not propagate properly into
the $(TARGET_DIR) area of the final image.

We have custom closed source packages A and B, where B depends on A.

If we make changes in A that do not require a rebuild of B, we just
want to rebuild A and then build our image.

However, since the $(TARGET_DIR) of A is rsync:ed into Bs per-package
$(TARGET_DIR), the final image assembly ends up using whatever state of
A that was last true when B was last rebuilt, because of naming.

The $(TARGET_DIR) of A is rsync:ed into the final $(TARGET_DIR), and
then the $(TARGET_DIR) of B is rsync:ed into the final $(TARGET_DIR),
overwriting whatever A put there.

Looking at pkg-utils.mk prepare-per-package-directory, the call with
target is what is causing the issue.

Thinking of this from a packaging aspect, the per-package $(TARGET_DIR)
should only contain whatever the package itself is producing, as this
matches the behavior of every package-based Linux distro and it is our
impression of per-package that this is what it is meant to do.

Removing this call however breaks multiple packages with errors of
missing directories, which would need fixing. The most reliable fix is
probably to have a step in target install that touches the basic
directories before it runs any hooks and main CMDS.

Does all this sound like a sensible assessment?

Thanks! // John Ernberg


More information about the buildroot mailing list