microsoft / microsoft/cppwinrt

Bug: Why CppWinRTModuleInclude not auto include the dependencies of include modules

Open
#1,602 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
1.9k
Forks
281
PR merge metrics
No merged PRs in 30d

Description

Version

3.0.260520.1

Summary

When we use CppWinRTModuleInclude, we expect that we can write the module which we need so that we do not need to generate everything. But when we add it, we will find that it is useless because it indeed only generates the module we write but not consider the dependencies which the module referenced. So that we need to write all dependencies manually. But the dependencies of dependencies of dependencies will be almost all namespace to include. We are almost unable to find out all the dependencies.

Reproducible example

Add

<CppWinRTModuleInclude>
  Windows.Foundation
</CppWinRTModuleInclude>

Then try to fix the dependencies. Do not say use CppWinRTModuleExclude, we need use all the member under Windows.Foundation and do not want to know what they dependence.

Expected behavior

C++/WinRT should add all used module.

Actual behavior

C++/WinRT only add Windows.Foundation.

Additional comments

I don't think it is a feature. Or the C++/WinRT should include all Windows.* modules just like C#/WinRT so that when we add third part CppWinRTModuleInclude it can correctly reference the Windows.* modules.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the implementation of the CppWinRTModuleInclude option and the module dependency-generation path. Reproduce the issue with Windows.Foundation and inspect how referenced modules are resolved. Done means the generated output includes all modules used by Windows.Foundation and its dependencies without requiring each namespace to be listed manually.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.