Uploaded image for project: 'C Driver'
  1. C Driver
  2. CDRIVER-2297

Shell error parsing "$((" expression produced Versions.m4

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 1.8.1, 1.9.0
    • Affects Version/s: 1.7.0
    • Component/s: Build, libbson, libmongoc
    • None
    • Environment:
      Alpine Linux, BusyBox v1.24.2

      In mongodb/mongo-php-driver#655 (PHPC-1014), a user reported an issue installing the PHP driver in Alpine Linux, which uses a BusyBox's shell. Of note, his troubles only started with PHP driver 1.3.0 (bundling libmongoc and libbson 1.8.0). PHP driver 1.2.11, which bundles 1.5.5, had no issues.

      Running our configure script through shellcheck reported the following error of interest:

      In configure line 12252:
      MONGOC_MAJOR_VERSION=$((cat $MONGOC_CURRENT_FILE; echo) | cut -d- -f1 | cut -d. -f1)
                           ^-- SC1073: Couldn't parse this $((..)) expression.
                           ^-- SC1009: The mentioned parser error was in this $((..)) expression.
                                  ^-- SC1072: Expected "))". Fix any mentioned problems and try again.
      

      I believe this was introduced by the following commits:

            Assignee:
            jmikola@mongodb.com Jeremy Mikola
            Reporter:
            jmikola@mongodb.com Jeremy Mikola
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: