summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChangqing Li <changqing.li@windriver.com>2024-12-30 15:31:00 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2025-01-03 11:05:03 +0000
commitb5f2bcd0c158125f74ee7e5fbfe278a663936a0d (patch)
tree2e882a5314395c80072e7002a28667c85c9e764b
parentb1671dac9f96445f8692540f84a49f77e47819ad (diff)
downloadpoky-b5f2bcd0c158125f74ee7e5fbfe278a663936a0d.tar.gz
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>
-rw-r--r--meta/classes-global/sanity.bbclass4
1 files changed, 2 insertions, 2 deletions
diff --git a/meta/classes-global/sanity.bbclass b/meta/classes-global/sanity.bbclass
index a0b2508e11..7b8a497d5a 100644
--- a/meta/classes-global/sanity.bbclass
+++ b/meta/classes-global/sanity.bbclass
@@ -760,8 +760,8 @@ def check_sanity_version_change(status, d):
760 if not oes_bb_conf: 760 if not oes_bb_conf:
761 status.addresult('You are not using the OpenEmbedded version of conf/bitbake.conf. This means your environment is misconfigured, in particular check BBPATH.\n') 761 status.addresult('You are not using the OpenEmbedded version of conf/bitbake.conf. This means your environment is misconfigured, in particular check BBPATH.\n')
762 762
763 # The length of TMPDIR can't be longer than 410 763 # The length of TMPDIR can't be longer than 400
764 status.addresult(check_path_length(tmpdir, "TMPDIR", 410)) 764 status.addresult(check_path_length(tmpdir, "TMPDIR", 400))
765 765
766 # Check that TMPDIR isn't located on nfs 766 # Check that TMPDIR isn't located on nfs
767 status.addresult(check_not_nfs(tmpdir, "TMPDIR")) 767 status.addresult(check_not_nfs(tmpdir, "TMPDIR"))