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

bson-dsl.h needed by mongo-c-driver but not installed by libbson

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 1.24.4
    • Affects Version/s: 1.24.1
    • Component/s: BSON, Build
    • None

      Problem Statement/Rationale

      mongo-c-driver 1.24.1 fails to build because it can't find bson/bson-dsl.h. libbson 1.24.1 didn't install it.

      Steps to Reproduce

      I've installed libbson 1.24.1 built with these cmake flags:

      {{-DENABLE_AUTOMATIC_INIT_AND_CLEANUP=OFF
      -DENABLE_EXAMPLES=OFF
      -DENABLE_TESTS=OFF
      -DENABLE_UNINSTALL=OFF
      -DMONGO_USE_CCACHE=OFF
      -DENABLE_BSON=ON
      -DENABLE_MONGOC=OFF}}

      Then I tried to build mongo-c-driver 1.24.1 with these cmake flags:

      {{{}-DENABLE_AUTOMATIC_INIT_AND_CLEANUP=OFF
      -DENABLE_EXAMPLES=OFF
      {}}}{{{}-DENABLE_TESTS=OFF
      -DENABLE_UNINSTALL=OFF
      -DMONGO_USE_CCACHE=OFF-DENABLE_ICU=ON
      -DENABLE_MONGOC=ON
      -DENABLE_SASL=CYRUS
      -DENABLE_SNAPPY=ON
      -DENABLE_ZLIB=SYSTEM
      -DUSE_SYSTEM_LIBBSON=TRUE{}}}

      Expected Results

      Successful build

      Actual Results

      Build failure:

      src/libmongoc/src/mongoc/mongoc-aggregate.c:26:10: fatal error: 'bson/bson-dsl.h' file not found
      #include <bson/bson-dsl.h>
               ^~~~~~~~~~~~~~~~~
      1 error generated.

      Additional Notes

      Another user previously reported the problem here:

      https://github.com/mongodb/mongo-c-driver/commit/40a64c2ffd6634021741e5435be15089d1f466f3#commitcomment-119488769

      I'm on macOS 12.6.7 installing libbson and mongo-c-driver with MacPorts—I'm the maintainer of these in MacPorts, currently trying to update them from 1.23.5, which was fine, to 1.24.1.

      For 1.24.1 I'm using -DUSE_SYSTEM_LIBBSON=TRUE instead of -DENABLE_BSON=SYSTEM; I hope I've correctly understood from the documentation that this is needed.

       

            Assignee:
            kevin.albertson@mongodb.com Kevin Albertson
            Reporter:
            ryandesign Ryan Schmidt
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: