[Driver] Volunteer wanted for modules support in driver for Mac, Ubuntu and Windows

There are multiple driver issues preventing users to use modules on Mac M1, Ubuntu and Windows:

These problems are environment dependent. I can’t do a lot since I don’t have these environment and I don’t like to develop without testing but only reading documents and by chats.

I feel these problems are more or less easy problems but they prevents important use for modules (import std; and clang-cl with modules). It will be pretty good if someone can take it.

BTW, if there is an interest for modules and windows, there is an important task without some works on: [C++20] [Modules] Clang does not implement strong ownership model when targeting MSVC ABI · Issue #89781 · llvm/llvm-project · GitHub

2 Likes

CC @AaronBallman @MaskRay @asb for wider visibility

1 Like

Thank you for posting about this! Hopefully we can get a bit more assistance from the community because these environment-specific bugs definitely impact our users, but are really hard to work on when you don’t have access to the environment yourself.

Tagging some folks who may be able to find some help for us:

CC @rnk @hansw2000 @compnerd as Windows-centric folks
CC @rjmccall @NoQ @adrian.prantl as Mac-centric folks

If you wouldn’t mind asking around your circles to see if we can scare up some help, that would be appreciated!

I’d be very happy to contribute, but I might need help with a few things. I have a Windows setup, and am trying to familiarise myself with the codebase.

2 Likes

I know very little of modules, but can try to help test and review things for Windows.

I’m happy to help review the changes for Windows modules support, but unfortunately, I don’t have the time to help with implement it currently. Also, since this is focused on libc++ specifically, I assume that this is the clang style modules and not trying to be fully compatible with Microsoft’s modules right?

According to user’s feedback, now clang can compile std module from MSVC. But I am not sure if it is supported by CMake @ben.boeckel

CMake only knows to search for libc++ modules with clang (or clang-cl once that is supported). See this conditional. But we can certainly teach it more.

BTW, given libstdc++ adds std module now. Maybe we can try the combination of clang + std.cc from libstdc++.

I just gave it a test. -print-file-name=libstdc++.modules.json works as expceted in my environment. -print-library-module-manifest-path doesn’t work well. But it looks like a simple issue. I’ll try to fix it.

CMake only knows to search for libc++ modules with clang

Did you (or anyone else) try to use clang (clang-cl) to find the modules json file for std module in MSSTL? Does it work? If no, could you please try to file an issue and post it here. So that volunteers on windows can solve that.

Cool, thanks. I’ll have to cook up a test for CMake with this.

Not to my knowledge. But it can be investigated once clang-cl support is available at all (currently scanning is broken due to usage of -Fo rather than -o). That is being addressed in this PR.

Out of curiosity, I heard clang are able to work under Windows, is it?

I think so (at least I feel like I’ve heard noise about such things from the fringes)? But I’m not sure how that happens in practice.

I’m looking for testers and a bit of help with my PR to get /Fo in clang-cl working with -fmodule-output—there’s one failing lit test and I’d like to get to the bottom of it.