Uploaded image for project: 'WiredTiger'
  1. WiredTiger
  2. WT-5805

Update s_* tools in dist/ to use POSIX-defined grep options rather than non-standard "fgrep -who"

    • Type: Icon: Improvement Improvement
    • Resolution: Unresolved
    • Priority: Icon: Minor - P4 Minor - P4
    • None
    • Affects Version/s: None
    • Component/s: Build-compile
    • Labels:
    • Environment:
      MacOS

      Update s_* tools in dist/ to use POSIX-defined grep options rather than non-standard "fgrep -who"

      Four of these scripts (s_define, s_funcs, s_stat, s_typedef) use fgrep with the -who options to find all occurrences of a list of strings across the all of the source files. In this usage fgrep returns different results on different systems.  Specifically the FreeBSD-based version that ships with MacOS returns different results than the GNU version.  On MacOS this leads to s_define and s_funcs complaining about many unused #defines and functions. These complaints appear to be in error (based on manual checking of a few instances)

      The simple work-around is to install the GNU utilities on your Mac.  But this leaves the possibility that the same problem will reappear with some other version of the tools.  Solaris fgrep, for example, doesn't support the -w or -o options.

      A cleaner way to avoid this problem would be for these scripts to only use POSIX-defined grep functionality.  (See: https://pubs.opengroup.org/onlinepubs/9699919799/utilities/grep.html)

      The -h and -w options should be reproducible with a bit of extra scripting.  -o ("Prints only the matching parts of the lines") may take more work.

            Assignee:
            backlog-server-storage-engines [DO NOT USE] Backlog - Storage Engines Team
            Reporter:
            keith.smith@mongodb.com Keith Smith
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: