[SERVER-46673] The new ninja generator does not build the 'vcxproj' target Created: 06/Mar/20 Updated: 28/Aug/23 Resolved: 28/Aug/23 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Build |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Kaloian Manassiev | Assignee: | [DO NOT ASSIGN] Backlog - Server Development Platform Team (SDP) (Inactive) |
| Resolution: | Won't Fix | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Assigned Teams: |
Server Development Platform
|
| Operating System: | ALL |
| Sprint: | Dev Platform 2020-04-20, Dev Platform 2020-05-04 |
| Participants: |
| Description |
|
The vscproj SCons target is what produces a Visual Studio project and is very handy for people who develop on Windows, with VS. With the old ninja generator I could just run ninja vcxproj and get a VS project, but the new ninja generator doesn't seem to produce one:
It should be on the same parity as compiledb. |
| Comments |
| Comment by Kaloian Manassiev [ 06/May/20 ] | |||||||||||||||||||||||||||||||||||||||||||||
|
OK, this sounds good to me. I have a workaround, so I am good. Thanks for looking into it! | |||||||||||||||||||||||||||||||||||||||||||||
| Comment by Andrew Morrow (Inactive) [ 06/May/20 ] | |||||||||||||||||||||||||||||||||||||||||||||
|
I see what is going on. With the old Ninja Module, the generated build.ninja reached out to SCons to build the compile_commands.json which it knew was a dependency of mongodb.vcxproj, and which it knew how to build as a command by running make_vcxproj.py. However, in the new Ninja Generator world, the production of compile_commands.json has been entirely delegated to Ninja. So there is no way in the SCons declarations to express that mongodb.vcxproj depends on this entity that only exists in the Ninja world. It isn't really clear how to address that. For now, since there is a workaround, I'm going to move this ticket into our general queue of build system improvements. I don't think it blocks rolling out hygienic builds to developers. | |||||||||||||||||||||||||||||||||||||||||||||
| Comment by Kaloian Manassiev [ 06/May/20 ] | |||||||||||||||||||||||||||||||||||||||||||||
|
I am not sure what you mean "how it worked with the old ninja module"? Are you asking how it was implemented (because I don't know) or what was the command? For the latter, I could (and I just checked that I still can) just run "ninja vcxproj" and I ended up with a mongod.vcxproj file:
Thanks for the workaround - I actually was just running the vcxproj target with scons.py directly, so I am not blocked. | |||||||||||||||||||||||||||||||||||||||||||||
| Comment by Andrew Morrow (Inactive) [ 23/Apr/20 ] | |||||||||||||||||||||||||||||||||||||||||||||
|
kaloian.manassiev - Could you clarify for me how this worked with the old ninja module? From what I can see, the make_vcxproj.py script requires the presence of a compile_commands.json file in order to run. In pure SCons, this is fine, because we can specify that compile_commands.json is an input to the command that will run make_vcxproj.py. But if that is true, then I would expect that with the old Ninja module, either: 1) Running ninja vcxproj in a clean repo where build.ninja was just generated would fail, because there would be no compile_commands.json available, OR Could you please try it with the old module and let me know which happens? I think it is going to be difficult to make this work seamlessly. For most things, SCons level dependency edges get mapped into Ninja level dependency edges. But the compilation database is handled differently: since Ninja can generate it directly, the SCons level compiledb generation is disabled. In order to map the vcxproj target into Ninja, we would need some way to express, up at the SCons layer, that vcxproj should, when mapped down to Ninja, depend on the Ninja generators version of producing the compilation database. I'm not sure how possible that is. For now, while we investigate this, please note that there is a simple workaround: generate compile_commands.json via any mechanism, and then just manually invoke buildscripts/make_vcxproj.y --version 14.2 mongod, rather than asking the build system to do it for you. |