]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commit
classes/cargo_common: ensure B is clean
authorRoss Burton <ross.burton@arm.com>
Fri, 17 Oct 2025 13:27:17 +0000 (14:27 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Sun, 19 Oct 2025 14:35:06 +0000 (15:35 +0100)
commit1452ac7a44196454a52f3f6d883290ddcccfd3f8
tree57cac875cbac14f803278c5d7b65f8463d3e6f9d
parent3557f1c294531e7f8c34a2b0677e8c03f1b1be77
classes/cargo_common: ensure B is clean

The cargo class defaults to out-of-tree builds in WORKDIR/build, but
at no point was that directory cleaned.  This causes problems with the
rust standard library recipe (libstd-rs) which installs manually with cp,
so rebuilds can be contaminated with the contents of previous builds.

I believe that post-release we should switch cargo.bbclass to mandating
out-of-tree builds to reduce the complexity, but for now in out-of-tree
builds we can just delete the ${B}/target directory.

Note that we use ${B}/target because there at least were reasons to use
that name[1], it is unclear if these limitations still hold. We can't
simply clean ${B} because that will break recipes that use cargo and
something else to build, for example librsvg.

[1] https://github.com/rust-lang/cargo/pull/1657

Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes-recipe/cargo_common.bbclass