Skip to content
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

Add a testcase to ensure that include paths are consistent #23064

Conversation

FaBrand
Copy link
Contributor

@FaBrand FaBrand commented Jul 22, 2024

So far only the generated header in the virtual includes is tested but the Include path pointing to that directory isnt

This is a testcase to reproduce the suspected error reported here:

Assuming that the location of the file is asserted:

    assertThat(artifactsToStrings(ccInfo.getCcCompilationContext().getDirectPublicHdrs()))
        .contains("bin third_party/bar/_virtual_includes/starlark_lib_suffix/starlark_lib.h");

Adding a testcase for the include path seems reasonable.

A local run of the testcase shows the error:

1) testStripIncludePrefixIncludePath(com.google.devtools.build.lib.rules.cpp.StarlarkCcCommonTest)
value of: getIncludeDirs().onlyElement()
expected: bazel-out/k8-fastbuild/bin/third_party/bar/_virtual_includes/starlark_lib_suffix
but was : bazel-out/k8-fastbuild/bin/third_party/bar/_virtual_includes/starlark_lib
        at com.google.devtools.build.lib.rules.cpp.StarlarkCcCommonTest.testStripIncludePrefixIncludePath(StarlarkCcCommonTest.java:5902)

FAILURES!!!
Tests run: 73,  Failures: 1

The change in behaviour was introduced in 7e0df68#diff-403c46ec3075b8e9e6d490ce955db88dae2d457b8046608884039b18b10ab6ccR774

So far only the generated header in the virtual includes is tested
but the Include path pointing to that directory isnt
@FaBrand FaBrand requested a review from oquenchil as a code owner July 22, 2024 14:43
@github-actions github-actions bot added team-Rules-CPP Issues for C++ rules awaiting-review PR is awaiting review from an assigned reviewer labels Jul 22, 2024
@FaBrand
Copy link
Contributor Author

FaBrand commented Jul 23, 2024

Resolved with #23071

@FaBrand FaBrand closed this Jul 23, 2024
@FaBrand FaBrand deleted the strip-include-prefix-starlark-api-ignoring-name-attribute branch July 23, 2024 12:25
@github-actions github-actions bot removed the awaiting-review PR is awaiting review from an assigned reviewer label Jul 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
team-Rules-CPP Issues for C++ rules
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant