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

Fix Ninja builds on Windows Enterprise Server

    • Type: Icon: Improvement Improvement
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 4.9.0, 4.4.7
    • Affects Version/s: 4.5 Required
    • Component/s: Build
    • Labels:
      None
    • Fully Compatible
    • v4.4
    • Dev Platform 2020-11-16, Dev Platform 2020-11-30

      Windows builds of the Enterprise Server consistently fail to build with Ninja due to a rsp file with too many characters in it for the VC++ linker. This is the error produced:

      FAILED: build/debug/mongo/mongod.exe 
      link @build\debug\mongo\mongod.exe.rsp
      Microsoft (R) Incremental Linker Version 14.26.28806.0
      Copyright (C) Microsoft Corporation.  All rights reserved.
      
      build\debug\mongo\mongod.exe.rsp : fatal error LNK1170: line in command file contains 131071 or more characters
      ninja: build stopped: subcommand failed.
      

      This is the SCons command I used to generate the Ninja build file:

      python.exe buildscripts\scons.py `
        --dbg=on --ssl --opt=off --link-model=object --win-version-min=ws2016 `
        CPPPATH="Z:/workspace/libs/snmp/include Z:/workspace/libs/sasl/include Z:/workspace/libs/openssl/include" `
        LIBPATH="Z:/workspace/libs/snmp/lib Z:/workspace/libs/sasl/lib Z:/workspace/libs/openssl/lib" `
        MONGO_GIT_HASH="unknown" MONGO_VERSION="0.0.0" -j8 --ninja=next generate-ninja
      

      And this is the Ninja invocation I used:

      ninja archive-dist
      

      I did not test this without the enterprise module in place, so it may not be a problem there. SCons builds work perfectly fine.

        1. mongod.exe.rsp
          165 kB
          Ryan Egesdahl

            Assignee:
            daniel.moody@mongodb.com Daniel Moody
            Reporter:
            ryan.egesdahl@mongodb.com Ryan Egesdahl (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: