Have Bazel rules for creating shared libraries
- Langage dominant
- C++
- Étoiles
- 18.1k
- Forks
- 3.2k
- Merge moyen
- 20 h 36 min
- PR mergées (30 j)
- 1
Description
### Describe the issue
it is possible to build shared libraries with cmake with BUILD_SHARED_LIBS=ON
AFAIK, it is not possible to create them with Bazel.
According to https://ltekieli.com/linux-shared-libraries-with-cmake-and-bazel/
it requires additional cc_shared_library rules to setup up the needed dynamic deps.
The reason why it is important to have this feature setup, it is to allow to build other projects linking with abseil that are exclusively using bazel.
For example, https://github.com/google/tcmalloc is such project.
It currently statically links with abseil. This makes it impossible to build tcmalloc as a shared library and use the resulting so lib file in a project also linking with cmake generated Abseil libraries without breaking the ODR rule.
Being able to build Abseil shared libraries within Bazel is a prerequisite to be able to build tcmalloc shared libraries that can be used with projects already dynamically linking with Abseil.
### Steps to reproduce the problem
there is no cc_shared_library rules in abseil BUILD files or if it is possible to create shared libraries, it is not well documented.
I could not find anything on the topic.
### What version of Abseil are you using?
20240722 LTS
### What operating system and version are you using?
ArchLinux kernel 6.10.4
### What compiler and version are you using?
gcc version 14.2.1 20240805 (GCC)
### What build system are you using?
bazel 7.2.1
### Additional context
_No response_
Guide de contribution
Ouvrir le guide de contribution
Piste de recherche
Examinez les fichiers BUILD existants pour comprendre les règles cc_library actuelles. Recherchez le fonctionnement de cc_shared_library dans Bazel et examinez l’article de blog lié pour vous orienter. L’objectif est d’ajouter des règles qui produisent des bibliothèques partagées compatibles avec des projets comme tcmalloc, en veillant à ce qu’elles ne provoquent pas de violation de l’ODR lorsqu’elles sont utilisées avec Abseil compilé avec CMake.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- cpp
- Domaine
- build-system
- Type d'issue
- Fonctionnalité
- Difficulté
- 4/5
- Temps estimé
- 3-5 jours
- Activité
- À l'abandon
- Clarté
- Plutôt claire
- Accessibilité débutants
- 30/100