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
2 changes: 1 addition & 1 deletion devicetree/private/devicetree_library.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ devicetree_library = rule(
providers = [DevicetreeLibraryInfo],
),
"hdrs": attr.label_list(
allow_files = True,
allow_files = [".h", ".dtsi", ".dts", ".dtso"],
doc = """List of exported included files (`.h`, `.dtsi`).

These files are visible to all targets that transitively depend
Expand Down
4 changes: 2 additions & 2 deletions devicetree/private/dtb.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ dtb = rule(
[`devicetree_library()`](devicetree_library.md#devicetree_library)
and add them to [`deps`](#dtb-deps).
""",
allow_files = True,
allow_files = [".dts", ".dtsi", ".h"],
),
},
toolchains = [
Expand Down Expand Up @@ -452,7 +452,7 @@ dtbo = rule(
[`devicetree_library()`](devicetree_library.md#devicetree_library)
and add them to [`deps`](#dtb-deps).
""",
allow_files = True,
allow_files = [".dtso", ".dtsi", ".h"],
),
},
toolchains = [
Expand Down
4 changes: 2 additions & 2 deletions devicetree/private/dtb_composite.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ dtb_composite = rule(
doc = "Builds a composite dtb by applying overlays on a base dtb.",
attrs = {
"base": attr.label(
allow_single_file = True,
allow_single_file = [".dtb"],
doc = """Base `.dtb` to apply overlays on.

This usually comes from a `dtb()` target with
Expand All @@ -74,7 +74,7 @@ dtb_composite = rule(
Default is `name + ".dtb"` if missing extension, otherwise `name`.""",
),
"overlays": attr.label_list(
allow_files = True,
allow_files = [".dtbo"],
doc = "List of `.dtbo` overlays to apply.",
),
},
Expand Down
35 changes: 35 additions & 0 deletions e2e/smoke/include_test/srcs_include_test/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Copyright (C) 2026 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

"""Test that `.dtsi` and `.h` files may be listed directly in `srcs`."""

load("@bazel_skylib//rules:build_test.bzl", "build_test")
load("@rules_devicetree//devicetree:dtb.bzl", "dtb")

dtb(
name = "srcs_include",
srcs = [
"srcs_include.dts",
"sub/dt-bindings.h",
"sub/srcs_include.dtsi",
],
)

build_test(
name = "srcs_include_test",
targets = [
# keep sorted
":srcs_include",
],
)
7 changes: 7 additions & 0 deletions e2e/smoke/include_test/srcs_include_test/srcs_include.dts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/dts-v1/;

#include "sub/dt-bindings.h"
#include "sub/srcs_include.dtsi"

/ {
};
1 change: 1 addition & 0 deletions e2e/smoke/include_test/srcs_include_test/sub/dt-bindings.h
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#define SRCS_INCLUDE_VALUE 1
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/ {
srcs-include-value = <SRCS_INCLUDE_VALUE>;
};
Loading