Bug 2434

Summary: sanity.bbclass: check TMPDIR is not too long
Product: [Build System, Metadata & Runtime] OE-Core Reporter: Robert Yang <liezhi.yang>
Component: coreAssignee: Robert Yang <liezhi.yang>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: Medium CC: meta.mr.watcher, meta.watcher, richard.purdie, sgw, yi.zhao, zhenfeng.zhao
Version: 1.3   
Target Milestone: 1.3 M2   
Hardware: x86   
OS: Multiple   
See Also: https://bugzilla.yoctoproject.org/show_bug.cgi?id=2591
Whiteboard: Patch Review 30%
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: ---
Bug Depends on: 2639, 2640, 2664, 2688, 2689    
Bug Blocks:    

Description Robert Yang 2012-05-08 02:47:03 UTC
When the length of TMPDIR is longer than a threshold, there would be an
    "Argument list too long" error when building gcc-cross, this is the
    error from the exec(), the maximum length of argument is defined in
    /usr/include/linux/limits.h:
    
      #define ARG_MAX       131072    /* # bytes of args + environ for exec() */
    
    It's hard to determine the threshold of the TMPDIR, here is the
    experimental value:
    len(TMPDIR) = 182   Success
    len(TMPDIR) = 192   Failed
    
    So set the maximum length of TMPDIR to 180 seems a reasonable value.
Comment 1 Saul Wold 2012-05-10 23:06:59 UTC
This is the wrong approach, please consider the approach looking at the gcc recipe and use the @.
Comment 2 Robert Yang 2012-05-11 01:15:43 UTC
(In reply to comment #1)
> This is the wrong approach, please consider the approach looking at the gcc
> recipe and use the @.

Hi Saul,
I'm sorry, but I don't quite understand what did you mean, I had sent pull request for it, and there is the discussion about the gcc's recipe, the pull request is in the oe-core, would you please take a look at it? And the title is:
sanity.bbclass: check TMPDIR is not too long
Comment 3 Robert Yang 2012-07-10 01:56:57 UTC
Merged into master:

http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=2dee999ab2731c2a96e82762ae04fe44f27edac6

The length can not be longer than 410 currently.
Comment 4 Yi Zhao 2012-07-13 10:27:42 UTC
Verified with 1.3 m2 rc1.
git info: eb0cb7e8234f5d2e5623406e9660be91cf52f65e

Create a build directory, the length is longer than 410. Run "bitbake core-image-sato" will get following error message:

##########
ERROR:  OE-core's config sanity checker detected a potential misconfiguration.
    Either fix the cause of this error or at your own risk disable the checker (see sanity.conf).
    Following is the list of potential problems / advisories:

    The length of TMPDIR is longer than 410, this would cause unexpected errors, please use a shorter path.
Failed to fetch test data from the network. Please ensure your network is configured correctly.
##########

When the length of TMPDIR less than 410, "bitbake core-image-sato" can run without problem.