bazel-contrib / bazel-contrib/rules_foreign_cc

cmake copy wrong files to folder EXT_BUILD_DEPS

Open
#1,205 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Starlark
Stars
737
Forks
270
PR merge metrics
No merged PRs in 30d

Description

I'm using the cmake tool to build my cmake project with bazel.

one of my deps is glog/0.5.0

I find rules_foreign_cc copy all .h files of glog to folder EXT_BUILD_DEPS/include.

As we can see the glog project https://github.com/google/glog/blob/v0.5.0/bazel/glog.bzl#L140-L147

we only need EXT_BUILD_DEPS/include/glog/xxx.h

But actually, we get all headers even it declare in the filed `srcs`, like `EXT_BUILD_DEPS/include/demangle.h`, it's `src/demangle.h` in glog, declare in https://github.com/google/glog/blob/v0.5.0/bazel/glog.bzl#L120

This caused some conflicts in our header files.

Is this behavior expected, or are there ways we can avoid unnecessary copies?

Contributor guide

Open the contributing guide

Research direction

Start by reviewing the glog/0.5.0 references in bazel/glog.bzl, especially the srcs and public header entries cited in the issue. Reproduce the build and inspect which files are copied into EXT_BUILD_DEPS/include. Done means confirming whether private headers such as demangle.h are copied unnecessarily and documenting or testing the expected behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
cmake
Domain
build-system
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.