[bitbake-devel] Filename too long
Mark Hatle
mark.hatle at windriver.com
Thu Jan 19 15:07:09 UTC 2017
On 1/19/17 4:21 AM, Richard Purdie wrote:
> On Thu, 2017-01-19 at 14:13 +0800, Robert Yang wrote:
>> Hi Mark,
>>
>> We have a local patch to fix the problem, I had sent it to bitbake-
>> devel
>> before, but not merged:
>>
>> https://patchwork.openembedded.org/patch/61321/
>>
>> Here is the updated patch in our bitbake:
>>
>> commit ebb1190c01a15fc6e91c9810c46313c3b3fb305c
>> Author: Robert Yang <liezhi.yang at windriver.com>
>> Date: Fri Nov 8 23:32:11 2013 +0800
>>
>> fetch2/git.py: fix the filename too long error
>>
>> When we use the PREMIRROR/MIRROR from the local disk, and if it
>> is in a
>> deep directory, for example, when len(path) > 255 (The
>> NAME_MAX), we
>> will get the "filename too long error".
>>
>> This is becuase we use ud.path.replace('/', '.') to change the
>> path to
>> the filename. We seldom see such a long url, but it is easy to
>> produce
>> it on the local machine.
>>
>> Another problem is that:
>>
>> file:///local/path
>>
>> will be converted into .local.path which is a hidden file by
>> default.
>
> Looking at the code in your patch, this second piece clearly isn't true
> due to this code:
>
> if gitsrcname.startswith('.'):
> gitsrcname = gitsrcname[1:]
>
> I also don't believe this patch is correct since we're meant to be
> creating a filename, not a path and if you leave the '/' characters in,
> it isn't a filename. I think we likely just need to truncate the path
> to the last say 225 chars if its over length. The unique piece should
> be towards the right hand end of the name.
Ok.. I can certainly implement that. Should the truncation be in the lockfile
code or in the code that generatd the name itself?
BTW I did some further looking, the issue is that we have a recipe that includes
a local git repository. So essentially the recipe does:
recipe-foo/foo/foo_1.0.bb:
SRC_URI = "git://${THISDIR}/foo.git;type=file"
When I was looking through everything I was mistaking the path and premirror
work. It's actually the SRC_URI that is very long, and changes dynamically
based on the path to the recipe itself.... leading to the problem.
--Mark
> Cheers,
>
> Richard
>
More information about the bitbake-devel
mailing list