Message ID | 20250307162426.1152646-1-JPEWhacker@gmail.com |
---|---|
State | New |
Headers | show |
Series | lib: spdx30_tasks: Use Fetch.expanded_urldata() | expand |
On Fri Mar 7, 2025 at 5:24 PM CET, Joshua Watt via lists.openembedded.org wrote: > Converts the SPDX 3 code to use the Fetch.expanded_urldata() API instead > of iterating over all the SRC_URI entries manually. This will correctly > report additional download URIs (e.g. submodules) in the SPDX data. > > Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> > --- It looks like this is failing sometimes on submodules, I had a fail with meta-arm edk2-firmware recipe on the autobuilder: Exception: bb.fetch2.FetchError: Fetcher failure for URL: 'gitsm://github.com/openssl/openssl;protocol=https;name=CryptoPkg/Library/OpensslLib/openssl;subpath=CryptoPkg/Library/OpensslLib/openssl;nobranch=1;lfs=True;bareclone=1;nobranch=1'. Please set a valid SRCREV for url ['SRCREV_CryptoPkg/Library/OpensslLib/openssl:pn-edk2-firmware', 'SRCREV_CryptoPkg/Library/OpensslLib/openssl', 'SRCREV:pn-edk2-firmware', 'SRCREV'] (possible key names are gitsm://github.com/openssl/openssl;protocol=https;name=CryptoPkg/Library/OpensslLib/openssl;subpath=CryptoPkg/Library/OpensslLib/openssl;nobranch=1;lfs=True;bareclone=1;nobranch=1, or use a ;rev=X URL parameter) https://autobuilder.yoctoproject.org/valkyrie/#/builders/75/builds/1122 Yet I had another build succeed yesterday, also with this patch and on the same version of meta-arm: https://autobuilder.yoctoproject.org/valkyrie/#/builders/75/builds/1120 So I'm not really sure what is happening here.
diff --git a/meta/lib/oe/spdx30_tasks.py b/meta/lib/oe/spdx30_tasks.py index e20bb0c86f3..f85fbeb0f0a 100644 --- a/meta/lib/oe/spdx30_tasks.py +++ b/meta/lib/oe/spdx30_tasks.py @@ -349,12 +349,11 @@ def add_download_files(d, objset): urls = d.getVar("SRC_URI").split() fetch = bb.fetch2.Fetch(urls, d) - for download_idx, src_uri in enumerate(urls): - fd = fetch.ud[src_uri] - + for download_idx, fd in enumerate(fetch.expanded_urldata()): for name in fd.names: - file_name = os.path.basename(fetch.localpath(src_uri)) - if oe.patch.patch_path(src_uri, fetch, "", expand=False): + fd.setup_localpath(d) + file_name = os.path.basename(fd.localpath) + if oe.patch.patch_path(fd.url, fetch, "", expand=False): primary_purpose = oe.spdx30.software_SoftwarePurpose.patch else: primary_purpose = oe.spdx30.software_SoftwarePurpose.source
Converts the SPDX 3 code to use the Fetch.expanded_urldata() API instead of iterating over all the SRC_URI entries manually. This will correctly report additional download URIs (e.g. submodules) in the SPDX data. Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> --- meta/lib/oe/spdx30_tasks.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-)