Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-55474

Force large numeric literals to `long long` in BSON append calls (fix xcode build)

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major - P3 Major - P3
    • 5.0.0-rc0
    • None
    • Internal Code
    • None
    • Fully Compatible
    • ALL
    • Service Arch 2021-04-05
    • 70

    Description

      ninja build/ninja/mongo/db/s/config/initial_split_policy_test.o:

      PATH='/usr/local/bin:/opt/bin:/bin:/usr/bin' PATHOSX='/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/Library/Apple/usr/bin' /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ @build/ninja/mongo/db/s/config/initial_split_policy_test.o.rsp
      In file included from src/mongo/db/s/config/initial_split_policy_test.cpp:35:
      In file included from src/mongo/db/s/config/config_server_test_fixture.h:32:
      In file included from src/mongo/db/catalog_raii.h:33:
      In file included from src/mongo/db/catalog/collection.h:43:
      In file included from src/mongo/db/catalog/collection_options.h:37:
      In file included from build/ninja/mongo/db/catalog/clustered_index_options_gen.h:19:
      src/mongo/bson/bsonobjbuilder.h:1160:15: error: call to deleted member function 'append'
          _builder->append(_fieldName, value);
          ~~~~~~~~~~^~~~~~
      src/mongo/db/s/config/initial_split_policy_test.cpp:1815:50: note: in instantiation of function template specialization 'mongo::BSONObjBuilderValueStream::operator<<<long>' requested here
              ChunkRange(BSON("y" << MINKEY), BSON("y" << -9117533237618642180)),
                                                       ^
      src/mongo/bson/bsonobjbuilder.h:250:14: note: candidate function [with T = long, $1 = void, $2 = void] has been explicitly deleted
          Derived& append(StringData fieldName, const T& n) = delete;
                   ^
      src/mongo/bson/bsonobjbuilder.h:162:14: note: candidate function not viable: no known conversion from 'long' to 'mongo::BSONObj' for 2nd argument
          Derived& append(StringData fieldName, BSONObj subObj) {
                   ^
      src/mongo/bson/bsonobjbuilder.h:211:14: note: candidate function not viable: no known conversion from 'long' to 'mongo::BSONArray' for 2nd argument
          Derived& append(StringData fieldName, BSONArray arr) {
                   ^
      src/mongo/bson/bsonobjbuilder.h:306:14: note: candidate function not viable: no known conversion from 'long' to 'mongo::OID' for 2nd argument
          Derived& append(StringData fieldName, OID oid) {
                   ^
       
      etc...
      

      These numeric literals are >32 bits wide so they are automatically `long`.
      There's no BSONObjBuilder append overload for `long` anymore (this is xcode).
      That's okay we can make them `long long`.

      Attachments

        Activity

          People

            billy.donahue@mongodb.com Billy Donahue
            billy.donahue@mongodb.com Billy Donahue
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: