-
Notifications
You must be signed in to change notification settings - Fork 0
Use includes
instead of system_includes
for includes
attr
#4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1062,7 +1062,7 @@ def _package_source_root(repository, package, sibling_repository_layout): | |
repository = repository[1:] | ||
return paths.get_relative(paths.get_relative("external", repository), package) | ||
|
||
def _system_include_dirs(ctx, additional_make_variable_substitutions): | ||
def _include_dirs(ctx, additional_make_variable_substitutions): | ||
result = [] | ||
sibling_repository_layout = ctx.configuration.is_sibling_repository_layout() | ||
package = ctx.label.package | ||
|
@@ -1264,7 +1264,8 @@ cc_helper = struct( | |
get_private_hdrs = _get_private_hdrs, | ||
get_public_hdrs = _get_public_hdrs, | ||
report_invalid_options = _report_invalid_options, | ||
system_include_dirs = _system_include_dirs, | ||
include_dirs = _include_dirs, | ||
system_include_dirs = _include_dirs, # TODO: Remove uses of old name | ||
Comment on lines
+1267
to
+1268
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💡 Verification agent 🧩 Analysis chainUpdated struct to reference the renamed function Both The TODO comment indicates the 🏁 Script executed: #!/bin/bash
# Search for usages of system_include_dirs to identify code that needs to be updated
rg "system_include_dirs" --type bzl Length of output: 63 🏁 Script executed: #!/bin/bash
# Search for any usage of system_include_dirs in .bzl files
rg "system_include_dirs" -n --color never -g '*.bzl' Length of output: 1324 Track and plan removal of
No immediate code changes required—just open an issue to consolidate and schedule the refactor. |
||
get_coverage_environment = _get_coverage_environment, | ||
create_cc_instrumented_files_info = _create_cc_instrumented_files_info, | ||
linkopts = _linkopts, | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1196,18 +1196,12 @@ public void testIncludePathOrder() throws Exception { | |
assertContainsSublist( | ||
action.getCompilerOptions(), | ||
ImmutableList.of( | ||
"-isystem", | ||
"foo/foo", | ||
"-isystem", | ||
genfilesDir + "/foo/foo", | ||
"-isystem", | ||
binDir + "/foo/foo", | ||
"-isystem", | ||
"foo/bar", | ||
"-isystem", | ||
genfilesDir + "/foo/bar", | ||
"-isystem", | ||
binDir + "/foo/bar")); | ||
"-Ifoo/foo", | ||
"-I" + genfilesDir + "/foo/foo", | ||
"-I" + binDir + "/foo/foo", | ||
"-Ifoo/bar", | ||
"-I" + genfilesDir + "/foo/bar", | ||
"-I" + binDir + "/foo/bar")); | ||
} | ||
|
||
@Test | ||
|
@@ -1911,22 +1905,24 @@ public void testImplementationDepsCompilationContextIsNotPropagated() throws Exc | |
assertThat(artifactsToStrings(libCompilationContext.getDeclaredIncludeSrcs())) | ||
.doesNotContain("src foo/implementation_dep.h"); | ||
|
||
assertThat(pathfragmentsToStrings(libCompilationContext.getSystemIncludeDirs())) | ||
assertThat(pathfragmentsToStrings(libCompilationContext.getIncludeDirs())) | ||
.contains("foo/public_dep"); | ||
assertThat(pathfragmentsToStrings(libCompilationContext.getSystemIncludeDirs())) | ||
assertThat(pathfragmentsToStrings(libCompilationContext.getIncludeDirs())) | ||
.contains("foo/interface_dep"); | ||
assertThat(pathfragmentsToStrings(libCompilationContext.getIncludeDirs())) | ||
.doesNotContain("foo/implementation_dep"); | ||
assertThat(pathfragmentsToStrings(libCompilationContext.getSystemIncludeDirs())) | ||
.doesNotContain("foo/implementation_dep"); | ||
Comment on lines
+1913
to
1915
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
|
||
CcCompilationContext publicDepCompilationContext = | ||
getCppCompileAction("//foo:public_dep").getCcCompilationContext(); | ||
assertThat(artifactsToStrings(publicDepCompilationContext.getDeclaredIncludeSrcs())) | ||
.contains("src foo/interface_dep.h"); | ||
assertThat(pathfragmentsToStrings(publicDepCompilationContext.getSystemIncludeDirs())) | ||
assertThat(pathfragmentsToStrings(publicDepCompilationContext.getIncludeDirs())) | ||
.contains("foo/interface_dep"); | ||
assertThat(artifactsToStrings(publicDepCompilationContext.getDeclaredIncludeSrcs())) | ||
.contains("src foo/implementation_dep.h"); | ||
assertThat(pathfragmentsToStrings(publicDepCompilationContext.getSystemIncludeDirs())) | ||
assertThat(pathfragmentsToStrings(publicDepCompilationContext.getIncludeDirs())) | ||
.contains("foo/implementation_dep"); | ||
} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a
TODO
comment here to remove the old namesystem_include_dirs
. It's important to address this in a timely manner to avoid confusion and maintain code clarity. Should we create a follow-up issue or task to track the removal of this deprecated name?