Skip to contentSkip to conversation

bitbake.conf: add MACHINE to SDK_NAME

PATCH In review Denys Dmytriyenko 2 participants 4 messages Sep 22, 2023 – Sep 24, 2023

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 bitbake.conf: add MACHINE to SDK_NAME

Do the same here as Poky has done 5 years ago, adding MACHINE to SDK_NAME:

https://git.yoctoproject.org/meta-yocto/commit/?id=3614dd4aee9d19f1024edb6a36b2862c2d726c04

This avoids file conflicts in deploy/sdk/ when building multiple machines (either manually or via multiconfig), where sdk/toolchain installers, manifests and now SPDX archives will overlap otherwise.

---
 meta/conf/bitbake.conf | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/conf/bitbake.conf +1 -1
index 67577c8fe7..3fd089cebb 100644
@@ -459,7 +459,7 @@ PKGDATA_DIR_SDK = "${TMPDIR}/pkgdata/${SDK_SYS}"
 ##################################################################
 
 SDK_NAME_PREFIX ?= "oecore"
-SDK_NAME = "${SDK_NAME_PREFIX}-${IMAGE_BASENAME}-${SDK_ARCH}-${TUNE_PKGARCH}"
+SDK_NAME = "${SDK_NAME_PREFIX}-${IMAGE_BASENAME}-${SDK_ARCH}-${TUNE_PKGARCH}-${MACHINE}"
 SDKPATH = "/usr/local/oe-sdk-hardcoded-buildpath"
 SDKPATHNATIVE = "${SDKPATH}/sysroots/${SDK_SYS}"
 # The path to default to installing the SDK to
Signature · 1 line
2.25.1
#1 lore raw

PATCH 2/2 spdx: use TOOLCHAIN_OUTPUTNAME for SDK filename prefix

Replace SDK_NAME with TOOLCHAIN_OUTPUTNAME when naming SDK host and target SPDX archives.

In most cases TOOLCHAIN_OUTPUTNAME is almost identical to SDK_NAME, but sometimes custom meta-toolchain recipes have some variations and populate_sdk_base.bbclass already uses TOOLCHAIN_OUTPUTNAME to name corresponding host and target manifests:

SDK_HOST_MANIFEST = "${SDKDEPLOYDIR}/${TOOLCHAIN_OUTPUTNAME}.host.manifest" SDK_TARGET_MANIFEST = "${SDKDEPLOYDIR}/${TOOLCHAIN_OUTPUTNAME}.target.manifest"

To match the naming convention, also use TOOLCHAIN_OUTPUTNAME here for naming SPDX archives as well, resulting in:

${TOOLCHAIN_OUTPUTNAME}-host.spdx.tar.zst
${TOOLCHAIN_OUTPUTNAME}-target.spdx.tar.zst

---
 meta/classes/create-spdx-2.2.bbclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/classes/create-spdx-2.2.bbclass +1 -1
index a2b96da61a..885f07a1f8 100644
@@ -986,7 +986,7 @@ def sdk_combine_spdx(d, sdk_type):
     from pathlib import Path
     from oe.sdk import sdk_list_installed_packages
 
-    sdk_name = d.getVar("SDK_NAME") + "-" + sdk_type
+    sdk_name = d.getVar("TOOLCHAIN_OUTPUTNAME") + "-" + sdk_type
     sdk_deploydir = Path(d.getVar("SDKDEPLOYDIR"))
     sdk_spdxid = oe.sbom.get_sdk_spdxid(sdk_name)
     sdk_packages = sdk_list_installed_packages(d, sdk_type == "target")
Signature · 1 line
2.25.1
Tested-by on v1 2/2
#2 lore raw

Re: [OE-core] [PATCH 2/2] spdx: use TOOLCHAIN_OUTPUTNAME for SDK filename prefix

Quoted 11 lines · Denys Dmytriyenko

Replace SDK_NAME with TOOLCHAIN_OUTPUTNAME when naming SDK host and target SPDX archives.

In most cases TOOLCHAIN_OUTPUTNAME is almost identical to SDK_NAME, but sometimes custom meta-toolchain recipes have some variations and populate_sdk_base.bbclass already uses TOOLCHAIN_OUTPUTNAME to name corresponding host and target manifests:

SDK_HOST_MANIFEST = "${SDKDEPLOYDIR}/${TOOLCHAIN_OUTPUTNAME}.host.manifest" SDK_TARGET_MANIFEST = "${SDKDEPLOYDIR}/${TOOLCHAIN_OUTPUTNAME}.target.manifest"

Quoted 8 lines

To match the naming convention, also use TOOLCHAIN_OUTPUTNAME here for naming SPDX archives as well, resulting in:

${TOOLCHAIN_OUTPUTNAME}-host.spdx.tar.zst
${TOOLCHAIN_OUTPUTNAME}-target.spdx.tar.zst

Quoted 28 lines
---
  meta/classes/create-spdx-2.2.bbclass | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
meta/classes/create-spdx-2.2.bbclass +1 -2
index a2b96da61a..885f07a1f8 100644
@@ -986,7 +986,7 @@ def sdk_combine_spdx(d, sdk_type):
      from pathlib import Path
      from oe.sdk import sdk_list_installed_packages
 
-    sdk_name = d.getVar("SDK_NAME") + "-" + sdk_type
+    sdk_name = d.getVar("TOOLCHAIN_OUTPUTNAME") + "-" + sdk_type
      sdk_deploydir = Path(d.getVar("SDKDEPLOYDIR"))
      sdk_spdxid = oe.sbom.get_sdk_spdxid(sdk_name)
      sdk_packages = sdk_list_installed_packages(d, sdk_type == "target")
 
 
 
-=-=-=-=-=-=-=-=-=-=-=-

Links: You receive all messages sent to this group.
View/Reply Online (#188139): https://lists.openembedded.org/g/openembedded-core/message/188139
Mute This Topic: https://lists.openembedded.org/mt/101531120/6551054
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Signature · 3 lines
Ryan Eatmon                [email protected]
-----------------------------------------
Texas Instruments, Inc.  -  LCPD  -  MGTS
Tested-by on v1 1/2
#3 lore raw
In reply to Denys Dmytriyenko
Quoted 11 lines · Denys Dmytriyenko

Do the same here as Poky has done 5 years ago, adding MACHINE to SDK_NAME:

https://git.yoctoproject.org/meta-yocto/commit/?id=3614dd4aee9d19f1024edb6a36b2862c2d726c04

This avoids file conflicts in deploy/sdk/ when building multiple machines (either manually or via multiconfig), where sdk/toolchain installers, manifests and now SPDX archives will overlap otherwise.

Quoted 28 lines
---
  meta/conf/bitbake.conf | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
meta/conf/bitbake.conf +1 -2
index 67577c8fe7..3fd089cebb 100644
@@ -459,7 +459,7 @@ PKGDATA_DIR_SDK = "${TMPDIR}/pkgdata/${SDK_SYS}"
  ##################################################################
 
  SDK_NAME_PREFIX ?= "oecore"
-SDK_NAME = "${SDK_NAME_PREFIX}-${IMAGE_BASENAME}-${SDK_ARCH}-${TUNE_PKGARCH}"
+SDK_NAME = "${SDK_NAME_PREFIX}-${IMAGE_BASENAME}-${SDK_ARCH}-${TUNE_PKGARCH}-${MACHINE}"
  SDKPATH = "/usr/local/oe-sdk-hardcoded-buildpath"
  SDKPATHNATIVE = "${SDKPATH}/sysroots/${SDK_SYS}"
  # The path to default to installing the SDK to
 
 
 
-=-=-=-=-=-=-=-=-=-=-=-

Links: You receive all messages sent to this group.
View/Reply Online (#188138): https://lists.openembedded.org/g/openembedded-core/message/188138
Mute This Topic: https://lists.openembedded.org/mt/101531119/6551054
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Signature · 3 lines
Ryan Eatmon                [email protected]
-----------------------------------------
Texas Instruments, Inc.  -  LCPD  -  MGTS