Bug 2688

Summary: apt-native 0.7.14: file name too long error when run (tmpdir length)
Product: [Build System, Metadata & Runtime] OE-Core Reporter: Robert Yang <liezhi.yang>
Component: devtools / tool chainAssignee: Robert Yang <liezhi.yang>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: Medium CC: jessica.zhang, liang.li2, meta.mr.watcher, meta.watcher, sgw, song.liu, zhenfeng.zhao
Version: 1.3   
Target Milestone: 1.3 M4   
Hardware: x86   
OS: Multiple   
Whiteboard: (QA Testing Completed)(Done)
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: ---
Bug Depends on:    
Bug Blocks: 2434    

Description Robert Yang 2012-07-04 02:51:21 UTC
when the tmpdir dir is longer than 220, there is no files saved in tmp/sysroots/x86_64-linux/var/lib/apt/lists/ after run apt-get update, this is because apt-get uses the path as the file name, but the file name can't be longer than 255 according to /usr/include/linux/limits.h, here is the related from apt-pkg/contrib/strutl.cc:

string URItoFileName(const string &URI)
{
   // Nuke 'sensitive' items
   ::URI U(URI);
   U.User.clear();
   U.Password.clear();
   U.Access.clear();

   // "\x00-\x20{}|\\\\^\\[\\]<>\"\x7F-\xFF";
   string NewURI = QuoteString(U,"\\|{}[]<>\"^~_=!@#$%^&*");
   replace(NewURI.begin(),NewURI.end(),'/','_');
   return NewURI;
}

Limit the NewURI length to 255 would fix the problem.
Comment 2 liang li 2012-07-19 08:01:43 UTC
the build dir is "/home/yocto/test_yocto_yocto_yocto_yocto_yocto_yocto_yocto_yocto_yocto_yocto_yocto_yocto_yocto_yocto_yocto_yocto_yocto_yocto_yocto_yocto_yocto_yocto_yocto_yocto_yocto_yocto_yocto_yocto_yocto_yocto_yocto_yocto_yocto_yocto/test_yocto_yocto_yocto_yocto_yocto_yocto_yocto_yocto_yocto_yocto_yocto_yocto_yocto_yocto_yocto_yocto_yocto_yocto_yocto_yocto_yocto_yocto_yocto_yocto_yocto_yocto_yocto_yocto_yocto" ,which length equals 400.
run "bitbake core-image-minimal", no error during build and files are saved in "tmp/sysroots/x86_64-linux/var/lib/apt/lists/".
Comment 3 liang li 2012-07-19 08:08:22 UTC
test env :
host :Fedora 17 x86_64

git info : eb0cb7e8234f5d2e5623406e9660be91cf52f65e
git branch: poky/master