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 filesystem related lib #1940

Open
wants to merge 9 commits into
base: unstable
Choose a base branch
from
Open

Add filesystem related lib #1940

wants to merge 9 commits into from

Conversation

Smityz
Copy link

@Smityz Smityz commented Dec 18, 2023

close: #1939

CMakeLists.txt Outdated
@@ -169,6 +169,7 @@ list(APPEND EXTERNAL_LIBS Threads::Threads)
list(APPEND EXTERNAL_LIBS ${Backtrace_LIBRARY})
list(APPEND EXTERNAL_LIBS xxhash)
list(APPEND EXTERNAL_LIBS span-lite)
list(APPEND EXTERNAL_LIBS stdc++fs)
Copy link
Member

Choose a reason for hiding this comment

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

Is this test only, or we may using it outside testing?

Copy link
Author

Choose a reason for hiding this comment

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

done

Copy link
Member

@PragmaTwice PragmaTwice left a comment

Choose a reason for hiding this comment

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

I am fine to link stdc++fs into kvrocks_objs rather than just tests, but here are some points need to be considered:

  • it seems in higher-version (>= 9) gcc (or, libstdc++) we don't need to explicitly link this library any more, so I wonder if it (stdc++fs) will be duplicated. I think we'd better to add a gcc version check here. BTW I encourage everyone to use new version of compiler as much as possible, e.g. gcc 12 or 13
  • what will happen if we use libc++ rather than libstdc++? Does libc++ also provide stdc++fs?

@PragmaTwice
Copy link
Member

CI failed on macOS, which is related to the case about libc++ rather than libstdc++ that I mentioned before. We need to add a check about the std lib impl that are currently using.

@Smityz
Copy link
Author

Smityz commented Dec 18, 2023

It is somewhat difficult to determine the versions of gcc/clang/libstdc++/libc++. We can first fix the case for gcc8, and then set a minimum version limit of 13 for Clang @PragmaTwice

Passed CI tests, PTAL @PragmaTwice @mapleFU

Copy link

sonarcloud bot commented Dec 19, 2023

Please retry analysis of this Pull-Request directly on SonarCloud

@@ -148,7 +148,6 @@ endif()
find_package(Threads REQUIRED)

list(APPEND EXTERNAL_LIBS glog)
list(APPEND EXTERNAL_LIBS snappy)
Copy link
Member

Choose a reason for hiding this comment

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

Hmmmm. Why is it deleted?

Copy link
Author

Choose a reason for hiding this comment

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

ld: warning: ignoring duplicate libraries: '_deps/snappy-build/libsnappy.a', 'clang_17.0_cxx17_64_relwithdebinfo/libtbb.a'

I found a warning when compiling with clang 17. It appears that deleting this line does not affect the compilation process.

Copy link
Member

Choose a reason for hiding this comment

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

I'd prefer to explicit list this dep instead of depend on transitive dep.

Copy link
Author

Choose a reason for hiding this comment

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

fixed

@Smityz Smityz changed the title Add stdc++fs lib Add filesystem related lib Dec 21, 2023
@tisonkun tisonkun requested review from mapleFU and PragmaTwice March 29, 2024 02:58
Copy link

sonarcloud bot commented Mar 29, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Can't build unittest with gcc8.5 and clang 12
4 participants