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

s_doc failure on OS/X

    • Storage Engines
    • 3
    • 2024-04-02 - GreatMugshot

      When running s_doc on my laptop, I see this:

      $ bash s_docs
      sed: 1: "../src/docs/spell.ok": invalid command code .
      sort: ../src/docs/spell.ok:2: disorder: ACM
      Sorting ../src/docs/spell.ok ...
      sed: 1: "../src/docs/spell.ok": invalid command code .
      Error: The file "./spell.ok" is not in the proper format.
      
      $ git diff
      diff --git a/src/docs/spell.ok b/src/docs/spell.ok
      index 48a3f7183..9cd623ef0 100644
      --- a/src/docs/spell.ok
      +++ b/src/docs/spell.ok
      @@ -1,4 +1,3 @@
      -personal_ws-1.1 en 200
       ACM
       ADDR
       APIs
      @@ -553,6 +552,7 @@ pareto
       pcoll
       pdf
       perf
      +personal_ws-1.1 en 200
       petabyte
       pget
       php
      dda@M-LKFK6YX19K$ 
       

      That is, after s_doc has run and failed, it has modified a file, and not for the better.

      I think the complaint is from the sed command

        sed -i '/personal_ws-1.1 en 200/d' $custom_spellings

      I think adding a -e after the -i could fix it.

      But the fact that the script changes $custom_spellings (src/doc/spell.ok) in place in order to check that file seems incorrect.  Otherwise (even on non-OS/X), interrupting the shell script can leave that file in a "wrong" state.  And the modified file can easily be accidentally committed.  I think the scripts should live by the rule - never modify a file unless you intend for the modification to be the final version.  Usually that means that a temporary file is built, that can be compared to the original, and only if different, it is moved into place.

       

       

            Assignee:
            will.korteland@mongodb.com Will Korteland
            Reporter:
            donald.anderson@mongodb.com Donald Anderson
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: