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

GH-36379: [C++] Bundled dependency include paths should override system include dirs #37612

Merged
merged 2 commits into from
Sep 8, 2023

Conversation

bkietz
Copy link
Member

@bkietz bkietz commented Sep 7, 2023

Rationale for this change

Bundled dependencies' include directories should override system include dirs. Otherwise an incompatible header in the system might be included when we wanted a header from the bundled dependency.

What changes are included in this PR?

bundled dependencies explicitly insert their own include dirs ahead of others

@github-actions
Copy link

github-actions bot commented Sep 7, 2023

⚠️ GitHub issue #36379 has been automatically assigned in GitHub to PR creator.

@github-actions github-actions bot added awaiting changes Awaiting changes and removed awaiting committer review Awaiting committer review labels Sep 7, 2023
@pitrou pitrou changed the title GH-36379: [C++] Bundled dependency include paths should override GH-36379: [C++] Bundled dependency include paths should override system include dirs Sep 7, 2023
@pitrou
Copy link
Member

pitrou commented Sep 7, 2023

@github-actions crossbow submit -g cpp

@github-actions
Copy link

github-actions bot commented Sep 7, 2023

Revision: 7073a98

Submitted crossbow builds: ursacomputing/crossbow @ actions-1750e0d372

Task Status
test-alpine-linux-cpp Github Actions
test-build-cpp-fuzz Github Actions
test-conda-cpp Github Actions
test-conda-cpp-valgrind Azure
test-cuda-cpp Github Actions
test-debian-11-cpp-amd64 Github Actions
test-debian-11-cpp-i386 Github Actions
test-fedora-35-cpp Github Actions
test-ubuntu-20.04-cpp Github Actions
test-ubuntu-20.04-cpp-bundled Github Actions
test-ubuntu-20.04-cpp-minimal-with-formats Github Actions
test-ubuntu-20.04-cpp-thread-sanitizer Github Actions
test-ubuntu-22.04-cpp Github Actions
test-ubuntu-22.04-cpp-20 Github Actions
test-ubuntu-22.04-cpp-no-threading Github Actions

Copy link
Member

@kou kou left a comment

Choose a reason for hiding this comment

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

+1

We need to run cmake-format before we merge this.

cpp/cmake_modules/ThirdpartyToolchain.cmake Outdated Show resolved Hide resolved
@github-actions github-actions bot added awaiting merge Awaiting merge and removed awaiting changes Awaiting changes labels Sep 8, 2023
Copy link
Member

@assignUser assignUser left a comment

Choose a reason for hiding this comment

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

This change makes sense imo, a more involved (and brittle) alternative might be to move gtest to the front in target_link_libraries calls. I tried to reproduce the error but failed, where you able to test the fix with the error locally @bkietz ?

@pitrou
Copy link
Member

pitrou commented Sep 8, 2023

Should we try to revert #37483 in this PR?

@kou
Copy link
Member

kou commented Sep 8, 2023

Should we try to revert #37483 in this PR?

Is it just for confirming whether this fixes the #36379 problem or not? Do we re-revert #37483 after we confirm it?

#37483 is needed to fix #37067. So we should not revert #37483 from main.

@pitrou
Copy link
Member

pitrou commented Sep 8, 2023

Ah, I thought the two approaches were alternatives. If not then nevermind.

@bkietz
Copy link
Member Author

bkietz commented Sep 8, 2023

FetchContent_MakeAvailable automatically adds include directories and (at least while I was testing this) seems to prepend the -I flags by default. If I'm correct, then #37483 actually resolved this issue for bundled GTest (but the other bundled dependencies are still vulnerable).

@kou
Copy link
Member

kou commented Sep 8, 2023

the other bundled dependencies are still vulnerable

I think so too.
So we need both of #37483 and this.

I merge this.

@kou kou merged commit 44811ba into apache:main Sep 8, 2023
30 checks passed
@kou kou removed the awaiting merge Awaiting merge label Sep 8, 2023
@conbench-apache-arrow
Copy link

After merging your PR, Conbench analyzed the 6 benchmarking runs that have been run so far on merge-commit 44811ba.

There were 5 benchmark results indicating a performance regression:

The full Conbench report has more details. It also includes information about possible false positives for unstable benchmarks that are known to sometimes produce them.

loicalleyne pushed a commit to loicalleyne/arrow that referenced this pull request Nov 13, 2023
…e system include dirs (apache#37612)

### Rationale for this change

Bundled dependencies' include directories should override system include dirs. Otherwise an incompatible header in the system might be included when we wanted a header from the bundled dependency.

### What changes are included in this PR?

bundled dependencies explicitly insert their own include dirs ahead of others
* Closes: apache#36379

Authored-by: Benjamin Kietzman <[email protected]>
Signed-off-by: Sutou Kouhei <[email protected]>
dgreiss pushed a commit to dgreiss/arrow that referenced this pull request Feb 19, 2024
…e system include dirs (apache#37612)

### Rationale for this change

Bundled dependencies' include directories should override system include dirs. Otherwise an incompatible header in the system might be included when we wanted a header from the bundled dependency.

### What changes are included in this PR?

bundled dependencies explicitly insert their own include dirs ahead of others
* Closes: apache#36379

Authored-by: Benjamin Kietzman <[email protected]>
Signed-off-by: Sutou Kouhei <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[C++] Bundled GTest CI jobs seem to #includeing GTest headers from somewhere else
4 participants