Skip to content

GNU Bison options --header and --defines are not recognised by SCons when they don't have an argument #4326

Closed

Description

@piotrsiupa

SCons ignores options --header and --defines passed to Bison when the argument is not provided.
The argument is optional for those options and if it is not provided SCons should behave the same way as if it encountered the options -d (which is detected correctly).
(https://www.gnu.org/software/bison/manual/bison.html#Output-Files)

  • Link to SCons Users thread discussing your issue. - https://discord.com/channels/571796279483564041/571796280146133047/1087434623476301836
  • Version of SCons - v4.5.1.49578b34582d9e92dac7d713a8e58599ae35aa63
  • Version of Python - 3.10.6
  • Which python distribution if applicable (python.org, cygwin, anaconda, macports, brew,etc) - the one from Ubuntu repository
  • How you installed SCons - through pip
  • What Platform are you on? (Linux/Windows and which version) - Linux Mint
  • How to reproduce your issue? Please include a small self contained reproducer. Likely a SConstruct should do for most issues. - it's below
  • How you invoke scons (The command line you're using "scons --flags some_arguments") - scons
targets = CFile('foo.y', YACCFLAGS='-d')
print('Flag `-d` (correct target list):', targets)

targets = CFile('bar.y', YACCFLAGS='--defines')
print('Flag `--defines` (incorrect target list):', targets)

targets = CFile('baz.y', YACCFLAGS='--header')
print('Flag `--header` (incorrect target list):', targets)

Activity

  1. mwichmann commented on Mar 20, 2023

    @mwichmann
    Collaborator

    The code currently only recognizes the option if it includes an equals sign:

        fileGenOptions = ["--defines=", "--header=", "--graph="]

    So we'd have to rework this a bit. Still doesn't look complicated.

  2. mwichmann commented on Mar 20, 2023

    @mwichmann
    Collaborator

    Note to self (or whoever takes on implementing): the -g option defaults to a .gv file suffix. This suffix does not have a construction variable analogous to $YACCHFILESUFFIX - not sure if we need to add one, or can just hard-code it.

  3. added
    Tools
    on Mar 20, 2023
  4. added a commit that references this issue on Mar 23, 2023
    3ec6fbf
  5. added a commit that references this issue on May 6, 2023
    7ddeb16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Tools

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions