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-43164: [C++] Fix CMake link order for AWS SDK #43230

Merged
merged 1 commit into from
Jul 15, 2024
Merged

Conversation

llama90
Copy link
Contributor

@llama90 llama90 commented Jul 11, 2024

Rationale for this change

To resolve conflicts with AWS SDK for C++ static variables when linked with libarrow by ensuring correct link order.

What changes are included in this PR?

  • Adjusted CMakeLists.txt to set ARROW_S3_TEST_EXTRA_LINK_LIBS.
  • Ensured libarrow is linked before libaws* libraries.
  • Updated s3fs_test configuration to use the new link order.

Are these changes tested?

I ran the test locally and observed the same result as mentioned. Additionally, I confirmed that if ARROW_S3 is set to OFF or if the configuration includes exclude_tests=arrow-s3fs-test, the test is excluded.

Are there any user-facing changes?

No.

@github-actions github-actions bot added the awaiting review Awaiting review label Jul 11, 2024
Copy link

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

@llama90 llama90 changed the title GH-43164: [C++] Fix CMake link order to prevent AWS SDK for C++ static variable conflict GH-43164: [C++] Fix CMake link order for AWS SDK Jul 13, 2024
@llama90
Copy link
Contributor Author

llama90 commented Jul 13, 2024

arrow-s3fs-test result
70: Test command: /Users/lama/workspace/arrow-new/cpp/build-support/run-test.sh "/Users/lama/workspace/arrow-new/cpp/cmake-build-debug-preset-filesystems" "test" "/Users/lama/workspace/arrow-new/cpp/cmake-build-debug-preset-filesystems/debug//arrow-s3fs-test"
70: Working Directory: /Users/lama/workspace/arrow-new/cpp/cmake-build-debug-preset-filesystems/src/arrow/filesystem
70: Test timeout computed to be: 10000000
70: Running arrow-s3fs-test, redirecting output into /Users/lama/workspace/arrow-new/cpp/cmake-build-debug-preset-filesystems/build/test-logs/arrow-s3fs-test.txt (attempt 1/1)
70: Running main() from /Users/lama/workspace/arrow-new/cpp/cmake-build-debug-preset-filesystems/_deps/googletest-src/googletest/src/gtest_main.cc
70: [==========] Running 69 tests from 7 test suites.
70: [----------] Global test environment set-up.
70: [----------] 3 tests from S3OptionsTest
70: [ RUN      ] S3OptionsTest.FromUri
70: [       OK ] S3OptionsTest.FromUri (903 ms)
70: [ RUN      ] S3OptionsTest.FromAccessKey
70: [       OK ] S3OptionsTest.FromAccessKey (0 ms)
70: [ RUN      ] S3OptionsTest.FromAssumeRole
70: [       OK ] S3OptionsTest.FromAssumeRole (1 ms)
70: [----------] 3 tests from S3OptionsTest (906 ms total)
70: 
70: [----------] 4 tests from S3RegionResolutionTest
70: [ RUN      ] S3RegionResolutionTest.PublicBucket
70: [       OK ] S3RegionResolutionTest.PublicBucket (1327 ms)
70: [ RUN      ] S3RegionResolutionTest.RestrictedBucket
70: [       OK ] S3RegionResolutionTest.RestrictedBucket (37 ms)
70: [ RUN      ] S3RegionResolutionTest.NonExistentBucket
70: [       OK ] S3RegionResolutionTest.NonExistentBucket (31 ms)
70: [ RUN      ] S3RegionResolutionTest.InvalidBucketName
70: [       OK ] S3RegionResolutionTest.InvalidBucketName (0 ms)
70: [----------] 4 tests from S3RegionResolutionTest (1400 ms total)
70: 
70: [----------] 2 tests from S3FileSystemRegionTest
70: [ RUN      ] S3FileSystemRegionTest.Default
70: /Users/lama/workspace/arrow-new/cpp/src/arrow/filesystem/s3fs_test.cc:395: Failure
70: Expected equality of these values:
70:   s3fs->region()
70:     Which is: "ap-northeast-2"
70:   "us-east-1"
70: [  FAILED  ] S3FileSystemRegionTest.Default (0 ms)
70: [ RUN      ] S3FileSystemRegionTest.EnvironmentVariable
70: [       OK ] S3FileSystemRegionTest.EnvironmentVariable (2 ms)
70: [----------] 2 tests from S3FileSystemRegionTest (2 ms total)
70: 
70: [----------] 1 test from TestMinioServer
70: [ RUN      ] TestMinioServer.Connect
70: [       OK ] TestMinioServer.Connect (780 ms)
70: [----------] 1 test from TestMinioServer (780 ms total)
70: 
70: [----------] 32 tests from TestS3FS
70: [ RUN      ] TestS3FS.GetFileInfoRoot
70: [       OK ] TestS3FS.GetFileInfoRoot (30 ms)
70: [ RUN      ] TestS3FS.GetFileInfoBucket
70: [       OK ] TestS3FS.GetFileInfoBucket (33 ms)
70: [ RUN      ] TestS3FS.GetFileInfoObject
70: [       OK ] TestS3FS.GetFileInfoObject (80 ms)
70: [ RUN      ] TestS3FS.GetFileInfoSelector
70: [       OK ] TestS3FS.GetFileInfoSelector (77 ms)
70: [ RUN      ] TestS3FS.GetFileInfoSelectorRecursive
70: [       OK ] TestS3FS.GetFileInfoSelectorRecursive (68 ms)
70: [ RUN      ] TestS3FS.GetFileInfoGenerator
70: [       OK ] TestS3FS.GetFileInfoGenerator (78 ms)
70: [ RUN      ] TestS3FS.GetFileInfoGeneratorStress
70: [       OK ] TestS3FS.GetFileInfoGeneratorStress (8646 ms)
70: [ RUN      ] TestS3FS.GetFileInfoGeneratorCancelled
70: [       OK ] TestS3FS.GetFileInfoGeneratorCancelled (28 ms)
70: [ RUN      ] TestS3FS.CreateDir
70: /Users/lama/workspace/arrow-new/cpp/src/arrow/filesystem/s3fs_test.cc:955: Failure
70: Failed
70: Expected 'fs_->CreateDir("bucket/somefile")' to fail with IOError, but got OK
70: [  FAILED  ] TestS3FS.CreateDir (71 ms)
70: [ RUN      ] TestS3FS.DeleteFile
70: [       OK ] TestS3FS.DeleteFile (37 ms)
70: [ RUN      ] TestS3FS.DeleteDir
70: [       OK ] TestS3FS.DeleteDir (70 ms)
70: [ RUN      ] TestS3FS.DeleteDirContents
70: [       OK ] TestS3FS.DeleteDirContents (72 ms)
70: [ RUN      ] TestS3FS.DeleteDirContentsAsync
70: [       OK ] TestS3FS.DeleteDirContentsAsync (58 ms)
70: [ RUN      ] TestS3FS.CopyFile
70: [       OK ] TestS3FS.CopyFile (85 ms)
70: [ RUN      ] TestS3FS.Move
70: [       OK ] TestS3FS.Move (73 ms)
70: [ RUN      ] TestS3FS.OpenInputStream
70: [       OK ] TestS3FS.OpenInputStream (42 ms)
70: [ RUN      ] TestS3FS.OpenInputStreamMetadata
70: [       OK ] TestS3FS.OpenInputStreamMetadata (46 ms)
70: [ RUN      ] TestS3FS.OpenInputFile
70: [       OK ] TestS3FS.OpenInputFile (68 ms)
70: [ RUN      ] TestS3FS.OpenOutputStreamBackgroundWrites
70: [       OK ] TestS3FS.OpenOutputStreamBackgroundWrites (631 ms)
70: [ RUN      ] TestS3FS.OpenOutputStreamSyncWrites
70: [       OK ] TestS3FS.OpenOutputStreamSyncWrites (565 ms)
70: [ RUN      ] TestS3FS.OpenOutputStreamAbortBackgroundWrites
70: [       OK ] TestS3FS.OpenOutputStreamAbortBackgroundWrites (38 ms)
70: [ RUN      ] TestS3FS.OpenOutputStreamAbortSyncWrites
70: [       OK ] TestS3FS.OpenOutputStreamAbortSyncWrites (33 ms)
70: [ RUN      ] TestS3FS.OpenOutputStreamDestructorBackgroundWrites
70: [       OK ] TestS3FS.OpenOutputStreamDestructorBackgroundWrites (36 ms)
70: [ RUN      ] TestS3FS.OpenOutputStreamDestructorSyncWrite
70: [       OK ] TestS3FS.OpenOutputStreamDestructorSyncWrite (47 ms)
70: [ RUN      ] TestS3FS.OpenOutputStreamAsyncDestructorBackgroundWrites
70: [       OK ] TestS3FS.OpenOutputStreamAsyncDestructorBackgroundWrites (70 ms)
70: [ RUN      ] TestS3FS.OpenOutputStreamAsyncDestructorSyncWrite
70: [       OK ] TestS3FS.OpenOutputStreamAsyncDestructorSyncWrite (71 ms)
70: [ RUN      ] TestS3FS.OpenOutputStreamCloseAsyncFutureDeadlockBackgroundWrites
70: [       OK ] TestS3FS.OpenOutputStreamCloseAsyncFutureDeadlockBackgroundWrites (77 ms)
70: [ RUN      ] TestS3FS.OpenOutputStreamCloseAsyncFutureDeadlockSyncWrite
70: [       OK ] TestS3FS.OpenOutputStreamCloseAsyncFutureDeadlockSyncWrite (72 ms)
70: [ RUN      ] TestS3FS.OpenOutputStreamMetadata
70: [       OK ] TestS3FS.OpenOutputStreamMetadata (110 ms)
70: [ RUN      ] TestS3FS.FileSystemFromUri
70: [       OK ] TestS3FS.FileSystemFromUri (33 ms)
70: [ RUN      ] TestS3FS.NoCreateDeleteBucket
70: [       OK ] TestS3FS.NoCreateDeleteBucket (59 ms)
70: [ RUN      ] TestS3FS.CustomRetryStrategy
70: [       OK ] TestS3FS.CustomRetryStrategy (59 ms)
70: [----------] 32 tests from TestS3FS (11580 ms total)
70: 
70: [----------] 26 tests from TestS3FSGeneric
70: [ RUN      ] TestS3FSGeneric.Empty
70: [       OK ] TestS3FSGeneric.Empty (37 ms)
70: [ RUN      ] TestS3FSGeneric.NormalizePath
70: [       OK ] TestS3FSGeneric.NormalizePath (25 ms)
70: [ RUN      ] TestS3FSGeneric.CreateDir
70: /Users/lama/workspace/arrow-new/cpp/src/arrow/filesystem/test_util.cc:244: Failure
70: Failed
70: Expected 'fs->CreateDir("AB/def/EF/GH", true )' to fail with IOError, but got OK
70: [  FAILED  ] TestS3FSGeneric.CreateDir (117 ms)
70: [ RUN      ] TestS3FSGeneric.DeleteDir
70: [       OK ] TestS3FSGeneric.DeleteDir (150 ms)
70: [ RUN      ] TestS3FSGeneric.DeleteDirContents
70: [       OK ] TestS3FSGeneric.DeleteDirContents (133 ms)
70: [ RUN      ] TestS3FSGeneric.DeleteRootDirContents
70: [       OK ] TestS3FSGeneric.DeleteRootDirContents (48 ms)
70: [ RUN      ] TestS3FSGeneric.DeleteFile
70: [       OK ] TestS3FSGeneric.DeleteFile (70 ms)
70: [ RUN      ] TestS3FSGeneric.DeleteFiles
70: [       OK ] TestS3FSGeneric.DeleteFiles (104 ms)
70: [ RUN      ] TestS3FSGeneric.MoveFile
70: /Users/lama/workspace/arrow-new/cpp/src/arrow/filesystem/test_util.cc:450: Failure
70: Failed
70: Expected 'fs->Move("AB/pqr", "xxx/mno")' to fail with IOError, but got OK
70: [  FAILED  ] TestS3FSGeneric.MoveFile (164 ms)
70: [ RUN      ] TestS3FSGeneric.MoveDir
70: /Users/lama/workspace/arrow-new/cpp/src/arrow/filesystem/test_util.cc:461: Skipped
70: Filesystem doesn't allow moving directories
70: [  SKIPPED ] TestS3FSGeneric.MoveDir (18 ms)
70: [ RUN      ] TestS3FSGeneric.CopyFile
70: /Users/lama/workspace/arrow-new/cpp/src/arrow/filesystem/test_util.cc:572: Failure
70: Failed
70: Expected 'fs->CopyFile("AB/abc", "def/mno")' to fail with IOError, but got OK
70: [  FAILED  ] TestS3FSGeneric.CopyFile (94 ms)
70: [ RUN      ] TestS3FSGeneric.GetFileInfo
70: [       OK ] TestS3FSGeneric.GetFileInfo (80 ms)
70: [ RUN      ] TestS3FSGeneric.GetFileInfoVector
70: [       OK ] TestS3FSGeneric.GetFileInfoVector (64 ms)
70: [ RUN      ] TestS3FSGeneric.GetFileInfoSelector
70: [       OK ] TestS3FSGeneric.GetFileInfoSelector (104 ms)
70: [ RUN      ] TestS3FSGeneric.GetFileInfoSelectorWithRecursion
70: [       OK ] TestS3FSGeneric.GetFileInfoSelectorWithRecursion (107 ms)
70: [ RUN      ] TestS3FSGeneric.GetFileInfoAsync
70: [       OK ] TestS3FSGeneric.GetFileInfoAsync (67 ms)
70: [ RUN      ] TestS3FSGeneric.GetFileInfoGenerator
70: [       OK ] TestS3FSGeneric.GetFileInfoGenerator (72 ms)
70: [ RUN      ] TestS3FSGeneric.OpenOutputStream
70: [       OK ] TestS3FSGeneric.OpenOutputStream (95 ms)
70: [ RUN      ] TestS3FSGeneric.OpenAppendStream
70: /Users/lama/workspace/arrow-new/cpp/src/arrow/filesystem/test_util.cc:946: Skipped
70: Filesystem doesn't allow file appends
70: [  SKIPPED ] TestS3FSGeneric.OpenAppendStream (23 ms)
70: [ RUN      ] TestS3FSGeneric.OpenInputStream
70: [       OK ] TestS3FSGeneric.OpenInputStream (85 ms)
70: [ RUN      ] TestS3FSGeneric.OpenInputStreamWithFileInfo
70: [       OK ] TestS3FSGeneric.OpenInputStreamWithFileInfo (80 ms)
70: [ RUN      ] TestS3FSGeneric.OpenInputStreamAsync
70: [       OK ] TestS3FSGeneric.OpenInputStreamAsync (79 ms)
70: [ RUN      ] TestS3FSGeneric.OpenInputFile
70: [       OK ] TestS3FSGeneric.OpenInputFile (71 ms)
70: [ RUN      ] TestS3FSGeneric.OpenInputFileWithFileInfo
70: [       OK ] TestS3FSGeneric.OpenInputFileWithFileInfo (44 ms)
70: [ RUN      ] TestS3FSGeneric.OpenInputFileAsync
70: [       OK ] TestS3FSGeneric.OpenInputFileAsync (58 ms)
70: [ RUN      ] TestS3FSGeneric.SpecialChars
70: [       OK ] TestS3FSGeneric.SpecialChars (79 ms)
70: [----------] 26 tests from TestS3FSGeneric (2083 ms total)
70: 
70: [----------] 1 test from S3GlobalOptions
70: [ RUN      ] S3GlobalOptions.DefaultsLogLevel
70: [       OK ] S3GlobalOptions.DefaultsLogLevel (0 ms)
70: [----------] 1 test from S3GlobalOptions (0 ms total)
70: 
70: [----------] Global test environment tear-down
70: [==========] 69 tests from 7 test suites ran. (16795 ms total)
70: [  PASSED  ] 62 tests.
70: [  SKIPPED ] 2 tests, listed below:
70: [  SKIPPED ] TestS3FSGeneric.MoveDir
70: [  SKIPPED ] TestS3FSGeneric.OpenAppendStream
70: [  FAILED  ] 5 tests, listed below:
70: [  FAILED  ] S3FileSystemRegionTest.Default
70: [  FAILED  ] TestS3FS.CreateDir
70: [  FAILED  ] TestS3FSGeneric.CreateDir
70: [  FAILED  ] TestS3FSGeneric.MoveFile
70: [  FAILED  ] TestS3FSGeneric.CopyFile
70: 
70:  5 FAILED TESTS
70: ~/workspace/arrow-new/cpp/cmake-build-debug-preset-filesystems/src/arrow/filesystem
Errors while running CTest
Output from these tests are in: /Users/lama/workspace/arrow-new/cpp/cmake-build-debug-preset-filesystems/Testing/Temporary/LastTest.log
Use "--rerun-failed --output-on-failure" to re-run the failed cases verbosely.
Failed

@llama90
Copy link
Contributor Author

llama90 commented Jul 13, 2024

@kou Hello. Could you review this when your free time? Thank you.

I am using an M1 MacBook, and I noticed that my local tests are failing while the CI tests are passing. I found that certain environments are not running the tests for ARROW_S3, including the following:

I encountered some failing test cases. Is it safe to ignore these for now? How should I proceed to improve the situation? I'm curious why the S3 tests are excluded in these environments and how to address this issue.

// Existing "file", should fail
ASSERT_RAISES(IOError, fs_->CreateDir("bucket/somefile"));

I suspect that some tests might be designed to test the file system semantics on object storage (MinIO). For example, in object storage, uploading an object (file) with the same prefix (folder) often does not check for pre-existence and may manage via versioning or overwrite the existing object.

However, upon examining the tests, they seem to fail when a file already exists, but because MinIO is used internally for testing, it operates with object storage semantics, leading to test failures.

@kou
Copy link
Member

kou commented Jul 13, 2024

@github-actions crossbow submit -g cpp java-jars

@kou
Copy link
Member

kou commented Jul 13, 2024

I encountered some failing test cases. Is it safe to ignore these for now? How should I proceed to improve the situation?

Could you open an issue (or issues?) for them?

I'm curious why the S3 tests are excluded in these environments and how to address this issue.

Is this issue correct? It seems that it's unrelated...

This comment was marked as outdated.

@kou
Copy link
Member

kou commented Jul 13, 2024

Could you rebase on main for e59832f ?

@llama90
Copy link
Contributor Author

llama90 commented Jul 14, 2024

Could you rebase on main for e59832f ?

Done!

Is this issue correct? It seems that it's unrelated...

Ah...! I reviewed this again.

Could you open an issue (or issues?) for them?

I have identified various issues such as the Minio version and timeout problems. It seems the issue is related to various factors. Let's examine each one in detail. If necessary, I will create a new issue.

Thank you for your review!

@kou
Copy link
Member

kou commented Jul 14, 2024

@github-actions crossbow submit -g cpp java-jars

Copy link

Revision: f567995

Submitted crossbow builds: ursacomputing/crossbow @ actions-c9ef5bb9e8

Task Status
java-jars GitHub Actions
test-alpine-linux-cpp GitHub Actions
test-build-cpp-fuzz GitHub Actions
test-conda-cpp GitHub Actions
test-conda-cpp-valgrind GitHub Actions
test-cuda-cpp GitHub Actions
test-debian-12-cpp-amd64 GitHub Actions
test-debian-12-cpp-i386 GitHub Actions
test-fedora-39-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-emscripten GitHub Actions
test-ubuntu-22.04-cpp-no-threading GitHub Actions
test-ubuntu-24.04-cpp GitHub Actions
test-ubuntu-24.04-cpp-gcc-14 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

