bug-gnulib
[Top][All Lists]
Advanced

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

Re: bison: new module


From: Bruno Haible
Subject: Re: bison: new module
Date: Fri, 01 May 2020 20:10:54 +0200
User-agent: KMail/5.1.3 (Linux/4.4.0-177-generic; KDE/5.18.0; x86_64; ; )

Hi Akim,

> I would personally just run bison on a file with %require "VERSION".
> It was introduced in 2.2 (2006-05-19), which, I think, is old enough.
> If you agree with that approach, I can provide a patch.

Alas, this is not what we want. [1] says
  "If the requirement is not met, bison exits with an error (exit status 63)."

As explained in [2], it is frequent that users, when building a tarball,
don't control the modification times of the files. (For example, when using
plain "cp" to copy a directory, or when using NFS, or what else.) When such
a user has NOT modified the .y file and has an older bison installed, we want
the build to proceed without an error. Attempting to do this via the %require
declaration is not sufficient, because then bison will fail, and the Makefile
rule will fail. Therefore I prefer to do this in an Autoconf macro.

It would be possible to use %require and change the Makefile rule to test
for an exit code 63. Then at configure time, we would only need to test
whether bison is present or not. But this has drawbacks:
  * The Makefile rule - which gnulib cannot encapsulate in a macro -
    becomes more complicated. => More burden to the gnulib user.
  * The gnulib user has to test 3 situations:
      - bison present and new enough,
      - bison present but too old,
      - bison absent.
    Whereas with the approach I committed, the gnulib user has to test 2
    situations:
      - bison present and new enough,
      - bison present but too old, or absent.

Things would be different if the Makefile rule could be autogenerated by
Automake. But it does not work in practice, because
  - Automake is slow to evolve and react,
  - In some cases, the programmer wants to keep the generated .h file (and
    possibly also the .output file); in other case, the programmer wants
    to delete the generated .h file.

Bruno

[1] https://www.gnu.org/software/bison/manual/html_node/Require-Decl.html
[2] https://lists.gnu.org/archive/html/bug-gnulib/2020-05/msg00009.html




reply via email to

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