Skip to content

Conversation

@kou
Copy link
Member

@kou kou commented Apr 6, 2023

Rationale for this change

#34765 approach has some corner cases. They causes CI failures.

What changes are included in this PR?

If incompatible GoogleTest is detected, we can fallback to bundled GoogleTest automatically.

Are these changes tested?

Yes.

Are there any user-facing changes?

Yes.

@kou kou requested review from lidavidm and wjones127 as code owners April 6, 2023 03:28
@github-actions
Copy link

github-actions bot commented Apr 6, 2023

@github-actions
Copy link

github-actions bot commented Apr 6, 2023

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

@kou kou force-pushed the cpp-gtest-fallback branch 2 times, most recently from d8ccf7e to 199647d Compare April 6, 2023 03:30
@kou kou requested review from assignUser and raulcd as code owners April 6, 2023 03:30
@kou kou force-pushed the cpp-gtest-fallback branch from 199647d to a48266e Compare April 6, 2023 03:33
@kou
Copy link
Member Author

kou commented Apr 6, 2023

@github-actions crossbow submit test-alpine-linux-cpp

@github-actions

This comment was marked as outdated.

@kou kou force-pushed the cpp-gtest-fallback branch from a48266e to 536af6a Compare April 6, 2023 05:39
@kou
Copy link
Member Author

kou commented Apr 6, 2023

@github-actions crossbow submit test-alpine-linux-cpp

@kou kou force-pushed the cpp-gtest-fallback branch from 536af6a to a585e35 Compare April 6, 2023 05:39
@github-actions

This comment was marked as outdated.

@kou kou force-pushed the cpp-gtest-fallback branch 2 times, most recently from 0b9cf98 to 3440365 Compare April 6, 2023 06:13
@kou
Copy link
Member Author

kou commented Apr 6, 2023

@github-actions crossbow submit test-alpine-linux-cpp

@github-actions

This comment was marked as outdated.

@kou kou force-pushed the cpp-gtest-fallback branch from 3440365 to 3de38f0 Compare April 6, 2023 06:16
If incompatible GoogleTest is detected, we can fallback to bundled
GoogleTest automatically.
@kou kou force-pushed the cpp-gtest-fallback branch from 3de38f0 to 3815328 Compare April 6, 2023 06:52
@kou
Copy link
Member Author

kou commented Apr 6, 2023

@github-actions crossbow submit test-alpine-linux-cpp

@github-actions
Copy link

github-actions bot commented Apr 6, 2023

Revision: 3815328

Submitted crossbow builds: ursacomputing/crossbow @ actions-e991323147

Task Status
test-alpine-linux-cpp Github Actions

@jorisvandenbossche
Copy link
Member

Confirming that the latest version of the PR seems to work for me (with a gtest from conda):

...
-- Found GTest: /home/joris/miniconda3/envs/arrow-dev/lib/cmake/GTest/GTestConfig.cmake (found suitable version "1.13.0", minimum required is "1.10.0")  
...

On a previous version I got an error like "CMake Error: The source directory "SOURCES/CMakeFiles/CMakeTmp" does not exist" from FindGTestAlt.cmake:53 (try_compile)


set(ARROW_TEST_LINK_TOOLCHAIN arrow::flatbuffers GTest::gtest_main GTest::gtest
GTest::gmock)
set(ARROW_TEST_LINK_TOOLCHAIN arrow::flatbuffers ${ARROW_GTEST_GTEST_MAIN}
Copy link
Member

Choose a reason for hiding this comment

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

IMHO this is a regression as using variables instead of targets is an anti-pattern but I currently don't see a cleaner approach either.

I think we should rethink the entire dependency management once we have bumped the cmake version to 3.16 as we will have much better tools available. (this is of course out of scope for this PR)

Copy link
Member Author

Choose a reason for hiding this comment

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

@github-actions github-actions bot added awaiting changes Awaiting changes and removed awaiting committer review Awaiting committer review labels Apr 6, 2023
@kou
Copy link
Member Author

kou commented Apr 6, 2023

Confirming that the latest version of the PR seems to work for me (with a gtest from conda):

Thanks for confirming this!

On a previous version I got an error like "CMake Error: The source directory "SOURCES/CMakeFiles/CMakeTmp" does not exist" from FindGTestAlt.cmake:53 (try_compile)

Yes. I needed to write a code to work with newer CMake and older CMake. On a previous version this implementation worked only with newer CMake.

@kou
Copy link
Member Author

kou commented Apr 6, 2023

+1

@kou kou merged commit f7644ae into apache:main Apr 6, 2023
@kou kou deleted the cpp-gtest-fallback branch April 6, 2023 23:52
@ursabot
Copy link

ursabot commented Apr 8, 2023

Benchmark runs are scheduled for baseline = 6f3d96e and contender = f7644ae. f7644ae is a master commit associated with this PR. Results will be available as each benchmark for each run completes.
Conbench compare runs links:
[Finished ⬇️0.0% ⬆️0.0%] ec2-t3-xlarge-us-east-2
[Failed ⬇️3.09% ⬆️1.16%] test-mac-arm
[Finished ⬇️0.0% ⬆️0.0%] ursa-i9-9960x
[Failed ⬇️1.14% ⬆️0.98%] ursa-thinkcentre-m75q
Buildkite builds:
[Finished] f7644ae8 ec2-t3-xlarge-us-east-2
[Finished] f7644ae8 test-mac-arm
[Finished] f7644ae8 ursa-i9-9960x
[Finished] f7644ae8 ursa-thinkcentre-m75q
[Finished] 6f3d96ec ec2-t3-xlarge-us-east-2
[Failed] 6f3d96ec test-mac-arm
[Finished] 6f3d96ec ursa-i9-9960x
[Failed] 6f3d96ec ursa-thinkcentre-m75q
Supported benchmarks:
ec2-t3-xlarge-us-east-2: Supported benchmark langs: Python, R. Runs only benchmarks with cloud = True
test-mac-arm: Supported benchmark langs: C++, Python, R
ursa-i9-9960x: Supported benchmark langs: Python, R, JavaScript
ursa-thinkcentre-m75q: Supported benchmark langs: C++, Java

@zfoobar
Copy link

zfoobar commented Apr 8, 2023

This is a regression - build fails for me (macos/arm64/conda).

The only reason I could get it building is because I've been tracking this issue and knew to supply the proper BUNDLED flag. At least before the cmake module prompted you to put the flag in place if it detected the installed binaries weren't c++17.

It's back to the old behavior, build fails with the symbols it can't resolve.

@kou
Copy link
Member Author

kou commented Apr 9, 2023

Could you open a new issue with how to reproduce and full error log?

At least I can't reproduce it with macOS/arm64/Homebrew(not conda).

@zfoobar
Copy link

zfoobar commented Apr 9, 2023 via email

@kou
Copy link
Member Author

kou commented Apr 9, 2023

cmake --debug-trycompile ... will help us: https://cmake.org/cmake/help/latest/manual/cmake.1.html#cmdoption-cmake-debug-trycompile

liujiacheng777 pushed a commit to LoongArch-Python/arrow that referenced this pull request May 11, 2023
### Rationale for this change

apache#34765 approach has some corner cases. They causes CI failures.

### What changes are included in this PR?

If incompatible GoogleTest is detected, we can fallback to bundled GoogleTest automatically.

### Are these changes tested?

Yes.

### Are there any user-facing changes?

Yes.
* Closes: apache#34813

Authored-by: Sutou Kouhei <kou@clear-code.com>
Signed-off-by: Sutou Kouhei <kou@clear-code.com>
ArgusLi pushed a commit to Bit-Quill/arrow that referenced this pull request May 15, 2023
### Rationale for this change

apache#34765 approach has some corner cases. They causes CI failures.

### What changes are included in this PR?

If incompatible GoogleTest is detected, we can fallback to bundled GoogleTest automatically.

### Are these changes tested?

Yes.

### Are there any user-facing changes?

Yes.
* Closes: apache#34813

Authored-by: Sutou Kouhei <kou@clear-code.com>
Signed-off-by: Sutou Kouhei <kou@clear-code.com>
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++] Add an auto fallback solution when system Gtest is compiled with a C++ standard lower than 17.

5 participants