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

Fix useless compiler tools checks

    • Type: Icon: Improvement Improvement
    • Resolution: Works as Designed
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 4.5 Desired
    • Component/s: Build
    • Labels:
      None
    • Server Development Platform

      In both etc/scons/mongodbtoolchain_v3_gcc.vars and etc/scons/mongodbtoolchain_v3_clang.vars, we test that the toolchain is complete using the following:

      AR = subprocess.check_output([CXX, '-print-prog-name=ar']).decode('utf-8').strip()
      AS = subprocess.check_output([CXX, '-print-prog-name=as']).decode('utf-8').strip()
      OBJCOPY = subprocess.check_output([CXX, '-print-prog-name=objcopy']).decode('utf-8').strip()
      

      Ostensibly, this check makes sure the compiler toolchain is valid. However, there are two problems with this approach:

      1. We already do it when we test compile simple programs, so it's not really needed.
      2. It's not actually a valid test because:
        1. We're using piped builds and the toolchains determine what to execute at build time.
        2. We never set these variables in the environment to ensure what we tested is what we actually use during build.
        3. It's possible to override the tool that gets used regardless of what we test.

      As they exist now, these tests are confusing because they declare something that isn't actually true. In especially the case of clang, it will use llvm-as on systems that support it, and we only ever test as. We should either remove the tests entirely or, if we still need them for some reason, update them to be accurate with respect to the actual build that will occur.

            Assignee:
            backlog-server-devplatform [DO NOT ASSIGN] Backlog - Server Development Platform Team (SDP) (Inactive)
            Reporter:
            ryan.egesdahl@mongodb.com Ryan Egesdahl (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: