Bug 16293

Summary: sstate download with a filename of 253 characters fails (via https)
Product: [Build System, Metadata & Runtime] OE-Core Reporter: Mark Hatle <mark.hatle>
Component: coreAssignee: Richard Purdie <richard.purdie>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: Medium+ CC: mathieu.dubois-briand, meta.mr.watcher, meta.watcher, randy.macleod, richard.purdie
Version: 5.0.18   
Target Milestone: 6.1 M2   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: No (bug/feature does not impact docs)

Description Mark Hatle 2026-05-21 15:58:44 UTC
A 253 character filename is passed to the bitbake wget fetcher.  The bitbake fetcher appends '.tmp' to the name so that the download can me renamed to the final name in a single operation.

This leads to a condition where the filename exceeds the max filename length of the filesystem and wget will refuse to download (or if it tries will fail.)

Either the filename needs to be "further" truncated in sstate.bbclass (it already truncates to under 254 characters), or the bitbake fetcher should detect the long filename and prevent the temp name from exceeding the filesystem length.
Comment 1 Richard Purdie 2026-05-21 15:59:57 UTC
The ".tmp" is a fetcher implementation detail so sstate shouldn't have to worry about this. This should be fixed in the fetcher.
Comment 2 Mark Hatle 2026-05-21 17:29:34 UTC
I think the easiest solution (in the fetcher) is to limit the 'tmp' filename to 250 characters (just truncate it) and then add the '.tmp' suffix.  Then when the file is downloaded, it can be renamed to the original name without an issue.

Alternatively, we could start generating temp filenames, but I'm not sure we really want to change the system behavior in that way at this time.