poky/meta/classes-global
Changqing Li b5f2bcd0c1 sanity.bbclass: Lower the length of TMPDIR limit to 400
When TMPDIR has length 410,  bitbake uninative-tarball will fail at
do_populate_sdk with error: Failed to open backup database:
"TMPDIR/work/x86_64-nativesdk-pokysdk-linux/uninative-tarball/1.0/sdk/image/var/lib/dnf/history.sqlite"

sqlite3 has a hardcode max pathname limit 512, refer [1], and there is a
check, refer [2], pathname + 8 > max path name limit(512) is not
allowed.  So the pathname length need to <= 504.  While, length of
"TMPDIR/work/x86_64-nativesdk-pokysdk-linux/uninative-tarball/1.0/sdk/image/var/lib/dnf/history.sqlite"
is 505, so error happened.

We had met similar issue [3], and refer the comments, upstream reject
the change of the hardcode length, see [4][5].

This patch try to improve and workaround this issue by lower max TMPDIR
length to 400, at least for distro name length <=13, the build can
success.

[1] https://github.com/sqlite/sqlite/blob/master/src/os_unix.c#L180
[2] https://github.com/sqlite/sqlite/blob/master/src/pager.c#L4777
[3] https://bugzilla.yoctoproject.org/show_bug.cgi?id=12374
[4] https://sqlite.org/cgi/src/tktview/c060923a5422590b3734
[5] https://sqlite.org/forum/forumpost/0b1b8b5116

(From OE-Core rev: da1c0998bdaf5def7ae94f44a33b9a505edc99c1)

Signed-off-by: Changqing Li <changqing.li@windriver.com>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2025-01-03 11:05:03 +00:00
..
base.bbclass base/features_check: Make PARSE_ALL_RECIPES and SOURCE_MIRROR_FETCH boolean 2024-12-23 11:41:38 +00:00
buildstats.bbclass meta/lib: move buildstats.py and rootfspostcommands.py into oe 2024-12-05 17:07:10 +00:00
debian.bbclass package/package_write: Improve packagedata code location 2023-11-08 10:56:35 +00:00
devshell.bbclass devshell: Do not add scripts/git-intercept to PATH 2023-02-10 09:25:44 +00:00
insane.bbclass classes-global/insane: Handle case where RPROVIDER is also a provider 2024-12-12 12:55:56 +00:00
license.bbclass classes-global/license: Move functions to library code 2024-10-25 15:37:10 +01:00
logging.bbclass classes: Update classes to match new bitbake class scope functionality 2022-08-12 15:27:17 +01:00
mirrors.bbclass binutils-cross-testsuite: Rename to binutils-testsuite 2024-06-27 13:03:34 +01:00
package_deb.bbclass package/package_write: Improve packagedata code location 2023-11-08 10:56:35 +00:00
package_ipk.bbclass ipk: Switch to using zstd compression 2023-12-23 08:46:00 +00:00
package_pkgdata.bbclass classes: Update classes to match new bitbake class scope functionality 2022-08-12 15:27:17 +01:00
package_rpm.bbclass rpm: update 4.19.1.1 -> 4.20.0 2024-12-12 13:22:08 +00:00
package.bbclass lib/package: Check incompatible licenses at packaging time 2024-10-25 15:37:10 +01:00
packagedata.bbclass classes: Update classes to match new bitbake class scope functionality 2022-08-12 15:27:17 +01:00
patch.bbclass patch.bbclass: Make use of oe.patch.GitApplyTree.commitIgnored() 2024-02-19 16:03:22 +00:00
retain.bbclass classes: add new retain class for retaining build results 2024-08-03 07:56:10 +01:00
sanity.bbclass sanity.bbclass: Lower the length of TMPDIR limit to 400 2025-01-03 11:05:03 +00:00
sstate.bbclass sstate: rewrite sstate_archive_package in python 2024-11-18 22:09:03 +00:00
staging.bbclass classes-global/staging: Exclude do_create_spdx from automatic sysroot extension 2024-07-13 23:28:31 +01:00
uninative.bbclass uninative: Add pthread linking workaround 2024-03-19 15:25:12 +00:00
utility-tasks.bbclass classes/utility-tasks: port do_listtasks to use bb.build.listtasks 2024-12-12 13:31:27 +00:00
utils.bbclass utils.bbclass: Use objdump instead of readelf to compute SONAME 2024-07-01 13:56:02 +01:00
yocto-check-layer.bbclass yocto-check-layer: expand to cover all required QA checks 2024-12-03 11:42:35 +00:00