C++ Logo

sg15

Advanced search

Re: [Tooling] Dependency information for module-aware build tools

From: Olga Arkhipova <olgaark_at_[hidden]>
Date: Tue, 5 Mar 2019 00:51:41 +0000
MSVC only assumes module BMI (ifc) name to match the module name when searching on the module search path (/module:searchpath). If the modules are specified explicitly (via /module:reference) , they supposed to be specified with the module name if it is different from the ifc name (i.e. VS build will have to always do it)

So if the imported module has not been built yet, the compiler will not be able to provide the mapping between this module name and its BMI. I see that it might be useful to get the info for the modules found on the search path, but I think module name this source implements should have a special entry.

I'd also propose to add the source file name so one json can contain info for many files.

{
  "version": 1, // The file format version

  "sources": [
    "MyModule.ixx" : {
      "module_name": "MyModuleName", // the name of the module this file defines
      "imports": [ // Modules names required by this file
        "ModuleA",
        "ModuleB",
        "ModuleC"
      ],
      "module_bmi": "Debug\\MyModuleBMI.ifc", // the name of the built module file
      "obj": "Debug\\MyModule.obj",
      "includes": [ // Preprocessor dependency files
        "../MyClass1.h",
        "/usr/include/stdc-predef.h"
      ]
    }
  ]
}



-----Original Message-----
From: Ben Boeckel <ben.boeckel_at_[hidden]>
Sent: Monday, March 4, 2019 4:21 PM
To: Olga Arkhipova <olgaark_at_microsoft.com>
Cc: WG21 Tooling Study Group SG15 <tooling_at_open-std.org>; modules_at_lists.isocpp.org; brad.king_at_kitware.com
Subject: Re: [Tooling] Dependency information for module-aware build tools

On Tue, Mar 05, 2019 at 00:11:39 +0000, Olga Arkhipova wrote:
> Why did you choose to have
> "logical-provides": { // Mapping of module names provided
> "I": "I.gcm" // to provided BMI files.
>
> instead of just module name which this source exports?

Because on the `requires` side, you don't know the name of the file which will be providing the module. Well, at least GCC doesn't assumeā€¦ If MSVC is going to assume, the requires/logical-provides mapping could be short-circuited and `requires` just list BMI filenames (assuming they match the filename output in the relevant `provides` side).

--Ben

Received on 2019-03-05 01:51:47