Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/odb/src/3dblox/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ cc_library(
"*.h",
]),
hdrs = ["//src/odb:include/odb/3dblox.h"],
includes = [
"../../include",
],
Comment on lines +18 to +20
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Using includes with relative paths like ../../include is a maintainability risk and is generally discouraged for internal Bazel libraries. This attribute propagates transitively to all dependents, which can lead to "include path pollution" and potential header name collisions in dependent targets.

Recommendation:
Instead of adding includes to every sub-library, consider defining a central cc_library in the package where the headers reside (e.g., src/odb/BUILD) that exports these headers using strip_include_prefix = "include". Sub-libraries can then simply depend on this central target. This approach is more idiomatic, centralizes include path management, and avoids duplicating relative paths across multiple BUILD files.

This observation applies to all the BUILD files modified in this pull request.

deps = [
"//src/odb/src/db",
"//src/odb/src/defin",
Expand Down
3 changes: 3 additions & 0 deletions src/odb/src/cdl/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ cc_library(
name = "cdl",
srcs = glob(["*.cpp"]),
hdrs = ["//src/odb:include/odb/cdl.h"],
includes = [
"../../include",
],
deps = [
"//src/odb/src/db",
"//src/utl",
Expand Down
3 changes: 3 additions & 0 deletions src/odb/src/defin/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ cc_library(
"*.h",
]),
hdrs = ["//src/odb:include/odb/defin.h"],
includes = [
"../../include",
],
deps = [
"//src/odb/src/db",
"//src/odb/src/def",
Expand Down
3 changes: 3 additions & 0 deletions src/odb/src/defout/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ cc_library(
"*.h",
]),
hdrs = ["//src/odb:include/odb/defout.h"],
includes = [
"../../include",
],
deps = [
"//src/odb/src/db",
"//src/utl",
Expand Down
3 changes: 3 additions & 0 deletions src/odb/src/gdsin/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ cc_library(
"//src/odb:include/odb/gdsUtil.h",
"//src/odb:include/odb/gdsin.h",
],
includes = [
"../../include",
],
deps = [
"//src/odb/src/db",
"//src/utl",
Expand Down
3 changes: 3 additions & 0 deletions src/odb/src/gdsout/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ cc_library(
name = "gdsout",
srcs = glob(["*.cpp"]),
hdrs = ["//src/odb:include/odb/gdsout.h"],
includes = [
"../../include",
],
deps = [
"//src/odb/src/db",
"//src/odb/src/gdsin", # for gdsUtil.h
Expand Down
3 changes: 3 additions & 0 deletions src/odb/src/lefin/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ cc_library(
"*.h",
]),
hdrs = ["//src/odb:include/odb/lefin.h"],
includes = [
"../../include",
],
deps = [
"//src/odb/src/db",
"//src/odb/src/lef",
Expand Down
3 changes: 3 additions & 0 deletions src/odb/src/lefout/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ cc_library(
name = "lefout",
srcs = glob(["*.cpp"]),
hdrs = ["//src/odb:include/odb/lefout.h"],
includes = [
"../../include",
],
deps = [
"//src/odb/src/db",
"//src/utl",
Expand Down
Loading