Stop shipping individual component libraries in clang-lib package
Summary
Remove the individual component libraries (e.g. libclangBasic.so, libclangAST.so) from the clang-lib package. Packages that depend on the clang libraries should instead link against libclang-cpp.so.
Owner
- Name: Tom Stellard
- Email: <tstellar@redhat.com>
Current status
- Targeted release: Fedora 32
- Last updated: 2019-12-12
- Tracker bug: <will be assigned by the Wrangler>
- Release notes tracker: <will be assigned by the Wrangler>
Detailed Description
The individual component libraries will be removed from the clang-lib package in favor of libclang-cpp.so (which is already present in clang-libs). The component shared libraries enabled by the BUILD_SHARED=ON CMake option is not supported as a distribution configuration by the upstream project and only recommended for use by clang developers[1]
The libclang-cpp.so shared object was added in clang 9.0 and now gives us an alternative shared library option that is supported by the upstream project, which allows us to stop using the component libraries.
[1] https://llvm.org/docs/CMake.html
Benefit to Fedora
Many build systems default to using /usr/bin/cc and /usr/bin/c++ as the default C/C++ compilers. Being able to easily swap out these implementation will provide a lot of flexibility within Fedora for doing things like:
- Setting up alternative buildroots for testing.
- Installing a gcc wrapper script to /usr/bin/cc to help migrate packages to new compiler flags or to capture statistics about compiler usage.
- Letting users experiment easily with alternate compilers.
- Easily switch between system gcc and a development version of gcc.
Scope
- Proposal owners: The proposal owner will implement the necessary changes in the gcc and clang packages.
- Other developers: The gcc maintainers will be responsible for reviewing and approving changes to the gcc package.
- Release engineering: #Releng issue number (a check of an impact with Release Engineering is needed)
- Policies and guidelines: No policies or guidelines will need to be updated as a result of this change.
- Trademark approval: N/A (not needed for this Change)
Upgrade/compatibility impact
This change should not impact upgradeability.
How To Test
CI tests will be added to the gcc package to ensure that /usr/bin/cc and /usr/bin/c++ still point to /usr/bin/gcc and /usr/bin/g++ when installed. There will also be a CI test added to the clang package to ensure that /usr/bin/gcc and /usr/bin/g++ remain the default when clang is installed.
User Experience
This change will give users a much better way to experiment using other compilers for their own development. They will be able to easily switch between different compilers without having to modify their projects build system or make non-standard changes to their Fedora system.
Dependencies
This change has no other dependencies besides the changes to the gcc and clang packages.
Contingency Plan
- Contingency mechanism: (What to do? Who will do it?) Proposal Owner will revert changes made to gcc and clang packages and rebuild.
- Contingency deadline: If the changes are not complete by 2 weeks before the mass rebuild, then we will consider postponing to the next Fedora release and back out any changes that were made.
- Blocks release? No
- Blocks product? None
Documentation
Release notes will be added for this change.
Release Notes
The user /usr/bin/cc and /usr/bin/c++ symlinks are now managed by update-alternatives. If you would like to change these symlinks to point to another compiler, like clang, for example, you can use these commands:
update-alternatives --set cc /usr/bin/clang
update-alternatives --set c++ /usr/bin/clang++