- 
    Type:
Bug
 - 
    Resolution: Fixed
 - 
    Priority:
Major - P3
 - 
    Affects Version/s: None
 - 
    Component/s: None
 - 
    None
 
- 
        Fully Compatible
 - 
        ALL
 - 
        Dev Platform 2020-01-27
 - 
        None
 
- 
        None
 - 
        None
 - 
        None
 - 
        None
 - 
        None
 - 
        None
 
Repro steps:
python3 ./buildscripts/scons.py \ --dbg --variables-files=etc/scons/xcode_macosx.vars \ --modules= \ --ninja new.build.ninja ninja -f ./new.build.jinja compiledb
Expected: No lines have file:<path_to_compiler>.
Actual:
Some lines look like the following:
    "file": "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++",
Mat and I looked into this. It seems related to the ordering of dependencies. E.g. in the new.build.ninja file, we see:
    build build/debug/mongo/dbtests/catalogtests.o: CMD_W_DEPS | src/mongo/dbtests/catalogtests.cpp $
        /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ $
        /Users/rtimmons/mongodb/mongo/new.build.ninja || _generated_sources
      cmd = PATH=/usr/local/bin:/opt/bin:/bin:/usr/bin $
for a target that has the correct "file" attribute and
build build/debug/mongo/dbtests/basictests.o: CMD_W_DEPS | $
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ $
    src/mongo/dbtests/basictests.cpp /Users/rtimmons/mongodb/mongo/new.build.ninja || $
for a target that does not.
It seems like the ordering of dependencies may vary run over run (python sets are hash-based) so sometimes the order of clang++ and {{.cpp} files changes.
Scons gets the compiledb right fwiw:
    python3 ./buildscripts/scons.py \
      --dbg --variables-files=etc/scons/xcode_macosx.vars \
      --modules= \
      compiledb