C++ Logo


Advanced search

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

From: Gabriel Dos Reis <gdr_at_[hidden]>
Date: Tue, 5 Mar 2019 01:25:43 +0000
The search path facility is there only for “convenience”, for quick-and-dirty examples: the recommended approach is to explicitly list the mapping providing the IFC for the modules. I continue to believe that is the right approach - but would love to be proven wrong.

— Gaby

> On Mar 4, 2019, at 2:51 PM, Olga Arkhipova <olgaark_at_microsoft.com> wrote:
> 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_kitware.com>
> Sent: Monday, March 4, 2019 4:21 PM
> To: Olga Arkhipova <olgaark_at_[hidden]>
> 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
> _______________________________________________
> Tooling mailing list
> Tooling_at_[hidden]
> https://nam06.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.open-std.org%2Fmailman%2Flistinfo%2Ftooling&amp;data=02%7C01%7Cgdr%40microsoft.com%7C27deb2e1983b49f8cffd08d6a104c11a%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636873439135905342&amp;sdata=nvehkT0NncXAFZNvmh0hZLUWeOTuC6ZxzcWHjfvUeXk%3D&amp;reserved=0

Received on 2019-03-05 02:25:48