We are in 2020 now and C++20 is coming, along with the long-awaited C++ modules feature. But after watching a few talks on CppCon I find C++ modules are in a weird place, especially for Linux package managers (pacman, apt, emerge, etc...)
From what I have learned, C++ modules are
- Compiler dependent
- You can't use a module built by GCC in Clang
- GCC 9.1 modules won't work on GCC 9.2
- You can have many different versions of the same module
- As long as they are not exported into the same scope
- You need to rebuild a module if its dependencies update
My problem is, in all rolling-release distros compilers get updated all the time and the user might have their own compiler build. Currently one can just update the compiler or also update libstdc++
. But with modules, it seems to suggest libstdc++
has to be updated when the compiler updates.
How would the package manager handle updating, for example, the STL when the compiler updates? I don't think building every version of the STL module for every version of the compiler is feasible. Nor is the user having to build their own STL module a good idea.