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

Chuanqi Xu via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Mon Mar 6 00:23:13 PST 2023


ChuanqiXu added a comment.

About distributing the std modules, this is what we do in the downstream:

  # std-module.spec
  
  ...
  
  Requires: clang_xxx # for example clang17
  
  %prep
  %build
  %install
  
  mkdir -p <path-to-the-install-destination-of-std-module>
  cp `.cppm` files to  <path-to-the-install-destination-of-std-module>
  cp ../../../build.sh <path-to-the-install-destination-of-std-module>
  
  ...
  
  %post
  <path-to-the-install-destination-of-std-module>/build.sh

The commands line after `%post`  will execute the corresponding instructions when the user input `yum install std-modules` and the build.sh contains the instructions to compile the std modules.

Then in our downstream, we will hardcode the `<path-to-the-install-destination-of-std-module>` to the compiler to lookup the `.pcm` files and linking libraries. Hope the sharing helps.

---

>From my understanding, we can't do the above things easily in the open-source community like LLVM. There should be some more discussing about this. So I suggest that the current patch shouldn't care about installation and distribution. It will be good enough if we have an available std module which pass the tests. Then we can discuss about the installation and distribution step by step.


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