bazel icon indicating copy to clipboard operation
bazel copied to clipboard

bazel should import a new rule to have a better experience to import traditional libraries

Open xiedeacc opened this issue 1 year ago • 2 comments
trafficstars

Description of the feature request:

many traditional libraries need configure to generate some config file, then compile, then install. installed file structure is very different with source tree. this introduce header search confict, even more terrible, a bazel rule writer have to handle many case for -isystem and -iquote problem.

I suggest import a new rule like cc_library, let's named it cc_install_library temporalily, cc_install_library just contain hdrs and deps, every header file in hdrs can be imported by other cc_library use -isystem, deps just contain other cc_library's .so or .a file .

briefly: introduce a new cc_install_library rule let we can import a library just like that library installed on system

Which category does this issue belong to?

C++ Rules, Core

xiedeacc avatar Jul 31 '24 07:07 xiedeacc

I believe this rule can help bazel be the most popular build tool in c-family languages

xiedeacc avatar Jul 31 '24 07:07 xiedeacc

I acknowledge the problem. The solution needs more discussion - where do we draw the line of non-hermeticity, when should we use binaries instead of building from sources (and can this be automated?), should the libraries on the system be auto discovered.

comius avatar Aug 26 '24 09:08 comius

Thank you for contributing to the Bazel repository! This issue has been marked as stale since it has not had any activity in the last 1+ years. It will be closed in the next 90 days unless any other activity occurs. If you think this issue is still relevant and should stay open, please post any comment here and the issue will no longer be marked as stale.

github-actions[bot] avatar Oct 31 '25 01:10 github-actions[bot]