On 2/6/19 5:05 PM, Peng Yu wrote:
> On Wed, Feb 6, 2019 at 4:49 PM Eric Blake <ebl...@redhat.com> 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