diff options
author | Sofiane HAMAM <sofiane.hamam@smile.fr> | 2025-02-19 13:31:03 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2025-02-20 11:57:49 +0000 |
commit | 48c946af336b6c3fe30fc0357e4fc72c30c45ca4 (patch) | |
tree | 9f13ce1e8372e724453dbd1a549e2ec63a7823fc | |
parent | 36f4602671256193ec38589c3a230a9ec6269ca6 (diff) | |
download | poky-48c946af336b6c3fe30fc0357e4fc72c30c45ca4.tar.gz |
sanity: Check for non ascii chars in TOPDIR
Some modules (like Perl's MakeMaker) do not support non ASCII
characters in build folder's path, this would cause build failures
of software that does not support non ASCII.
A sanity check is added to warn the user.
Fixes [YOCTO #15764]
(From OE-Core rev: 2b3be97a0d0d60d026786a4465b24b6f6752ba32)
Signed-off-by: Sofiane HAMAM <sofiane.hamam@smile.fr>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r-- | meta/classes-global/sanity.bbclass | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/meta/classes-global/sanity.bbclass b/meta/classes-global/sanity.bbclass index 66693fc9b9..1bae998f74 100644 --- a/meta/classes-global/sanity.bbclass +++ b/meta/classes-global/sanity.bbclass | |||
@@ -299,6 +299,11 @@ def check_path_length(filepath, pathname, limit): | |||
299 | return "The length of %s is longer than %s, this would cause unexpected errors, please use a shorter path.\n" % (pathname, limit) | 299 | return "The length of %s is longer than %s, this would cause unexpected errors, please use a shorter path.\n" % (pathname, limit) |
300 | return "" | 300 | return "" |
301 | 301 | ||
302 | def check_non_ascii(filepath, pathname): | ||
303 | if(not filepath.isascii()): | ||
304 | return "Non-ASCII character(s) in %s path (\"%s\") detected. This would cause build failures as we build software that doesn't support this.\n" % (pathname, filepath) | ||
305 | return "" | ||
306 | |||
302 | def get_filesystem_id(path): | 307 | def get_filesystem_id(path): |
303 | import subprocess | 308 | import subprocess |
304 | try: | 309 | try: |
@@ -719,6 +724,7 @@ def check_sanity_version_change(status, d): | |||
719 | # Check that TMPDIR isn't on a filesystem with limited filename length (eg. eCryptFS) | 724 | # Check that TMPDIR isn't on a filesystem with limited filename length (eg. eCryptFS) |
720 | import stat | 725 | import stat |
721 | tmpdir = d.getVar('TMPDIR') | 726 | tmpdir = d.getVar('TMPDIR') |
727 | topdir = d.getVar('TOPDIR') | ||
722 | status.addresult(check_create_long_filename(tmpdir, "TMPDIR")) | 728 | status.addresult(check_create_long_filename(tmpdir, "TMPDIR")) |
723 | tmpdirmode = os.stat(tmpdir).st_mode | 729 | tmpdirmode = os.stat(tmpdir).st_mode |
724 | if (tmpdirmode & stat.S_ISGID): | 730 | if (tmpdirmode & stat.S_ISGID): |
@@ -785,6 +791,9 @@ def check_sanity_version_change(status, d): | |||
785 | # The length of TMPDIR can't be longer than 400 | 791 | # The length of TMPDIR can't be longer than 400 |
786 | status.addresult(check_path_length(tmpdir, "TMPDIR", 400)) | 792 | status.addresult(check_path_length(tmpdir, "TMPDIR", 400)) |
787 | 793 | ||
794 | # Check that TOPDIR does not contain non ascii chars (perl_5.40.0, Perl-native and shadow-native build failures) | ||
795 | status.addresult(check_non_ascii(topdir, "TOPDIR")) | ||
796 | |||
788 | # Check that TMPDIR isn't located on nfs | 797 | # Check that TMPDIR isn't located on nfs |
789 | status.addresult(check_not_nfs(tmpdir, "TMPDIR")) | 798 | status.addresult(check_not_nfs(tmpdir, "TMPDIR")) |
790 | 799 | ||