Yocto Project Discussions
 help / color / mirror / Atom feed
From: Peter Hoyes <peter.hoyes@arm.com>
To: yocto@lists.yoctoproject.org
Cc: diego.sueiro@arm.com, Peter Hoyes <Peter.Hoyes@arm.com>
Subject: [meta-zephyr][PATCH 3/4] zephyr-core/classes: Remove West-based logic from zephyr.bbclass
Date: Fri, 16 Sep 2022 10:03:17 +0100	[thread overview]
Message-ID: <20220916090318.1293922-4-peter.hoyes@arm.com> (raw)
In-Reply-To: <20220916090318.1293922-1-peter.hoyes@arm.com>

From: Peter Hoyes <Peter.Hoyes@arm.com>

For a given release tag, ZEPHYR_MODULES is constant. It is therefore now
populated by the generate-version.py script, the output of which is
stored in the repository, so the build-time logic to populate
ZEPHYR_MODULES is no longer needed.

Remove the do_get_zmods task, but retain the Python dependencies which
are still required by Python scripts in the Zephyr repository that are
trigerred by CMake.

The above means that West is now only required as a host dependency to
run generate-version.py, so remove the West Yocto recipe.

Signed-off-by: Peter Hoyes <Peter.Hoyes@arm.com>
---
 meta-zephyr-core/classes/zephyr.bbclass       | 32 +------------------
 .../recipes-devtools/west/west_0.12.99.bb     | 22 -------------
 2 files changed, 1 insertion(+), 53 deletions(-)
 delete mode 100644 meta-zephyr-core/recipes-devtools/west/west_0.12.99.bb

diff --git a/meta-zephyr-core/classes/zephyr.bbclass b/meta-zephyr-core/classes/zephyr.bbclass
index 8030456..5b71bda 100644
--- a/meta-zephyr-core/classes/zephyr.bbclass
+++ b/meta-zephyr-core/classes/zephyr.bbclass
@@ -2,6 +2,7 @@ inherit terminal
 inherit python3native
 
 PYTHONPATH="${STAGING_DIR_HOST}${libdir}/${PYTHON_DIR}/site-packages"
+DEPENDS += "python3-pyelftools-native python3-pyyaml-native python3-pykwalify-native"
 
 OE_TERMINAL_EXPORTS += "HOST_EXTRACFLAGS HOSTLDFLAGS TERMINFO CROSS_CURSES_LIB CROSS_CURSES_INC"
 HOST_EXTRACFLAGS = "${BUILD_CFLAGS} ${BUILD_LDFLAGS}"
@@ -24,39 +25,8 @@ python () {
     d.setVar('BOARD',board)
 }
 
-do_get_zmods() {
-
-    export PYTHONPATH="${RECIPE_SYSROOT_NATIVE}/${libdir}/${PYTHON_DIR}/site-packages:${RECIPE_SYSROOT_NATIVE}/${libdir}/${PYTHON_DIR}"
-    cd ${S}
-    
-    # I really dislike how tied in this is to west, but without reimplementing their script, this seems to be the
-    # easiest way to do this
-    rm -rf .west; mkdir .west
-    cat << EOF >> ${S}/.west/config
-[manifest]
-path = zephyr
-file = west.yml
-EOF
-
-    # Get all available modules and add them to ZEPHYR_MODULES
-    for i in $(west list|awk 'NR>1 {print $2}'); do
-        ZEPHYR_MODULES="${S}/$i\;${ZEPHYR_MODULES}"
-    done
-    export ZEPHYR_MODULES
-}
-
-do_get_zmods[nostamp] = "1"
-do_get_zmods[dirs] = "${B}"
-
 EXTRA_OECMAKE:append = " -DZEPHYR_MODULES=${ZEPHYR_MODULES}"
 
-addtask get_zmods after do_patch before do_configure
-do_get_zmods[depends] += "west-native:do_populate_sysroot"
-do_get_zmods[depends] += "python3-pyyaml-native:do_populate_sysroot"
-do_get_zmods[depends] += "python3-pykwalify-native:do_populate_sysroot"
-do_get_zmods[depends] += "python3-colorama-native:do_populate_sysroot"
-do_get_zmods[depends] += "python3-pyelftools-native:do_populate_sysroot"
-
 python do_menuconfig() {
     os.chdir(d.getVar('ZEPHYR_SRC_DIR', True))
     configdir = d.getVar('ZEPHYR_SRC_DIR', True) + '/outdir/' + d.getVar('BOARD', True)
diff --git a/meta-zephyr-core/recipes-devtools/west/west_0.12.99.bb b/meta-zephyr-core/recipes-devtools/west/west_0.12.99.bb
deleted file mode 100644
index 6a9f8bc..0000000
--- a/meta-zephyr-core/recipes-devtools/west/west_0.12.99.bb
+++ /dev/null
@@ -1,22 +0,0 @@
-# SPDX-FileCopyrightText: Huawei Inc.
-# SPDX-License-Identifier: Apache-2.0
-
-SUMMARY = "Zephyr RTOS Project meta-tool"
-HOMEPAGE = "https://github.com/zephyrproject-rtos/west"
-LICENSE = "Apache-2.0"
-LIC_FILES_CHKSUM = "file://LICENSE;md5=e3fc50a88d0a364313df4b21ef20c29e"
-
-SRC_URI = "git://github.com/zephyrproject-rtos/west;protocol=https;branch=main"
-
-PV = "0.12.99"
-SRCREV = "38e656b05ea8f4c8d80b953f6d88b1ed604d11f8"
-PROVIDES = "virtual/west"
-
-S = "${WORKDIR}/git"
-
-inherit setuptools3 python3native
-
-DEPENDS_${PN} += "python3-pyyaml python3-core python3-packaging python3-colorama python3-pyparsing"
-RDEPENDS_${PN} += "python3-pyyaml python3-core python3-packaging python3-colorama python3-pyparsing"
-BBCLASSEXTEND = "native nativesdk"
-TOOLCHAIN_HOST_TASK:append = " nativesdk-west"
-- 
2.25.1



  parent reply	other threads:[~2022-09-16  9:03 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-16  9:03 [meta-zephyr][PATCH 0/4] Add script for version upgrades Peter Hoyes
2022-09-16  9:03 ` [meta-zephyr][PATCH 1/4] zephyr-core/scripts: Introduce script to generate new versions Peter Hoyes
2022-09-16  9:03 ` [meta-zephyr][PATCH 2/4] zephyr-core/zephyr-kernel: Migrate to script-driven version files Peter Hoyes
2022-09-16  9:03 ` Peter Hoyes [this message]
2022-09-16  9:03 ` [meta-zephyr][PATCH 4/4] zephyr-core/zephyr-kernel: Update dtc.patch Upstream-Status Peter Hoyes
2022-09-20 22:33 ` [meta-zephyr][PATCH 0/4] Add script for version upgrades Jon Mason
2022-09-21  8:49   ` [yocto] " Saini, Naveen Kumar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220916090318.1293922-4-peter.hoyes@arm.com \
    --to=peter.hoyes@arm.com \
    --cc=diego.sueiro@arm.com \
    --cc=yocto@lists.yoctoproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox