bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: What is the purpose of parser-built?


From: Eric Blake
Subject: Re: What is the purpose of parser-built?
Date: Wed, 6 Feb 2019 17:12:20 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0

On 2/6/19 5:05 PM, Peng Yu wrote:
> On Wed, Feb 6, 2019 at 4:49 PM Eric Blake <address@hidden> wrote:
>>
>> On 2/6/19 4:18 PM, Peng Yu wrote:
>>> Hi,
>>>
>>> I deleted the file parser-built, and bash still compiles and an empty
>>> parser-built file will be generated upon compilation. What is the
>>> purpose of this file? Should it be deleted? Thanks.
> 
>> parser-built is a witness that $(YACC) was run, even if the timestamps
>> did not change (because the generated file did not change compared to
>> last time). It exists in the file system so as to let make compute
>> timestamp dependencies where we know the parser is up-to-date, even
>> though the actual file we depend on has a timestamp that does NOT change
>> (because we intentionally don't override it when there is no
>> difference), all in order to minimize the time spent rebuilding the
>> project when making a tweak to parse.y (for example, being able to tell
>> the difference between a minor edit that changes a comment but not the
>> generated parser, vs. a major edit that requires rebuilding other files
>> to pick up the changes implied by the changed parser).
> 
> I don't get the point. Should parser-built be deleted? If bash can be
> compiled without it, why put it in the source tar.gz file?

Deleting it makes rebuild times longer, AND means that your build will
depend on having a decent $(YACC) installed.  The file is placed in the
tar.gz so that downstream users can unpack bash (even if it corrupts
timestamps), and still be able to './configure && make' without having
bison installed; where only the upstream maintainer has to have bison.
If you deleted the file and things still built, then you happen to have
a good-enough bison installed, OR you got lucky and didn't make any
changes to parser.y that would have resulted in changes where the
fallback rule of copying the pre-built y.tab.h that shipped with the
tarball disagrees with an actual y.tab.h that you would get if you did
have bison installed.


-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3226
Virtualization:  qemu.org | libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]