diff mbox series

[scarthgap,3/3] python_setuptools_build_meta: clean the build directory in configure

Message ID 20260602080940.1053865-3-martin.jansa@gmail.com
State New
Headers show
Series [scarthgap,1/3] setuptools3_legacy: ensure ${B} is clean | expand

Commit Message

Martin Jansa June 2, 2026, 8:09 a.m. UTC
From: Ross Burton <ross.burton@arm.com>

It's not currently possible to set the build tree to be somewhere we
control, but we know it will always be in the build directory alongside
the pyproject.toml so we can [cleandirs] that.

MJ: this was later reverted in a532cb50151d773c1c351ffccf4d47a37f26f8aa:
  This is not needed: setuptools.build_meta does the build under a new
  temporary directory.

but the builds in scarthgap aren't using new temporary directory yet,
so this is still useful there:

Just rebuilding python3-tqdm in the same TMPDIR after cherry-picking this:

$ buildhistory-diff -p buildhistory build-minus-1 | grep PKGSIZE
python3-tqdm/python3-tqdm: PKGSIZE changed from 3309408 to 426880 (-87%)

$ wc -l python3-tqdm/4.66.3*/image/usr/lib/python3.12/site-packages/tqdm-4.66.3.dist-info/RECORD
  297 python3-tqdm/4.66.3-old/image/usr/lib/python3.12/site-packages/tqdm-4.66.3.dist-info/RECORD
   41 python3-tqdm/4.66.3/image/usr/lib/python3.12/site-packages/tqdm-4.66.3.dist-info/RECORD

Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Martin Jansa <martin.jansa@gmail.com>
---
 meta/classes-recipe/python_setuptools_build_meta.bbclass | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Ernst Persson June 2, 2026, 8:55 a.m. UTC | #1
Tried the series out over here, LGTM! Checked that my buildhistory looks
good.

Den tis 2 juni 2026 kl 10:09 skrev Martin Jansa via lists.openembedded.org
<martin.jansa=gmail.com@lists.openembedded.org>:

> From: Ross Burton <ross.burton@arm.com>
>
> It's not currently possible to set the build tree to be somewhere we
> control, but we know it will always be in the build directory alongside
> the pyproject.toml so we can [cleandirs] that.
>
> MJ: this was later reverted in a532cb50151d773c1c351ffccf4d47a37f26f8aa:
>   This is not needed: setuptools.build_meta does the build under a new
>   temporary directory.
>
> but the builds in scarthgap aren't using new temporary directory yet,
> so this is still useful there:
>
> Just rebuilding python3-tqdm in the same TMPDIR after cherry-picking this:
>
> $ buildhistory-diff -p buildhistory build-minus-1 | grep PKGSIZE
> python3-tqdm/python3-tqdm: PKGSIZE changed from 3309408 to 426880 (-87%)
>
> $ wc -l
> python3-tqdm/4.66.3*/image/usr/lib/python3.12/site-packages/tqdm-4.66.3.dist-info/RECORD
>   297
> python3-tqdm/4.66.3-old/image/usr/lib/python3.12/site-packages/tqdm-4.66.3.dist-info/RECORD
>    41
> python3-tqdm/4.66.3/image/usr/lib/python3.12/site-packages/tqdm-4.66.3.dist-info/RECORD
>
> Signed-off-by: Ross Burton <ross.burton@arm.com>
> Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
> Signed-off-by: Martin Jansa <martin.jansa@gmail.com>
> ---
>  meta/classes-recipe/python_setuptools_build_meta.bbclass | 4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/meta/classes-recipe/python_setuptools_build_meta.bbclass
> b/meta/classes-recipe/python_setuptools_build_meta.bbclass
> index 4c84d1e8d0..046b4ffb74 100644
> --- a/meta/classes-recipe/python_setuptools_build_meta.bbclass
> +++ b/meta/classes-recipe/python_setuptools_build_meta.bbclass
> @@ -7,3 +7,7 @@
>  inherit setuptools3-base python_pep517
>
>  DEPENDS += "python3-setuptools-native python3-wheel-native"
> +
> +# This isn't nice, but is the best solutions to ensure clean builds for
> now.
> +# https://github.com/pypa/setuptools/issues/4732
> +do_configure[cleandirs] = "${PEP517_SOURCE_PATH}/build"
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#238016):
> https://lists.openembedded.org/g/openembedded-core/message/238016
> Mute This Topic: https://lists.openembedded.org/mt/119607862/4947266
> Group Owner: openembedded-core+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [
> ernstp@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
>
diff mbox series

Patch

diff --git a/meta/classes-recipe/python_setuptools_build_meta.bbclass b/meta/classes-recipe/python_setuptools_build_meta.bbclass
index 4c84d1e8d0..046b4ffb74 100644
--- a/meta/classes-recipe/python_setuptools_build_meta.bbclass
+++ b/meta/classes-recipe/python_setuptools_build_meta.bbclass
@@ -7,3 +7,7 @@ 
 inherit setuptools3-base python_pep517
 
 DEPENDS += "python3-setuptools-native python3-wheel-native"
+
+# This isn't nice, but is the best solutions to ensure clean builds for now.
+# https://github.com/pypa/setuptools/issues/4732
+do_configure[cleandirs] = "${PEP517_SOURCE_PATH}/build"