[libcxx-commits] [PATCH] D144994: [Draft][libc++][modules] Adds std module.

Chuanqi Xu via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Sun Mar 5 18:09:26 PST 2023


ChuanqiXu added inline comments.


================
Comment at: libcxx/docs/Modules.rst:42
+   not handle that case properly.
+ * There is no `P1689 style output <https://wg21.link/P1689>`_ yet.
+ * The experimental library (read <format>) does not work as expected
----------------
Mordante wrote:
> ChuanqiXu wrote:
> > Mordante wrote:
> > > ChuanqiXu wrote:
> > > > P1689 format is supported in clang-scan-deps. What's the reason we can't make it now?
> > > We can make it, that's no problem. However that file needs the use the installation path and not the path in the build directory. So the output needs a search and replace, but I don't know yet what the proper replace value will be.
> > > 
> > > I put this item here so we don't forget about including it.
> > I still don't understand. No matter where the source files is, the output of P1689 format should be generated during the building and I think we shouldn't port them.
> Using 
> `clang-scan-deps-17  -format=p1689 -compilation-database compile_commands.json`
> The output looks like
> ```
> {
>   "revision": 0,
>   "rules": [
>     {
>       "primary-output": "CMakeFiles/std.dir/std-coroutine.cppm.o",
>       "provides": [
>         {
>           "is-interface": true,
>           "logical-name": "std:coroutine",
>           "source-path": "<build-dir>/include/c++/modules/std-coroutine.cppm"
>         }
>       ]
>     },
> ```
> Where `<build-dir>` is the place where I copied the `cppm` files to. This output seems quite useless, since it's tied to a specific machine. Do you have suggestions how to get less my-system-specific paths?
Yeah, the `<build-dir>` is tied to specific machine. But why is it a problem? From my mind, we will distribute the `*.cppm` files like the header files. Then the users' build system  will generate the `P1689` output according to the `*.cppm` files in their machine. I think the key point here is that the `P1689` output is a by-product of the building process and we (users) don't need to care about it.



Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D144994/new/

https://reviews.llvm.org/D144994



More information about the libcxx-commits mailing list