summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGyorgy Sarvari <skandigraun@gmail.com>2025-06-27 16:13:06 +0200
committerKhem Raj <raj.khem@gmail.com>2025-06-28 11:04:24 -0700
commitb2a950a75b15c93f625bfe6514bc248c9310813f (patch)
treedec576c30b7480cc89c31cefc0da2c14ec6ecf42
parent87d1e803f5a3e5998714260ef7fcec2848059d1c (diff)
downloadmeta-openembedded-b2a950a75b15c93f625bfe6514bc248c9310813f.tar.gz
nodejs: inherit qemu class conditionally
The recipe unconditionally inherits the qemu class, because it executes some target binaries when it is cross-compiled and the bit-width of the build host and the target host are different. Since it is unconditional, it also means that it is inherited for native and nativesdk builds also. The qemu class uses some qemu options that are always derived from the target machine's configuration, even when the recipe is built for class-native. This means that some of the variables used by the recipe changes (e.g. QEMU_OPTIONS), and the shared state cache is invalidated when the target machine changes, even when nodejs-native is being built - and it triggers a full rebuild of nodejs-native unnecessarily. To avoid this, inherit the qemu class conditionally, only in case it is used (when the target and build arch's bit-widths are different). Also, inherit qemu-native based on the same condition, and move around the qemu-dependent code a bit, so it will be only executed when the qemu class is inherited. Signed-off-by: Gyorgy Sarvari <skandigraun@gmail.com> Signed-off-by: Khem Raj <raj.khem@gmail.com>
-rw-r--r--meta-oe/recipes-devtools/nodejs/nodejs_22.16.0.bb14
1 files changed, 8 insertions, 6 deletions
diff --git a/meta-oe/recipes-devtools/nodejs/nodejs_22.16.0.bb b/meta-oe/recipes-devtools/nodejs/nodejs_22.16.0.bb
index 4bc829f140..679acafabf 100644
--- a/meta-oe/recipes-devtools/nodejs/nodejs_22.16.0.bb
+++ b/meta-oe/recipes-devtools/nodejs/nodejs_22.16.0.bb
@@ -6,10 +6,11 @@ LIC_FILES_CHKSUM = "file://LICENSE;md5=b4f41dcacabc8f07b9ca7dee2f188a00"
6CVE_PRODUCT = "nodejs node.js" 6CVE_PRODUCT = "nodejs node.js"
7 7
8DEPENDS = "openssl openssl-native file-replacement-native python3-packaging-native" 8DEPENDS = "openssl openssl-native file-replacement-native python3-packaging-native"
9DEPENDS:append:class-target = " qemu-native"
10DEPENDS:append:class-native = " c-ares-native" 9DEPENDS:append:class-native = " c-ares-native"
11 10
12inherit pkgconfig python3native qemu ptest siteinfo 11inherit pkgconfig python3native ptest siteinfo
12inherit_defer ${@bb.utils.contains('HOST_AND_TARGET_SAME_WIDTH', '0', 'qemu', '', d)}
13
13 14
14COMPATIBLE_MACHINE:armv4 = "(!.*armv4).*" 15COMPATIBLE_MACHINE:armv4 = "(!.*armv4).*"
15COMPATIBLE_MACHINE:armv5 = "(!.*armv5).*" 16COMPATIBLE_MACHINE:armv5 = "(!.*armv5).*"
@@ -108,11 +109,11 @@ python do_create_v8_qemu_wrapper () {
108 on the host.""" 109 on the host."""
109 qemu_libdirs = [d.expand('${STAGING_DIR_HOST}${libdir}'), 110 qemu_libdirs = [d.expand('${STAGING_DIR_HOST}${libdir}'),
110 d.expand('${STAGING_DIR_HOST}${base_libdir}')] 111 d.expand('${STAGING_DIR_HOST}${base_libdir}')]
111 qemu_cmd = qemu_wrapper_cmdline(d, d.getVar('STAGING_DIR_HOST'), 112 qemu_cmd = ""
112 qemu_libdirs)
113 113
114 if d.getVar("HOST_AND_TARGET_SAME_WIDTH") == "1": 114 if d.getVar("HOST_AND_TARGET_SAME_WIDTH") == "0":
115 qemu_cmd = "" 115 qemu_cmd = qemu_wrapper_cmdline(d, d.getVar('STAGING_DIR_HOST'),
116 qemu_libdirs)
116 117
117 wrapper_path = d.expand('${B}/v8-qemu-wrapper.sh') 118 wrapper_path = d.expand('${B}/v8-qemu-wrapper.sh')
118 with open(wrapper_path, 'w') as wrapper_file: 119 with open(wrapper_path, 'w') as wrapper_file:
@@ -209,6 +210,7 @@ python __anonymous () {
209 # 32 bit target and 64 bit host (x86-64 or aarch64) have different bit width 210 # 32 bit target and 64 bit host (x86-64 or aarch64) have different bit width
210 if d.getVar("SITEINFO_BITS") == "32" and "64" in d.getVar("BUILD_ARCH"): 211 if d.getVar("SITEINFO_BITS") == "32" and "64" in d.getVar("BUILD_ARCH"):
211 d.setVar("HOST_AND_TARGET_SAME_WIDTH", "0") 212 d.setVar("HOST_AND_TARGET_SAME_WIDTH", "0")
213 d.appendVar("DEPENDS:class-target", " qemu-native")
212 else: 214 else:
213 d.setVar("HOST_AND_TARGET_SAME_WIDTH", "1") 215 d.setVar("HOST_AND_TARGET_SAME_WIDTH", "1")
214} 216}