From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail1.windriver.com (mail1.windriver.com [147.11.146.13]) by mail.openembedded.org (Postfix) with ESMTP id 1733D6DA62 for ; Fri, 15 Nov 2013 02:44:02 +0000 (UTC) Received: from ALA-HCA.corp.ad.wrs.com (ala-hca.corp.ad.wrs.com [147.11.189.40]) by mail1.windriver.com (8.14.5/8.14.5) with ESMTP id rAF2i4c3007201 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=FAIL) for ; Thu, 14 Nov 2013 18:44:04 -0800 (PST) Received: from [128.224.162.213] (128.224.162.213) by ALA-HCA.corp.ad.wrs.com (147.11.189.50) with Microsoft SMTP Server (TLS) id 14.2.347.0; Thu, 14 Nov 2013 18:44:03 -0800 Message-ID: <52858A7D.7050704@windriver.com> Date: Fri, 15 Nov 2013 10:44:13 +0800 From: ChenQi User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130804 Thunderbird/17.0.8 MIME-Version: 1.0 To: References: In-Reply-To: X-Originating-IP: [128.224.162.213] Subject: Re: [PATCH 0/1] sanity.bbclass: check for validity of TMPDIR X-BeenThere: openembedded-core@lists.openembedded.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: Patches and discussions about the oe-core layer List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Nov 2013 02:44:02 -0000 Content-Type: text/plain; charset="ISO-8859-1"; format=flowed Content-Transfer-Encoding: 7bit Hi All, This cover letter contains some testing records. Best Regards, Chen Qi On 11/14/2013 09:07 PM, Qi.Chen@windriver.com wrote: > From: Chen Qi > > This patch checks the validity of TMPDIR. > > The TMPDIR must match the following regexp. > ^/[a-zA-Z0-9\-_/.~]+$ > > Detailed tests about why I came up with this regexp are displayed at the end of this cover letter. > > A major reason for why TMPDIR cannot support many special chars such as @ and # is that these > special chars are used by the sed command as its field separator in our recipes. > > And here are things I want to make sure of. > 1. For now, TMPDIR must be an absolute path. So do we need to make it support relative path? > 2. I included the tilde (~) into the valid char set because `bitbake world' succeeded. But > it's still possible the the tilde (~) will serve as the field separator in sed. So is it > OK that I include it into the valid char set? > > > ********************** TESTING RECORDS **************************************** > Test Case 1: use `bitbake minimal' on paths containing special chars > Here's the output. > =================== > TMPDIR = "/home/chenqi/wrlinux-build/directory-names/dir-with-special-chars/`_contained" > RESULT: FAIL > =================== > TMPDIR = "/home/chenqi/wrlinux-build/directory-names/dir-with-special-chars/^_contained" > RESULT: SUCCESS > =================== > TMPDIR = "/home/chenqi/wrlinux-build/directory-names/dir-with-special-chars/~_contained" > RESULT: SUCCESS > =================== > TMPDIR = "/home/chenqi/wrlinux-build/directory-names/dir-with-special-chars/<_contained" > RESULT: FAIL > =================== > TMPDIR = "/home/chenqi/wrlinux-build/directory-names/dir-with-special-chars/=_contained" > RESULT: FAIL > =================== > TMPDIR = "/home/chenqi/wrlinux-build/directory-names/dir-with-special-chars/>_contained" > RESULT: FAIL > =================== > TMPDIR = "/home/chenqi/wrlinux-build/directory-names/dir-with-special-chars/|_contained" > RESULT: FAIL > =================== > TMPDIR = "/home/chenqi/wrlinux-build/directory-names/dir-with-special-chars/ _contained" > RESULT: FAIL > =================== > TMPDIR = "/home/chenqi/wrlinux-build/directory-names/dir-with-special-chars/,_contained" > RESULT: FAIL > =================== > TMPDIR = "/home/chenqi/wrlinux-build/directory-names/dir-with-special-chars/;_contained" > RESULT: FAIL > =================== > TMPDIR = "/home/chenqi/wrlinux-build/directory-names/dir-with-special-chars/:_contained" > RESULT: FAIL > =================== > TMPDIR = "/home/chenqi/wrlinux-build/directory-names/dir-with-special-chars/!_contained" > RESULT: SUCCESS > =================== > TMPDIR = "/home/chenqi/wrlinux-build/directory-names/dir-with-special-chars/?_contained" > RESULT: FAIL > =================== > TMPDIR = "/home/chenqi/wrlinux-build/directory-names/dir-with-special-chars/'_contained" > RESULT: FAIL > =================== > TMPDIR = "/home/chenqi/wrlinux-build/directory-names/dir-with-special-chars/\"_contained" > RESULT: FAIL > =================== > TMPDIR = "/home/chenqi/wrlinux-build/directory-names/dir-with-special-chars/(_contained" > RESULT: FAIL > =================== > TMPDIR = "/home/chenqi/wrlinux-build/directory-names/dir-with-special-chars/)_contained" > RESULT: FAIL > =================== > TMPDIR = "/home/chenqi/wrlinux-build/directory-names/dir-with-special-chars/[_contained" > RESULT: FAIL > =================== > TMPDIR = "/home/chenqi/wrlinux-build/directory-names/dir-with-special-chars/]_contained" > RESULT: SUCCESS > =================== > TMPDIR = "/home/chenqi/wrlinux-build/directory-names/dir-with-special-chars/{_contained" > RESULT: SUCCESS > =================== > TMPDIR = "/home/chenqi/wrlinux-build/directory-names/dir-with-special-chars/}_contained" > RESULT: FAIL > =================== > TMPDIR = "/home/chenqi/wrlinux-build/directory-names/dir-with-special-chars/@_contained" > RESULT: SUCCESS > =================== > TMPDIR = "/home/chenqi/wrlinux-build/directory-names/dir-with-special-chars/$_contained" > RESULT: FAIL > =================== > TMPDIR = "/home/chenqi/wrlinux-build/directory-names/dir-with-special-chars/*_contained" > RESULT: FAIL > =================== > TMPDIR = "/home/chenqi/wrlinux-build/directory-names/dir-with-special-chars/\_contained" > RESULT: FAIL > =================== > TMPDIR = "/home/chenqi/wrlinux-build/directory-names/dir-with-special-chars/&_contained" > RESULT: FAIL > =================== > TMPDIR = "/home/chenqi/wrlinux-build/directory-names/dir-with-special-chars/#_contained" > RESULT: FAIL > =================== > TMPDIR = "/home/chenqi/wrlinux-build/directory-names/dir-with-special-chars/%_contained" > RESULT: FAIL > =================== > TMPDIR = "/home/chenqi/wrlinux-build/directory-names/dir-with-special-chars/+_contained" > RESULT: SUCCESS > > > Test Case 2: TMPDIR containing ^ > TMPDIR = "/home/chenqi/wrlinux-build/directory-names/dir-with-special-chars/^_contained" > Command: > bitbake core-image-minimal -cpopulate_sdk > Result: > Fail > Formatted Error Message: > ERROR: Task 5 (virtual:nativesdk:/home/chenqi/poky/meta/recipes-core/eglibc/eglibc_2.18.bb, do_populate_sysroot) failed with exit code '1' > | checking whether the C compiler works... no > | configure: error: in `/home/chenqi/wrlinux-build/directory-names/dir-with-special-chars/^_contained/work/i686-nativesdk-pokysdk-linux/nativesdk-eglibc/2.18-r0/site_config_qemux86': > | configure: error: C compiler cannot create executables > | See `config.log' for more details > > > Test Case 3: TMPDIR containing + > TMPDIR = "/home/chenqi/wrlinux-build/directory-names/dir-with-special-chars/+_contained" > Command: > bitbake world > Result: > Fail > Formatted Error Message: > ERROR: Task 9084 (virtual:native:/home/chenqi/poky/meta/recipes-devtools/tcltk/tcl_8.6.1.bb, do_install) failed with exit code '1' > | oe_libinstall: cd /home/chenqi/wrlinux-build/directory-names/dir-with-special-chars/+_contained/work/i686-linux/tcl-native/8.6.1-r0/build > | sed: -e expression #1, char 117: unknown option to `s' > Reason: > '+' is used by the sed command as a separator in tcl recipe. > sed -i "s+${WORKDIR}+${STAGING_INCDIR}+g" tclConfig.sh > > > Test Case 4: TMPDIR containing ] > TMPDIR = "/home/chenqi/wrlinux-build/directory-names/dir-with-special-chars/]_contained" > Command: > bitbake world > Result: > Fail > Formatted Error Message: > ERROR: Task 5 (virtual:native:/home/chenqi/poky/meta/recipes-graphics/xcb/xcb-proto_1.8.bb, do_configure) failed with exit code '1' > | configure.ac:9: error: possibly undefined macro: AM_INIT_AUTOMAKE > | If this token and others are legitimate, please use m4_pattern_allow. > | See the Autoconf documentation. > | configure.ac:12: error: possibly undefined macro: AM_CONDITIONAL > | configure.ac:17: error: possibly undefined macro: AM_PATH_PYTHON > | autoreconf: /home/chenqi/wrlinux-build/directory-names/dir-with-special-chars/]_contained/sysroots/i686-linux/usr/bin/autoconf failed with exit status: 1 > | ERROR: autoreconf execution failed. > | WARNING: exit code 1 from a shell command. > > > Test Case 5: TMPDIR containing { > TMPDIR = "/home/chenqi/wrlinux-build/directory-names/dir-with-special-chars/[_contained" > Command: > bitbake world > Result: > Fail > Formatted Error Message: > ERROR: Task 9237 (virtual:native:/home/chenqi/poky/meta/recipes-gnome/gnome/gnome-doc-utils_0.20.10.bb, do_compile) failed with exit code '1' > | xsltproc -nonet -o "C/db-label.xml" \ > | --stringparam basename "db-label" \ > | --stringparam xsl_file "/home/chenqi/wrlinux-build/directory-names/dir-with-special-chars/{_contained/work/i686-linux/gnome-doc-utils-native/0.20.10-r0/gnome-doc-utils-0.20.10/doc/xslt/../../xslt/\ > docbook/common/db-label.xsl" \ > | "./xsldoc-docbook.xsl" "C/db-label.xsldoc" > | db-chunk: No stylesheet param for documented db.chunk.chunks > | db-common: No named template for documented db.copyright > | make[2]: *** [C/db-chunk.xml] Error 10 > > > Test Case 6: TMPDIR containing @ > TMPDIR = "/home/chenqi/wrlinux-build/directory-names/dir-with-special-chars/@_contained" > Command: > bitbake qt-mobility-x11 > Result: > Fail > Formatted Error Message: > ERROR: Task 2 (/home/chenqi/poky/meta/recipes-qt/qt4/qt-mobility-x11_1.2.0.bb, do_install) failed with exit code '1' > | DEBUG: Executing shell function do_install > | sed: -e expression #1, char 75: unknown option to `s' > > > Test Case 7: TMPDIR containing ~ > TMPDIR = "/home/chenqi/wrlinux-build/directory-names/dir-with-special-chars/[_contained" > Command: > bitbake world > Result: > Success > > **************************************************************************************** > > The following changes since commit ea92671d9823e3667d6ced7ac2af20f991da404d: > > bitbake: cooker: replace "w" file opening mode with "a" mode (2013-11-12 17:01:37 +0000) > > are available in the git repository at: > > git://git.pokylinux.org/poky-contrib ChenQi/TMPDIR > http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=ChenQi/TMPDIR > > Chen Qi (1): > sanity.bbclass: check for validity of TMPDIR > > meta/classes/sanity.bbclass | 7 +++++++ > 1 file changed, 7 insertions(+) >