[1/6] flit_core: respect PIP_INSTALL_DIST_PATH

Message ID 20220308143035.3569559-1-ross.burton@arm.com
State Accepted, archived
Commit a3d9eb8051bc2effb8130b1743ba251c1fe7c525
Headers show
Series [1/6] flit_core: respect PIP_INSTALL_DIST_PATH | expand

Commit Message

Ross Burton March 8, 2022, 2:30 p.m. UTC
pip_install_wheel expects the wheels to be in PIP_INSTALL_DIST_PATH but
this class was writing to the same directory through chance not design.

Respect PIP_INSTALL_DIST_PATH as the output directory, and use
[cleandirs] to ensure that it exists and is empty.

Also call the flit_core.wheel module directly as this is a public entry
point to the wheel building logic.

Signed-off-by: Ross Burton <ross.burton@arm.com>
---
 meta/classes/flit_core.bbclass | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Patch

diff --git a/meta/classes/flit_core.bbclass b/meta/classes/flit_core.bbclass
index a7667795fe..3481bb5089 100644
--- a/meta/classes/flit_core.bbclass
+++ b/meta/classes/flit_core.bbclass
@@ -8,8 +8,8 @@  flit_core_do_configure () {
 
 # TODO: ideally this uses pypa/build
 flit_core_do_compile () {
-    mkdir -p ${S}/dist
-    nativepython3 -c "from flit_core import buildapi; buildapi.build_wheel('./dist')"
+    nativepython3 -mflit_core.wheel --outdir ${PIP_INSTALL_DIST_PATH}
 }
+do_compile[cleandirs] += "${PIP_INSTALL_DIST_PATH}"
 
 EXPORT_FUNCTIONS do_configure do_compile