@kou kou merged commit 57ac40c into apache:main Jul 15, 2024
39 checks passed
@kou kou removed the awaiting review Awaiting review label Jul 15, 2024
@github-actions github-actions bot added the awaiting merge Awaiting merge label Jul 15, 2024
Copy link

After merging your PR, Conbench analyzed the 4 benchmarking runs that have been run so far on merge-commit 57ac40c.

There were no benchmark performance regressions. 🎉

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

@vibhatha
Copy link
Collaborator

@github-actions crossbow submit -g java

Copy link

Revision: f567995

Submitted crossbow builds: ursacomputing/crossbow @ actions-e631314dd9

Task Status
java-jars GitHub Actions
test-conda-python-3.10-spark-v3.5.0 GitHub Actions
test-conda-python-3.11-spark-master GitHub Actions
test-conda-python-3.8-spark-v3.5.0 GitHub Actions
verify-rc-source-java-linux-almalinux-8-amd64 GitHub Actions
verify-rc-source-java-linux-conda-latest-amd64 GitHub Actions
verify-rc-source-java-linux-ubuntu-20.04-amd64 GitHub Actions
verify-rc-source-java-linux-ubuntu-22.04-amd64 GitHub Actions
verify-rc-source-java-macos-amd64 GitHub Actions

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.

3 participants