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"

    XMLWordPrintable

    Details

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

      Description

      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.

        Attachments

          Activity

            People

            Assignee:
            backlog-server-storage-engines Backlog - Storage Engines Team
            Reporter:
            keith.smith Keith Smith
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated: